Introducing Android BeamAndroid Beam, introduced in Android 4.0 (API l dịch - Introducing Android BeamAndroid Beam, introduced in Android 4.0 (API l Việt làm thế nào để nói

Introducing Android BeamAndroid Bea

Introducing Android Beam
Android Beam, introduced in Android 4.0 (API level 14), provides a simple API for an application to transmit data between two devices using NFC, simply by placing them back-to-back. For example, the native contacts, browser, and YouTube applications use Android Beam to share the currently viewed contact, web page, and video, respectively, with other devices.
To beam messages, your application must be in the foreground and the device receiving the data must not be locked.
Android Beam is initiated by tapping two NFC-enabled Android devices together. Users are presented with a “touch to beam” UI, at which point they can choose to “beam” the foreground application to the other device.
Android Beam uses NFC to push NDEF messages between devices when they are physically placed together.
By enabling Android Beam within your application, you can define the payload of the beamed message. If you don’t customize the message, the default action for your application will be to launch it on the target device. If your application isn’t installed on the target device, the Google Play Store will launch and display your application’s details page.
To define the message your application beams, you need to request the NFC permission in the manifest:

The process to define your own custom payload is described as follows:
1. Create an NdefMessage object that contains an NdefRecord that contains your message payload.
2. Assign your Ndef Message to the NFC Adapter as your Android Beam payload.
3. Configure your application to listen for incoming Android Beam messages.
Creating Android Beam Messages
To create a new Ndef Message, create a new NdefMessage object that contains at least one NdefRecord containing the payload you want to beam to your application on the target device.
When creating a new Ndef Record, you must specify the type of record it represents, a MIME type, an ID, and a payload. There are several common types of Ndef Record that can be used to transmit data using Android Beam; note that they should always be the first record added to each beamed message. 
Using the NdefRecord.TNF_MlME_MEDlA type, you can transmit an absolute URI:
NdefRecord uriRecord = new NdefRecord(
NdefRecord.TNF_ABS0LUTE_URI,
"http://blog.radioactiveyak.com".getBytes(Charset.forName("US-ASCII")), new byte[0], new byte[0]);
This is the most common Ndef Record transmitted using Android Beam because the received Intent will be of the same form as any Intent used to start an Activity. The Intent Filter used to decide which NFC messages a particular Activity should receive can use the scheme, host, and path Prefix attributes.
If you need to transmit messages that contain information that can’t be easily interpreted as a URI, the NdefRecord.TNF_MiME_MEDiA type supports the creation of an application-specific MIME type and the inclusion of associated payload data:
byte[] mimeType = "application/com.paad.nfcbeamu.getBytes(Charset.forName("US-ASCII")); byte[] tagId = new byte[0];
byte[] payload = "Not a URIu.getBytes(Charset.forName("US-ASCII"));
NdefRecord mimeRecord = new NdefRecord(
NdefRecord.TNF_MIME_MEDIA,
mimeType,
tagId,
payload);
A more complete examination of the available NDEF record types and how to use them can be found in the Android Developer Guide (http://developer.android.com/guide/topics/nfc/ nfc.html#creating-
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
Introducing Android BeamAndroid Beam, introduced in Android 4.0 (API level 14), provides a simple API for an application to transmit data between two devices using NFC, simply by placing them back-to-back. For example, the native contacts, browser, and YouTube applications use Android Beam to share the currently viewed contact, web page, and video, respectively, with other devices.To beam messages, your application must be in the foreground and the device receiving the data must not be locked.Android Beam is initiated by tapping two NFC-enabled Android devices together. Users are presented with a “touch to beam” UI, at which point they can choose to “beam” the foreground application to the other device.Android Beam uses NFC to push NDEF messages between devices when they are physically placed together.By enabling Android Beam within your application, you can define the payload of the beamed message. If you don’t customize the message, the default action for your application will be to launch it on the target device. If your application isn’t installed on the target device, the Google Play Store will launch and display your application’s details page.To define the message your application beams, you need to request the NFC permission in the manifest:The process to define your own custom payload is described as follows:1. Create an NdefMessage object that contains an NdefRecord that contains your message payload.2. Assign your Ndef Message to the NFC Adapter as your Android Beam payload.
3. Configure your application to listen for incoming Android Beam messages.
Creating Android Beam Messages
To create a new Ndef Message, create a new NdefMessage object that contains at least one NdefRecord containing the payload you want to beam to your application on the target device.
When creating a new Ndef Record, you must specify the type of record it represents, a MIME type, an ID, and a payload. There are several common types of Ndef Record that can be used to transmit data using Android Beam; note that they should always be the first record added to each beamed message. 
Using the NdefRecord.TNF_MlME_MEDlA type, you can transmit an absolute URI:
NdefRecord uriRecord = new NdefRecord(
NdefRecord.TNF_ABS0LUTE_URI,
"http://blog.radioactiveyak.com".getBytes(Charset.forName("US-ASCII")), new byte[0], new byte[0]);
This is the most common Ndef Record transmitted using Android Beam because the received Intent will be of the same form as any Intent used to start an Activity. The Intent Filter used to decide which NFC messages a particular Activity should receive can use the scheme, host, and path Prefix attributes.
If you need to transmit messages that contain information that can’t be easily interpreted as a URI, the NdefRecord.TNF_MiME_MEDiA type supports the creation of an application-specific MIME type and the inclusion of associated payload data:
byte[] mimeType = "application/com.paad.nfcbeamu.getBytes(Charset.forName("US-ASCII")); byte[] tagId = new byte[0];
byte[] payload = "Not a URIu.getBytes(Charset.forName("US-ASCII"));
NdefRecord mimeRecord = new NdefRecord(
NdefRecord.TNF_MIME_MEDIA,
mimeType,
tagId,
payload);
A more complete examination of the available NDEF record types and how to use them can be found in the Android Developer Guide (http://developer.android.com/guide/topics/nfc/ nfc.html#creating-
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
Giới thiệu Android Beam
Android Beam, giới thiệu trong Android 4.0 (API ở mức 14), cung cấp một API đơn giản cho một ứng dụng để truyền dữ liệu giữa hai thiết bị sử dụng NFC, chỉ đơn giản bằng cách đặt chúng trở lại-to-back. Ví dụ, các bản địa chỉ liên lạc, trình duyệt và ứng dụng YouTube sử dụng Android Beam để chia sẻ những xúc hiện đã được xem, trang web, và video, tương ứng, với các thiết bị khác.
Để thông điệp tia, ứng dụng của bạn phải được ở tiền cảnh và các thiết bị nhận được dữ liệu không bị khóa lại.
Android beam được bắt đầu bằng cách khai thác hai thiết bị Android kích hoạt NFC với nhau. Người dùng được trình bày với một giao diện người dùng "chạm để truyền", và lúc đó họ có thể chọn "chùm" các ứng dụng đang chạy với các thiết bị khác.
Android Beam sử dụng NFC để đẩy thông điệp NDEF giữa các thiết bị khi họ có thể chất được đặt lại với nhau.
Bằng cách cho phép Android chùm bên trong ứng dụng của bạn, bạn có thể xác định tải trọng của thông điệp tươi cười. Nếu bạn không tùy chỉnh các thông báo, hành động mặc định cho các ứng dụng của bạn sẽ được khởi chạy nó trên các thiết bị mục tiêu. . Nếu ứng dụng của bạn không được cài đặt trên thiết bị mục tiêu, Google Play Store sẽ khởi động và hiển thị trang chi tiết của ứng dụng của bạn
để xác định tin nhắn dầm ứng dụng của bạn, bạn cần yêu cầu sự cho phép NFC trong biểu hiện:

Quá trình để xác định tải trọng riêng của bạn được mô tả như sau:
1. Tạo một đối tượng NdefMessage có chứa một NdefRecord chứa trọng tải thông điệp của bạn.
2. Gán NDEF tin nhắn của bạn để Adapter NFC như tải trọng Android Beam của bạn.
3. Cấu hình ứng dụng của bạn để nghe thông báo của Android Beam đến.
Tạo Tin nhắn của Android Beam
Để tạo một NDEF mới tin, tạo ra một đối tượng NdefMessage mới có chứa ít nhất một NdefRecord chứa tải trọng bạn muốn chùm để ứng dụng của bạn trên thiết bị mục tiêu.
Khi tạo một NDEF Ghi ​​mới, bạn phải xác định các loại hồ sơ nó đại diện cho một loại MIME, một ID, và tải trọng. Có một số loại phổ biến của NDEF Ghi ​​có thể được sử dụng để truyền dữ liệu sử dụng Android Beam; . lưu ý rằng họ nên luôn luôn được ghi nhận đầu tiên thêm vào mỗi tin nhắn chiếu 
Sử dụng các loại NdefRecord.TNF_MlME_MEDlA, bạn có thể truyền tải một URI tuyệt đối:
NdefRecord uriRecord = new byte mới [0], byte mới [0]); Điều này là phổ biến nhất NDEF Ghi ​​truyền sử dụng Android Beam vì ý định nhận được sẽ có dạng tương tự như bất kỳ ý định sử dụng để bắt đầu một hoạt động. Lọc Ý định sử dụng để quyết định thông điệp NFC một hành động cụ thể nên nhận được có thể sử dụng chương trình, chủ nhà, và con đường Prefix thuộc tính. Nếu bạn cần để truyền tải thông điệp có chứa thông tin có thể không được dễ dàng như là một URI, các NdefRecord.TNF_MiME_MEDiA loại hỗ trợ việc tạo một kiểu MIME ứng dụng cụ thể và bao gồm các dữ liệu tải trọng liên quan: byte [] mIMETYPE = "application / com.paad.nfcbeamu.getBytes (Charset.forName (" US-ASCII ")); byte [] tagId = new byte [0]; byte [] tải trọng = "Không phải là một URIu.getBytes (Charset.forName (" US-ASCII ")); NdefRecord mimeRecord = new NdefRecord ( NdefRecord.TNF_MIME_MEDIA, mIMETYPE, tagId, payload); một kiểm tra đầy đủ hơn về có sẵn các loại hồ sơ NDEF và làm thế nào để sử dụng chúng có thể được tìm thấy trong Hướng dẫn cho nhà phát triển Android (http://developer.android.com/guide/topics/nfc/ nfc.html # creating-











đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2025 I Love Translation. All reserved.

E-mail: