创建应用程序,它会打开一个自定义的文件扩展名 [英] Creating app which opens a custom file extension
问题描述
要创建一个Android应用程序,这将打开一个自定义生成的文件扩展名(例如,我想开.abcd文件)
Want to create an android application, which opens a custom-build file extension (for example, I want to open .abcd files)
这多少有点像ADOBE READER打开.pdf文件或照片查看器打开.jpg文件
It is something like Adobe Reader that opens .pdf files, or Photo Viewer that opens .jpg files
的具体条件:的结果
1. .abcd文件应是从应用程序本身以外/外部。 (如.PDF是到Adobe Reader)结果
2. .abcd文件将是一个压缩文件,其中包含几个文件夹和.xml,.txt和.jpg文件。我想我要提取它 - 也许暂时 - 某处在存储(肯定需要一个拉链/ unzipper库),然后读取个人的.xml,.txt和.jpg文件
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.
寻找见解和答案这个问题。
的附加信息:的结果
我是比较新到Android编程。
Additional information:
I am relatively new to Android programming.
推荐答案
我认为你需要通过意图过滤器做这种类型的定制
是这样的:
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
这篇关于创建应用程序,它会打开一个自定义的文件扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!