Telephony API   Ramin Orujov    22.04.2012
Agenda•   API overview•   Working with SMS•   Working with phone calls•   Working with MMS
API Overview• http://developer.android.com/reference/andr  oid/telephony/package-summary.html
SMSPermissions:• android.permission.SEND_SMS• android.permission.RECEIVE_SMSMain classes:• SmsManager• SmsMessage
SMSHow to send sms• Get SmsManager instanceSmsManager m = SmsManager.getDefault();• Send text smsvoid sendTextMessage (Str...
SMSHow to read incoming smsExtends BroadcastReceiver and listen for actionandroid.provider.Telephony.SMS_RECEIVEDHow to ge...
SMS• API docshttp://developer.android.com/reference/androi  d/telephony/SmsManager.html
Phone call• Call number• Detect incoming and outgoing calls• Listen phone state changes
Phone callHow to call numberIntent intent = new Intent(Intent.ACTION_CALL,  Uri.parse("tel:502310109"));  startActivity(in...
Phone callHow to detect incoming and outgoing calls• Extend BroadcastReceiver and listen for actionandroid.intent.action.P...
Phone call• How to get phone state change eventsPermissions• android.permission.READ_PHONE_STATE• android.permission.ACCES...
Phone call• API docshttp://developer.android.com/reference/androi  d/telephony/TelephonyManager.html
MMSUri mmsUri =   Uri.parse("content://media/external/images/media/1");  Intent intent = new Intent(Intent.ACTION_SEND);  ...
ReferencesPro Android 4 bookhttp://www.amazon.com/Pro-Android-4-Professional-Apress/dp/1430239301/http://mobiforge.com/dev...
Questions?
Contact mehttp://raminorucov.wordpress.comhttp://www.facebook.com/ramin.orucovhttp://www.linkedin.com/in/raminorujovhttp:/...
Upcoming SlideShare
Loading in...5
×

Telephony API

2,122

Published on

Telephony API
Ramin Orujov

Published in: Technology, Business
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,122
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
99
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Transcript of "Telephony API"

  1. 1. Telephony API Ramin Orujov 22.04.2012
  2. 2. Agenda• API overview• Working with SMS• Working with phone calls• Working with MMS
  3. 3. API Overview• http://developer.android.com/reference/andr oid/telephony/package-summary.html
  4. 4. SMSPermissions:• android.permission.SEND_SMS• android.permission.RECEIVE_SMSMain classes:• SmsManager• SmsMessage
  5. 5. SMSHow to send sms• Get SmsManager instanceSmsManager m = SmsManager.getDefault();• Send text smsvoid sendTextMessage (String destinationAddre ss, String scAddress, String text, PendingIntent sentIntent, PendingIntentdeliveryIntent)
  6. 6. SMSHow to read incoming smsExtends BroadcastReceiver and listen for actionandroid.provider.Telephony.SMS_RECEIVEDHow to get sent and delivery reportPendingIntent for both actions
  7. 7. SMS• API docshttp://developer.android.com/reference/androi d/telephony/SmsManager.html
  8. 8. Phone call• Call number• Detect incoming and outgoing calls• Listen phone state changes
  9. 9. Phone callHow to call numberIntent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:502310109")); startActivity(intent);Permission:• android.permission.CALL_PHONE
  10. 10. Phone callHow to detect incoming and outgoing calls• Extend BroadcastReceiver and listen for actionandroid.intent.action.PHONE_STATEandroid.intent.action.NEW_OUTGOING_CALL
  11. 11. Phone call• How to get phone state change eventsPermissions• android.permission.READ_PHONE_STATE• android.permission.ACCESS_COARSE_LOCATION• android.permission.ACCESS_NETWORK_STATE• android.permission.ACCESS_COARSE_UPDATES
  12. 12. Phone call• API docshttp://developer.android.com/reference/androi d/telephony/TelephonyManager.html
  13. 13. MMSUri mmsUri = Uri.parse("content://media/external/images/media/1"); Intent intent = new Intent(Intent.ACTION_SEND); intent.putExtra("sms_body", “This is a test mms  "); intent.putExtra(Intent.EXTRA_STREAM, mmsUri); intent.setType("image/png"); startActivity(intent);
  14. 14. ReferencesPro Android 4 bookhttp://www.amazon.com/Pro-Android-4-Professional-Apress/dp/1430239301/http://mobiforge.com/developing/story/sms-messaging-androidhttp://developer.android.com/reference/android/telephony/TelephonyManager.htmlhttp://www.tested.com/news/how-to/articles/557-how-to-measure-cell-signal-strength-on-android-phones/
  15. 15. Questions?
  16. 16. Contact mehttp://raminorucov.wordpress.comhttp://www.facebook.com/ramin.orucovhttp://www.linkedin.com/in/raminorujovhttp://twitter.com/RaminOrujov
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×