Register new file type in Android -


i want write simple stl (geometrical data file) viewer application on android, i'm not able make recognize format system. wrote in app manifest file is:

 <intent-filter>   <action android:name="android.intent.action.view" />   <action android:name="android.intent.action.edit" />    <action android:name="android.intent.action.pick" />   <category android:name="android.intent.category.default" />    <data android:scheme="http" />      <data android:pathpattern=".*\\.stl" />     <data android:mimetype="application/sla" />   <data android:host="*" />   </intent-filter> 

but @ moment launch browser , go download sample stl file, download interrupted , i'm reported data file type unknown system. have no real android device, use emulator, , development use c# on monodroid (but don't think problem honestly)

any ideas on subject?

thank in advance.

i'm using manifest register (for example) .stl file type application:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="org.test.core" android:versioncode="1" android:versionname="1.0">     <application android:icon="@drawable/icon" android:label="@string/app_name">         <activity android:name=".testy" android:label="@string/app_name">             <intent-filter>                 <action android:name="android.intent.action.main" />                 <category android:name="android.intent.category.launcher" />             </intent-filter>         </activity>          <activity android:name="thoractivity" android:label="@string/app_name">         </activity>          <activity android:name="lokiactivity" android:label="@string/app_name">         </activity>          <activity android:name="odinactivity" android:label="@string/app_name">             <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:scheme="http" android:host="*"                     android:pathpattern=".*\\.stl" />                 <data android:scheme="https" android:host="*"                     android:pathpattern=".*\\.stl" />                 <data android:scheme="content" android:host="*"                     android:pathpattern=".*\\.stl" />                 <data android:scheme="file" android:host="*"                     android:pathpattern=".*\\.stl" />             </intent-filter>         </activity>     </application>      <uses-permission android:name="android.permission.internet" />     <uses-permission android:name="android.permission.bluetooth" />     <uses-permission android:name="android.permission.bluetooth_admin" />     <uses-permission android:name="android.permission.read_phone_state" />     <uses-permission android:name="android.permission.access_network_state" />     <uses-permission android:name="android.permission.write_external_storage" />  </manifest>  

as can see, i'm linking .stl file extension activity odinactivity. inside odinactivity, use following line file path can open it:

filepath = getintent().getdata().getencodedpath(); 

then open read it:

fileoutputstream out = new fileoutputstream(new file(filepath)); 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -