Your SlideShare is downloading. ×
0
Telephony API
Telephony API
Telephony API
Telephony API
Telephony API
Telephony API
Telephony API
Telephony API
Telephony API
Telephony API
Telephony API
Telephony API
Telephony API
Telephony API
Telephony API
Telephony API
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Telephony API

2,005

Published on

Telephony API …

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,005
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
95
Comments
0
Likes
4
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Telephony API Ramin Orujov 22.04.2012
  • 2. Agenda• API overview• Working with SMS• Working with phone calls• Working with MMS
  • 3. API Overview• http://developer.android.com/reference/andr oid/telephony/package-summary.html
  • 4. SMSPermissions:• android.permission.SEND_SMS• android.permission.RECEIVE_SMSMain classes:• SmsManager• SmsMessage
  • 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. SMSHow to read incoming smsExtends BroadcastReceiver and listen for actionandroid.provider.Telephony.SMS_RECEIVEDHow to get sent and delivery reportPendingIntent for both actions
  • 7. SMS• API docshttp://developer.android.com/reference/androi d/telephony/SmsManager.html
  • 8. Phone call• Call number• Detect incoming and outgoing calls• Listen phone state changes
  • 9. Phone callHow to call numberIntent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:502310109")); startActivity(intent);Permission:• android.permission.CALL_PHONE
  • 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. 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. Phone call• API docshttp://developer.android.com/reference/androi d/telephony/TelephonyManager.html
  • 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. 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. Questions?
  • 16. Contact mehttp://raminorucov.wordpress.comhttp://www.facebook.com/ramin.orucovhttp://www.linkedin.com/in/raminorujovhttp://twitter.com/RaminOrujov

×