Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
Bài giảng Lập trình cho thiết bị di động: Chương 5 - ĐH Đồng Nai
Đang chuẩn bị liên kết để tải về tài liệu:
Bài giảng Lập trình cho thiết bị di động: Chương 5 - ĐH Đồng Nai
Bảo Thoa
131
61
pptx
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
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 1.1 Understanding Mobile Networking 1.2 Strict Mode with Networking 1.3 Accessing the Internet (HTTP) 2 3 1.1 Understanding Mobile Networking Networking on the Android platform is standardized, using a combination of powerful yet familiar technologies and libraries such as java.net. 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 1.2 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 android.os.NetworkOnMainThreadException. 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 1.2 Strict Mode with Networking If you want to use networking in Main Thread, the coding: if (android.os.Build.VERSION.SDK_INT > 10) { StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder() .permitAll().build(); StrictMode.setThreadPolicy(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: http://android-developers.blogspot.com/2009/05/painless-threading.html 5 6 1.2 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 1.1 Understanding Mobile Networking 1.2 Strict Mode with Networking 1.3 Accessing the Internet (HTTP) 2 3 1.1 Understanding Mobile Networking Networking on the Android platform is standardized, using a combination of powerful yet familiar technologies and libraries such as java.net. 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 1.2 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
TÀI LIỆU LIÊN QUAN
Bài giảng Phát triển ứng dụng cho các thiết bị di động: Phần 1
Bài giảng Lập trình cho thiết bị di động: Chương 0 - Trần Duy Thanh
Bài giảng Phát triển ứng dụng cho thiết bị di động - Hồ Thị Thảo Trang
Bài giảng Lập trình cho thiết bị di động: Chương 1 - Trần Duy Thanh
Bài giảng Lập trình cho thiết bị di động: Chương 2 - Trần Duy Thanh
Bài giảng Lập trình cho thiết bị di động: Chương 3 - Trần Duy Thanh
Bài giảng Lập trình cho thiết bị di động: Chương 4 - Trần Duy Thanh
Bài giảng Lập trình cho thiết bị di động: Chương 5 - Trần Duy Thanh
Bài giảng Lập trình cho thiết bị di động: Chương 6 - Trần Duy Thanh
Bài giảng Lập trình cho thiết bị di động: Chương 7 - Trần Duy Thanh
crossorigin="anonymous">
Đã 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.