I really need help in solving this issue:
I am developing an application to transfer a file from my application to other phone using Blue-tooth. When I wanted to transfer an image file, the part of my code went as follows:
intent.setType("image/*");
i.putExtra(i.EXTRA_STREAM, uri);
//here uri has the URI of the image that I want to send.
And the android manifest File went as Follows:
<intent-filter>
<action android:name="android.intent.action.MAIN"
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="file" />
<data android:mimeType="image/*" />
<data android:host="*" />
</intent-filter>
And code worked fine. Now my question is :
Similarly I want to send a file that is created by the following line:
f = File.createTempFile("card", ".XCard", getExternalCacheDir());
The name of the file would be something like this:
card12434247.Xcard
Now what modifications are required in the code that I posted above?
How should I write the mimeType in the intent-filter?
what should be the line:
intent.setType(...)?
How should I modify it so that bluetooth will be able to handle this file
xyz.Xcard ??
How should I declare the custom mime type that will be required to send my file to be sent via Blue-tooth?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…