Playing nice with other Android Apps

download Playing nice with other Android Apps

If you can't read please download the document

description

How to create Android applications that can create content providers for other applications to hook into and consume content from other apps.

Transcript of Playing nice with other Android Apps

  • 1. Playing nice with other Android Apps Roy van de Water

2. 3. Text 4. Link 5. Pictures 6. Videos 7. Contact 8. Location 9. Intent 10. 11. from: com.royvandewater.prankster.Prankster to:com.royvandewater.prankster.Sharer subject: Share this! body:, 12. Context context = (Context) this ; Intentintent=newIntent(context, Sharer .class ); intent . putExtra ( "key" ,"value" ); startActivity( intent ); 13. public voidonCreate(Bundle bundle){ Intentintent= this.getIntent(); String value =i ntent .getExtraString(key); } 14. from: com.royvandewater.prankster.Prankster to:Anyone that can handle 'text/plain' subject: Share this! body:, 15. Intentintent=newIntent(ACTION_SEND); intent . putExtra ( Intent.EXTRA_SUBJECT ,"subject" ); intent . putExtra ( Intent.EXTRA_TEXT ,"body" ); startActivity( intent ); 16. public voidonCreate(Bundle bundle){ Intentintent= this.getIntent(); String subject =i ntent .getExtraString( Intent.ACTION_SUBJECT); String body =i ntent .getExtraString( Intent.ACTION_TEXT); } 17. < activityandroid:name = ".Prankster" > < intent-filter > < actionandroid:name = "android.intent.action.SEND" /> < categoryandroid:name = "android.intent.category.DEFAULT" /> < dataandroid:mimeType = "text/plain" /> intent-filter > activity > 18. 19. 20. Source: http://bit.ly/prankster5000 21. Roy van de Water @royvandewater