12.2 Implement a new Broadcast Receiver to listen for this Broadcast I dịch - 12.2 Implement a new Broadcast Receiver to listen for this Broadcast I Việt làm thế nào để nói

12.2 Implement a new Broadcast Rece

12.2 Implement a new Broadcast Receiver to listen for this Broadcast Intent. Override its onReceive handler to confirm that the SMS was successfully delivered; if it wasn’t, put the intended recipient back onto the requester Array List.
12.3 Finally, register and unregister the new Broadcast Receiver by extending the onResume and onPause handlers of the Emergency Responder Activity:
All code snippets in this example are part of the Chapter 12 Emergency Responder Part 1 project, available for download at www.wrox.com.
This example has been simplified to focus on the SMS-based functionality it is attempting to demon¬strate. Keen-eyed observers should have noticed at least three areas where it could be improved:
> The Broadcast Receiver created and registered in steps 6 and 7 would be better registered within the manifest to allow the application to respond to incoming SMS messages even when it isn’t running.
^ The parsing of the incoming SMS messages performed by the Broadcast Receiver in steps
6 and 8 should be moved into a Service and executed on a background thread. Similarly, step 12, sending the response SMS messages, would be better executed on a background thread within a Service.
^ The UI should be implemented using Fragments within Activities, with the UI optimized for tablet and smartphone layouts.
The implementation of these improvements is left as an exercise for the reader.
Automating the Emergency Responder
In the following example, you’ll fill in the code behind the Setup Auto Responder button added in the previous example, to let the Emergency Responder automatically respond to status update requests.
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
12.2 Implement a new Broadcast Receiver to listen for this Broadcast Intent. Override its onReceive handler to confirm that the SMS was successfully delivered; if it wasn’t, put the intended recipient back onto the requester Array List.12.3 Finally, register and unregister the new Broadcast Receiver by extending the onResume and onPause handlers of the Emergency Responder Activity:All code snippets in this example are part of the Chapter 12 Emergency Responder Part 1 project, available for download at www.wrox.com.This example has been simplified to focus on the SMS-based functionality it is attempting to demon¬strate. Keen-eyed observers should have noticed at least three areas where it could be improved:> The Broadcast Receiver created and registered in steps 6 and 7 would be better registered within the manifest to allow the application to respond to incoming SMS messages even when it isn’t running.^ The parsing of the incoming SMS messages performed by the Broadcast Receiver in steps6 and 8 should be moved into a Service and executed on a background thread. Similarly, step 12, sending the response SMS messages, would be better executed on a background thread within a Service.^ The UI should be implemented using Fragments within Activities, with the UI optimized for tablet and smartphone layouts.The implementation of these improvements is left as an exercise for the reader.Automating the Emergency ResponderIn the following example, you’ll fill in the code behind the Setup Auto Responder button added in the previous example, to let the Emergency Responder automatically respond to status update requests.
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
12.2 Thực hiện một Broadcast Receiver mới để lắng nghe ý định phát sóng này. Ghi đè xử lý onReceive của nó để xác nhận rằng các tin nhắn SMS được chuyển giao thành công; nếu nó không được, đưa người nhận trở lại vào Danh sách yêu cầu Array.
12,3 Cuối cùng, đăng ký và chưa đăng ký nhận Broadcast mới bằng cách mở rộng onResume và xử lý onPause của hoạt động khẩn cấp Responder:
Tất cả các đoạn mã trong ví dụ này là một phần của Chương 12 Emergency Responder Phần 1 dự án, có sẵn để tải về tại www.wrox.com.
Ví dụ này đã được đơn giản hóa để tập trung vào các chức năng SMS dựa trên nó đang cố gắng demon¬strate. Quan sát Keen mắt nên đã nhận ít nhất là ba lĩnh vực mà nó có thể được cải thiện:
> Các Broadcast Receiver tạo và đăng ký ở bước 6 và 7 sẽ được đăng ký tốt hơn trong các biểu hiện để cho phép các ứng dụng để đáp ứng với các tin nhắn SMS, ngay cả khi nó isn 't chạy.
^ các phân tích của các tin nhắn SMS được thực hiện bởi các Broadcast Receiver ở bước
6 và 8 nên được chuyển vào một dịch vụ và thực hiện trên một sợi nền. Tương tự như vậy, bước 12, gửi tin nhắn SMS phản ứng, sẽ được thực hiện tốt hơn trên một sợi nền trong một dịch vụ.
^ Các giao diện người dùng nên sử dụng các mảnh vỡ trong hoạt động, với giao diện người dùng được tối ưu hóa cho máy tính bảng và điện thoại thông minh bố trí.
Việc thực hiện những cải tiến này là trái như là một tập thể dục cho người đọc.
tự động hoá việc Responder khẩn cấp
trong ví dụ sau đây, bạn sẽ điền vào trong các mã sau Setup nút Auto Responder được thêm vào trong các ví dụ trước, để cho các Responder khẩn cấp tự động đáp ứng yêu cầu cập nhật trạng thái.
đ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: