2

I have made an app that works with an sqlite database, and I have done a tool in my menu to pass the database by sms, mail, whatsapp, etc... to other mobile. When I have the database in the other mobile when I do click appears a message saying: no application can perform this task. I'd like to know how I can open this database with my app, if I have to put something in manifest for recognize files or some idea to know where I find information about this.

tshepang
  • 12,111
  • 21
  • 91
  • 136
  • Use search, all you need is to associate your app with specific file extension: http://stackoverflow.com/questions/3760276/android-intent-filter-associate-app-with-file-extension – EvZ Jun 10 '13 at 21:35

1 Answers1

5

If you want want your app to recognize specific files, you need to use intent filter inside one of your activity tags in manifest. For example, to open pdf file with your app you need to use:

<activity android:name=".ActivityThatKnowsHowToHandlePDFFiles">

        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="file" />
        <data android:mimeType="*/*" />
        <data android:pathPattern=".*\\.pdf" />

</activity>

In your case with sqlite database file it can be .sqlite, .db - it depends on how did you name it.

More details on data intent filter: http://developer.android.com/guide/topics/manifest/data-element.html