Skip to content
This repository has been archived by the owner on Dec 27, 2019. It is now read-only.

Packaged app won't close on FireTV #39

Open
sgloutnikov opened this issue Jun 25, 2017 · 0 comments
Open

Packaged app won't close on FireTV #39

sgloutnikov opened this issue Jun 25, 2017 · 0 comments

Comments

@sgloutnikov
Copy link

My app is based on the simple-live template, and I have been testing it in hosted mode through the Web App Tester on the FIre TV and on Safari in MacOS. When I press back from the main menu I get a confirmation dialog about closing. If I click OK in both cases, the app closes fine and everything works as intended. The problem comes when I install the packaged apk. I am unable to close the app after choosing OK on the exit dialog. After selecting OK in the close dialog, the app remains open, and the remote becomes unresponsive to any buttons, except for the back button.

The original close function in app.js remains the same:

        this.exitApp = function () {
            if (confirm("Are you sure you want to exit?")) {
                window.open('', '_self').close();
            }
            buttons.resync();
        };

The cordova documentation regarding packaging an apk is outdated by a few years, so I've used older versions that are able to produce the apk:

  • Cordova 3.6.0-0.2.8
  • Android SDK 19
  • Latest Amazon WebView API SDK

Cordova config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.bulsat.firetv" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Bulsatcom</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="[email protected]" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <access origin="*" />
    <platform name="amazon-fireos">
        <icon src="www/assets/icon/icon.png" />
        <preference name="android-targetSdkVersion" value="19" />
    </platform>
</widget>

platforms/amazon-fireos/AndroidManifest.xml:

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="com.bulsat.firetv" xmlns:amazon="http://schemas.amazon.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="Bulsatcom" android:theme="@android:style/Theme.Black.NoTitleBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <uses-library android:name="com.amazon.webview" android:required="false" />
        <service android:exported="false" android:name="org.chromium.content.app.SandboxedProcessService0" android:permission="org.chromium.content_shell.permission.SANDBOX" android:process=":sandboxed_process0" />
        <service android:exported="false" android:name="org.chromium.content.app.SandboxedProcessService1" android:permission="org.chromium.content_shell.permission.SANDBOX" android:process=":sandboxed_process1" />
        <service android:exported="false" android:name="org.chromium.content.app.SandboxedProcessService2" android:permission="org.chromium.content_shell.permission.SANDBOX" android:process=":sandboxed_process2" />
        <service android:exported="false" android:name="org.chromium.content.app.SandboxedProcessService3" android:permission="org.chromium.content_shell.permission.SANDBOX" android:process=":sandboxed_process3" />
        <service android:exported="false" android:name="org.chromium.content.app.SandboxedProcessService4" android:permission="org.chromium.content_shell.permission.SANDBOX" android:process=":sandboxed_process4" />
        <service android:exported="false" android:name="org.chromium.content.app.SandboxedProcessService5" android:permission="org.chromium.content_shell.permission.SANDBOX" android:process=":sandboxed_process5" />
    </application>
    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
</manifest>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant