Skip to main content
Participant
September 17, 2013
Question

AIR register custom URI and filetype problems on Android

  • September 17, 2013
  • 2 replies
  • 2799 views

Hi,

Im trying to register my app to open custom URI scheme and custom file type on Android 4.2

I tried all possible combinations, but I still cant get it to work.

When I selet the file on system or in web browser I dont get "Open with" dialog.

iOS part works without problems

using AIR 3.7 with ADT.

Here is my application.xml (I tried all intent filters I can google out)

Any suggestions?

<?xml version="1.0" encoding="utf-8"?>

<application xmlns="http://ns.adobe.com/air/application/3.7">

  <id>com.fileopen.ios</id>

  <versionNumber>2.1.0</versionNumber>

  <supportedProfiles>mobileDevice</supportedProfiles>

  <filename>myApp</filename>

  <name>test</name>

  <description>My desc</description>

    <copyright>Test 2013</copyright>

  <android>

        <manifestAdditions><![CDATA[

            <manifest android:installLocation="auto">

              <uses-sdk android:minSdkVersion="8"/>

                <uses-permission android:name="android.permission.INTERNET"/>

                <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

                <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

                <uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>

                <application android:hardwareAccelerated="true" />

                <application android:enabled="true">

                <activity android:excludeFromRecents="false">

                     <intent-filter>

                      <action android:name="android.intent.action.VIEW" />

                      <action android:name="android.intent.action.EDIT" />

                      <category android:name="android.intent.category.DEFAULT" />

                      <data

                        android:mimeType="application/octet-stream"

                        android:host="*"

                        android:pathPattern=".*\\.myfl"

                      />

                    </intent-filter>

                    <intent-filter>

                      <action android:name="android.intent.action.VIEW" />

                      <action android:name="android.intent.action.EDIT" />

                      <category android:name="android.intent.category.DEFAULT" />

                      <data

                        android:mimeType="*/*"

                        android:host="*"

                        android:pathPattern=".*\\.myfl"

                      />

                    </intent-filter>

                    <intent-filter>

                        <action android:name="android.intent.action.VIEW" />

                        <category android:name="android.intent.category.DEFAULT" />

                        <data

                            android:scheme="file"

                            android:host="*"

                            android:pathPattern=".*\\.myfl"

                            android:mimeType="*/*" />

                      </intent-filter>

                </activity>

                </application>

            </manifest>

        ]]></manifestAdditions>

    </android>

  <fileTypes>

    <fileType>

        <name>com.TestFile</name>

        <extension>myfl</extension>

        <description>My test extension</description>

        <contentType>application/octet-stream</contentType>

        <icon>

            <image48x48>icons/48.png</image48x48>

        </icon>

    </fileType>

</fileTypes>

.... rest is iOS stuff and extension

  <extensions>

    <extensionID>pl.mateuszmackowiak.nativeANE.NativeDialogs</extensionID>

  </extensions>

This topic has been closed for replies.

2 replies

Participating Frequently
July 4, 2014

Hi all, I have the same problem and I resolved like this.

This is my first intent-filter, the problem was that the Icon d

    <intent-filter>

   <action android:name="android.intent.action.VIEW" />
   <action android:name="android.intent.action.GET_CONTENT" />
   <action android:name="android.intent.action.SENDTO"/>
   <action android:name="android.intent.action.SEND" />

   <category android:name="android.intent.category.DEFAULT" />
   <category android:name="android.intent.category.BROWSABLE" />
   <category android:name="android.intent.category.OPENABLE"/>
   <category android:name="android.intent.category.LAUNCHER"/>

   <data android:mimeType="text/plain" />
   <data android:host="" android:scheme="file" />
   <data android:mimeType="application/epub+zip"/>
   </intent-filt

And I added this intent-filter. With this intent-filter the app icon appears.

    <intent-filter>
   <action android:name="android.intent.action.MAIN"/>
  
   <category android:name="android.intent.category.DEFAULT" />
   <category android:name="android.intent.category.BROWSABLE" />
   <category android:name="android.intent.category.OPENABLE"/>
   <category android:name="android.intent.category.LAUNCHER"/>
   </intent-filter>

See you,

goratz.

eazyigz
Participating Frequently
August 9, 2017

Does this work for opening any file extension in Gmail?

Participant
May 11, 2014

I need to understand why such an important question has not been answered till now?

Android file type associations is extremely important.


At least if this feature is not existing with the current Air capabilities, they should tell us.

Did you reach a solution to this by any chance?

Participant
May 13, 2014

I have exactly the same problem!

Thanks