Bài giảng Lập trình cho thiết bị di động: Chương 5 - ĐH Đồng Nai

Bài giảng Lập trình cho thiết bị di động: Chương 5 - Networking APIs VÀ Multimedia APIs trình bày các nội dung về Networking APIs và Multimedia APIs. Tham khảo nội dung bài giảng để hiểu rõ hơn về các nội dung trên. | 1 API 1 Networking APIs 2 Multimedia APIs 1 2 1. Networking APIs Understanding Mobile Networking Strict Mode with Networking Accessing the Internet (HTTP) 2 3 Understanding Mobile Networking Networking on the Android platform is standardized, using a combination of powerful yet familiar technologies and libraries such as . Network implementation is generally straightforward, but mobile application developers need to plan for less stable connectivity than one might expect in a home or office network setting—connectivity depends on the location of the users and their devices. developer must take extra care when designing network-enabled applications 3 4 Strict Mode with Networking Strict mode is a method that developers can use to detect operations performed on the main thread that should not be there. API Level 11 expanded upon strict mode in ways that impact networking code. By default, if you perform network operations on the main thread, your application throws an exception, specifically . 2 ways to avoid this is to use proper coding techniques and put all networking operations on a thread other than the main thread (should use AsyncTask class). Or call the permitAll() method to skip strict mode entirely 4 5 Strict Mode with Networking If you want to use networking in Main Thread, the coding: if ( > 10) { policy = new () .permitAll().build(); (policy); } This is not recommended for production applications. WHY? The next slide you will learn 3 ways to create Thread for networking, to see details please click the link below: 5 6 Strict Mode with Networking 1 - If not, you must write coding on a Thread other At first, this code seems to be a good solution to your problem, as it does not block the UI thread. . | 1 API 1 Networking APIs 2 Multimedia APIs 1 2 1. Networking APIs Understanding Mobile Networking Strict Mode with Networking Accessing the Internet (HTTP) 2 3 Understanding Mobile Networking Networking on the Android platform is standardized, using a combination of powerful yet familiar technologies and libraries such as . Network implementation is generally straightforward, but mobile application developers need to plan for less stable connectivity than one might expect in a home or office network setting—connectivity depends on the location of the users and their devices. developer must take extra care when designing network-enabled applications 3 4 Strict Mode with Networking Strict mode is a method that developers can use to detect operations performed on the main thread that should not be there. API Level 11 expanded upon strict mode in ways that impact networking code. By default, if you perform network operations on the main thread, your application

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.