android - register app to read e-mail attachments -


i want send file, created in app , send user. user should able open attachment app , use sent file work. mime-type : java-serialized-object : .ser

my manifest

<application            <intent-filter>             <data android:scheme="content" />             <action android:name="android.intent.action.view" />             <category android:name="android.intent.category.default" />             <data                 android:mimetype="application/*"                 android:host="*"                  android:pathpattern=".*\\.ser"             />          </intent-filter> 

my view, containing emailintent:

intent emailintent =  new intent(intent.action_send);  emailintent.setdata(uri.parse("mailto:"));  emailintent.settype("text/plain");  emailintent.putextra(intent.extra_email, to);  emailintent.putextra(intent.extra_cc, cc);  emailintent.putextra(intent.extra_subject, "pentacubes beta-test");  emailintent.putextra(intent.extra_text, report);   filename = "level_0_2_0.ser" ;  file myfile = new file("/sdcard/" + filename);   uri uri = uri.fromfile(myfile);  emailintent.putextra(intent.extra_stream, uri);  emailintent.settype("application/octet-stream"); emailintent.settype("application/java-serialized-object"); 

sending email o.k. if open email in email program, containing .ser in attachment, app not registered read attachment.

usage of android:pathpattern blocks receiving gmail intents since in intent's uri there can no extension, if displayed in gmail ui. in order check if can receive intents gmail, check out this

<intent-filter>     <action android:name="android.intent.action.view" />     <category android:name="android.intent.category.default" />     <data android:scheme="content" android:mimetype="*" android:host="*" /> </intent-filter> 

in way able debug application , find out mime type given desired attachments.

if want filter received intents extension, can still programmatically.


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -