Đ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 6 - ĐH Công nghê Đồng Nai

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Bài giảng Lập trình cho thiết bị di động: Chương 6 - Telephony APIs VÀ Location base services APIs có nội dung trình bày về Telephony APIs và LBS 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 Telephony APIs 2 LBS APIs 1 2 1. Telephony APIs 1.1 Working with Telephony Utilities 1.2 Using SMS 1.3 Making and Receiving Phone Calls 3 1.1 Working with Telephony Utilities If your application uses telephony features, make sure you set the tag with the android.hardware.telephony feature (or one of its sub-features) in your application’s manifest file to ensure your application is installed only on compatible devices. Read more Hardware Features: http://developer.android.com/guide/topics/manifest/uses-feature-element.html#hw-features 4 1.1 Working with Telephony Utilities Gaining Permission to Access Phone State Information You can use the TelephonyManager object to retrieve the state of the phone and some information about the phone service itself, such as the phone number of the handset. Read more details: http://developer.android.com/reference/android/telephony/TelephonyManager.html 5 1.1 Working with Telephony Utilities Cont 6 1.1 Working with Telephony Utilities Cont Listening for changes in the call state can enable an application to react appropriately to something the user might be doing. For instance, a game might automatically pause and save state information when the phone rings so that the user can safely answer the call. An application can register to listen for changes in the call state by making a call to the listen() method of TelephonyManager. 7 1.1 Working with Telephony Utilities Cont 8 1.1 Working with Telephony Utilities Cont 9 1.1 Working with Telephony Utilities Get telephony service Add the PhoneStateListener.LISTEN_SERVICE_STATE flag to the listener described earlier and implement the onServiceStateChanged method, which receives an instance of the ServiceState object. 10 1.1 Working with Telephony Utilities Cont 11 1.1 Working with Telephony Utilities Working with Phone Numbers The resulting output to the log would be the string . | 1 API 1 Telephony APIs 2 LBS APIs 1 2 1. Telephony APIs 1.1 Working with Telephony Utilities 1.2 Using SMS 1.3 Making and Receiving Phone Calls 3 1.1 Working with Telephony Utilities If your application uses telephony features, make sure you set the tag with the android.hardware.telephony feature (or one of its sub-features) in your application’s manifest file to ensure your application is installed only on compatible devices. Read more Hardware Features: http://developer.android.com/guide/topics/manifest/uses-feature-element.html#hw-features 4 1.1 Working with Telephony Utilities Gaining Permission to Access Phone State Information You can use the TelephonyManager object to retrieve the state of the phone and some information about the phone service itself, such as the phone number of the handset. Read more details: http://developer.android.com/reference/android/telephony/TelephonyManager.html 5 .