Creating an application that opens a custom file extension

Want to create an Android app that will open a custom build extension (for example, I want to open .abcd files)

This is something like Adobe Reader that opens .pdf or Photo Viewer files that open .jpg files

Specific conditions:
1. The .abcd file must be external / external from the application itself. (like .pdf for Adobe Reader)
2. The .abcd file will be an encrypted file that contains several folders and .xml, .txt and .jpg files. I think I want to extract it - perhaps temporarily - somewhere in the repository (I definitely need the zipper / unzipper library), and then read the individual .xml, .txt and .jpg files.

Look for ideas and answers to this problem.

Additional Information:
I am relatively new to Android programming.

+9
source share
3 answers

I think you need to do this type of setup through intent-filter , something like:

 <intent-filter android:icon="your_drawable-resource" android:label="your_string_resource" android:priority="integer"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:scheme="file" /> <data android:host="*" /> <data android:pathPattern=".*\\.YOUR_CUSTOM_FILE_EXTENSION" /> </intent-filter> 

You should also see:

+7
source

One possible answer is shown here . Try some settings for intent filters.

 <intent-filter android:priority="999"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.OPENABLE" /> <data android:host="*" /> <data android:mimeType="application/octet-stream" /> <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.yourextension" /> <data android:pathPattern=".*\\..*\\..*\\..*\\.yourextension" /> <data android:pathPattern=".*\\..*\\..*\\.yourextension" /> <data android:pathPattern=".*\\..*\\.yourextension" /> <data android:pathPattern=".*\\.yourextension" /> <data android:scheme="content" /> </intent-filter> 
0
source

This was the key line of code for me:

 <action android:name="com.example.My Application.LAUNCH" /> 

Full description

-2
source

Source: https://habr.com/ru/post/952997/


All Articles