Re: [android-developers] Re: help to build an intent filter
2011/1/28 hansolo h4ns...@gmail.com: what's you mean using a standard MIME type ? I mean using a standard MIME type, where by standard I mean one that a random email client might actually use when constructing an email message with an attachment. You can invent your own MIME types, and that can work OK with Web servers, but email clients won't know to use them, generally. do you mean should I change my file extension to some well-known one (ex: txt, jpg..) ? Only if the file is of that format. I don't know how mail client decide mime type of attached file. Most map file extensions to MIME types, AFAIK. and I tried to change my extension to a some well-known one. (.pdf) but the situation is same as follow 01-28 22:50:28.518: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.VIEW dat=content:// com.android.email.attachmentprovider/1/9/RAW flg=0x80001 } so please tell me how can I use standard mime type. I would have expected that the Email app would use the MIME type embedded in the email information for the attachment, and that the MIME type would therefore have appeared in the Intent. Make sure the email you are looking at has the MIME types in it, by looking at the raw email message itself. my custom file is a base64-encoded text. and its content is some SEED- encrypted html file. so I use .smail extension on my file. I will be fairly stunned if you ever get that to work. I suggest that you reconsider the use of email as a means of distributing your files. For example, if your emails have links to files, and the files are served by Web servers, you have much greater control over how MIME types are handled. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training in London: http://bit.ly/smand1 and http://bit.ly/smand2 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: help to build an intent filter
hello Mark. thank you for your help. what's you mean using a standard MIME type ? do you mean should I change my file extension to some well-known one (ex: txt, jpg..) ? I don't know how mail client decide mime type of attached file. and I tried to change my extension to a some well-known one. (.pdf) but the situation is same as follow 01-28 22:50:28.518: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.VIEW dat=content:// com.android.email.attachmentprovider/1/9/RAW flg=0x80001 } so please tell me how can I use standard mime type. my custom file is a base64-encoded text. and its content is some SEED- encrypted html file. so I use .smail extension on my file. On 1월29일, 오전4시15분, Mark Murphy mmur...@commonsware.com wrote: On Fri, Jan 28, 2011 at 7:20 AM, hansolo h4ns...@gmail.com wrote: I'm trying to make an app which is automatically started when user try to open a some attached file (which has a custom extension) on mail client. You are much better served using a standard MIME type. my logcat show as follow when I try to preview an attached file on mail client. 01-28 11:55:37.078: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.VIEW dat=content:// com.android.email.attachmentprovider/1/3/RAW flg=0x80001 } And this is why you need a standard MIME type, as email attachments have no extension in their content Uri values. and I tried following intent filter -- intent-filter action android:name=android.intent.action.VIEW / category android:name=android.intent.category.DEFAULT / /intent-filter - but this filter failed to catch that intent. Of course. so, please help me. what filter should I build to catch this intent? Use a standard MIME type -- one the email client is likely to understand and use with the attachment. Then, add a data element to your filter with an android:mimeType attribute that is the MIME type you are using. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android Training in London:http://bit.ly/smand1andhttp://bit.ly/smand2 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en