Some investigation about MIME type on Android(To be continued)

1. Gmail  (Platform: Nexus 7) When open an plain text document without any file extension, Gmail will send an intent as below:

ACTION: android.intent.action.VIEW DATA: content://gmail-ls/davidyoung8906@gmail.com/messages/2234/attachments/0.1/BEST/false TYPE: application/octet-stream

FLAGS: FLAG_GRANT_READ_URI_PERMISSION FLAG_ACTIVITY_FORWARD_RESULT FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET FLAG_ACTIVITY_PREVIOUS_IS_TOP

2 ACTIVITIES MATCH THIS INTENT: c:geo (cgeo.geocaching – cgeo.geocaching.cgeocaches) 快播 (com.qvod.player – com.qvod.player.activity.PlayerActivityNew)

Obviously, the

A good practice of retrieving attachment:

REGISTERING YOUR ANDROID APP FOR FILE TYPES AND EMAIL ATTACHMENTS

Android 常用 mimeType 表

Inter-App Communication – Document Support in iOS Application

As we can see from this post, IOs share a lot of similarity with Android apps in inter application communication. Such communication information resides in Info.plist of iOS application. As described in the post, the iOS inter app communication techniques falls into two categories:

  • Custom URL prefixes, e.g. someapp://something/somethingelse?somestuff=whatever
  • Custom file type handlers by file extension (e.g. *.txt) or by MIME type (e.g. text/plain).

Android combine both of the attribute in its <data> tag.

 

getMimeTypeFromExtension
getFileExtensionsFromUrl()
http://twigstechtips.blogspot.com/2011/09/android-get-file-mime-type-from.html

http://developer.android.com/reference/android/content/Intent.html#ACTION_SEND