Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating app which opens a custom file extension

Tags:

file

android

Want to create an android application, which opens a custom-build file extension (for example, I want to open .abcd files)

It is something like Adobe Reader that opens .pdf files, or Photo Viewer that opens .jpg files

Specific conditions:
1. The .abcd file should be outside / external from the application itself. (as .pdf is to Adobe Reader)
2. The .abcd file would be a zipped file, which contains few folders and .xml, .txt, and .jpg files. I think I want to extract it - maybe temporarily - to somewhere in the storage (definitely need a zipper/unzipper library), then read the individual .xml, .txt, and .jpg files.

Looking for insights and answers for this problem.

Additional information:
I am relatively new to Android programming.

like image 450
topher Avatar asked Sep 02 '13 16:09

topher


People also ask

Which app can open any type of file?

File Viewer is a FREE Android app that allows you to open and view files on your Android device. It supports over 150 file types and can display the contents of any file. You can use File Viewer's information panel to view hidden file details and metadata. Get File Viewer FREE from the Google Play store!

What do you mean by custom files?

A Custom File is a simply blank page with the layout of the project (optional) for you to add your own content so it will have a consistent look and feel like other generated files.


1 Answers

I think you need to do that type of customization via 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>

Also you should look:

  • Custom Filetype in Android not working
  • Android intent filter for a particular file extension?
  • android intent filter for custom file extension
like image 188
ridoy Avatar answered Oct 21 '22 19:10

ridoy