Associating a file with android application

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Associating a file with android application

Postby Beneesh » Mon Apr 12, 2010 8:26 am

Hi,
Can anybody tell how to associate a particular file with my application

Thanks in advance
Beneesh
Beneesh
Developer
Developer
 
Posts: 26
Joined: Tue Apr 06, 2010 8:18 am
Location: Kerala,India

Top

Postby Beneesh » Wed Apr 14, 2010 9:04 am

hi i got bit of an idea about this.........topic



we need to add intent filters for this purpose............



suppose we want to associate an application with .doc files then we can simply do that by adding this to Androidmanifest.xml file



<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="*" android:mimeType="mytype of file,will get it from file properties"
android:scheme="http"android:pathPattern=".*\.doc" />
</intent-filter>


if u have any doubts check manifest file of fbreader


[font=Arial Black] [/font] http://www.fbreader.org/FBReaderJ/
Beneesh
Developer
Developer
 
Posts: 26
Joined: Tue Apr 06, 2010 8:18 am
Location: Kerala,India

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests