question

APG Solutions LLC avatar image
APG Solutions LLC asked

This file type cannot be opened on your device message in mail app

So my app has a custom file extension setup in the Manifest File


<activity
    android:name=".MainMenuActivityModern"
    android:label="@string/app_name_short"
    android:theme="@style/AppTheme"
    android:configChanges="keyboardHidden|orientation"
    android:exported="true">


<intent-filter>
    <data
        android:scheme="content"
        android:mimeType="application/vnd.tmmapp"
        android:pathPattern=".*\\.tm2" />
    <data
        android:scheme="content"
        android:mimeType="application/tmmapp"
        android:pathPattern=".*\\.tm2" />
    <data
        android:scheme="content"
        android:mimeType="application/octet-stream"
        android:pathPattern=".*\\.tm2" />
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
</intent-filter>


<intent-filter>
    <data android:scheme="file"
        android:mimeType="*/*"
        android:pathPattern=".*\\.tm2"
        android:host="*"/>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
</intent-filter>

</activity>


But when I send the file to my kindle by email and try do download/open the attachment I get the "This file type cannot be opened on your device" message.

But when I used adb to push the file to the kindle, I can open open the file with the app directly.

So has anyone come across a similar issue with custom file extensions in the mail app on the kindle?

I hope the resolution is I need something kindle specific in the intent filters show above but I cannot find any similar posts.

Any thoughts or suggestions would be helpful, thanks.

fire tabletintentsdevices
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Levon@Amazon avatar image
Levon@Amazon answered

Hi there,

Thanks for posting! Does your file name contain dots other than before the extension? As there might be various reasons for this, I would suggest going through this discussion on Stack Overflow:
https://stackoverflow.com/questions/3760276/android-intent-filter-associate-app-with-file-extension

Otherwise, does your app work on other Android devices, but not Fire tablets? In that case, please provide the logs, device model, OS version, a sample of your code, and any other relevant information, and we will investigate. Thanks!

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.