Telephony API
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Telephony API

on

  • 1,965 views

Telephony API

Telephony API
Ramin Orujov

Statistics

Views

Total Views
1,965
Views on SlideShare
1,845
Embed Views
120

Actions

Likes
2
Downloads
64
Comments
0

3 Embeds 120

http://android-az.com 59
http://www.hackathonazerbaijan.org 55
http://androidage2.hackathonazerbaijan.org 6

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Telephony API Presentation 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