混合应用程序无法在Samsung Galaxy 5或6上运行

时间:2015-12-04 08:27:45

标签: javascript jquery-mobile samsung-mobile hybrid-mobile-app

我目前在Play商店有一个混合应用程序(The Stylista),可以在不同的平台上运行,直到它加载到三星Galaxy 5或6 ..

该应用程序打开一个白色的屏幕,我的加载GIF只是旋转而没有进一步 - 是否有我缺少的东西?应该添加代码吗?

我一直在做研究,发现这是一个许可问题。

White screen and loading gif

1 个答案:

答案 0 :(得分:0)

答案是将此代码段添加到配置文件中:

<gap:config-file platform="android" parent="/manifest">
  <application android:debuggable="true" />
</gap:config-file>

然后我能够在浏览器中进行调试 - 同时使用新的Android版本,在测试与Cordova的连接时,它没有返回Connection变量因此失败,因为它未定义。您可以将代码更改为:

function getData(tableName, data, onSuccess) {
if (navigator && navigator.connection && navigator.connection.type) {
    var networkState = navigator.connection.type;
    if (navigator.connection.type == 'none') {
        showMessage("You don't appear to be connected to the internet. Please check your connection.");

        return;
    }
}

而不是默认值:

function getData(tableName, data, onSuccess) {
if (navigator && navigator.connection && navigator.connection.type) {
    var networkState = navigator.connection.type;
    if (networkState == Connection.NONE) {
        showMessage("You don't appear to be connected to the internet. Please check your connection.");

        return;
    }
}

这将使您的混合应用程序再次运行:)

相关问题