Note that there are some explanatory texts on larger screens.

plurals
  1. POdeclaring mime type for a "custom file" that is to be sent via bluetooth
    primarykey
    data
    text
    <p>I really need help in solving this issue:</p> <p>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:</p> <pre><code> intent.setType("image/*"); i.putExtra(i.EXTRA_STREAM, uri); //here uri has the URI of the image that I want to send. </code></pre> <p>And the android manifest File went as Follows:</p> <pre><code> &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;category android:name="android.intent.category.BROWSABLE" /&gt; &lt;data android:scheme="file" /&gt; &lt;data android:mimeType="image/*" /&gt; &lt;data android:host="*" /&gt; &lt;/intent-filter&gt; </code></pre> <p>And code worked fine. Now my question is : Similarly I want to send a file that is created by the following line:</p> <pre><code> f = File.createTempFile("card", ".XCard", getExternalCacheDir()); </code></pre> <p>The name of the file would be something like this:</p> <pre><code> card12434247.Xcard </code></pre> <p>Now what modifications are required in the code that I posted above? How should I write the mimeType in the intent-filter? </p> <p>what should be the line:</p> <pre><code> intent.setType(...)? </code></pre> <p>How should I modify it so that bluetooth will be able to handle this file </p> <pre><code> xyz.Xcard ?? </code></pre> <p>How should I declare the custom mime type that will be required to send my file to be sent via Blue-tooth? Is it required?? Please help!!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload