簡體   English   中英

如何為Android配置Phonegap

[英]How to configure phonegap for android

我已經設置了桌面應用程序,並在手機上安裝了PhoneGap開發人員應用程序。 在我的手機上可以打開Hello World演示。 問題是,當我嘗試運行我構建的jquery移動網站時,目的是通過PhoneGap將其轉變為IOS和android的應用程序。 嘗試通過手機上的PhoneGap運行網站會導致以下錯誤:

凈:: ERR_FILE_NOT_FOUND(file:///data/user/0/com.adobe.phonegap.app/files/phonegapdevapp/www/login.html)

作為網站,如果您未登錄,則索引頁面會將用戶重定向到登錄頁面。

function ExistingUser(){
    //alert(localStorage.getItem("token"));
    var returnValue = 3;
    if (localStorage.getItem("token")){
        //code that calls a web service

    }else{
        window.location = "login.html";

    }
}

作為對這篇文章的回應,我已經將AndroidManifest.xml文件添加到platforms / android /文件夾中,盡管我對這些屬性是否合適並不十分自信。

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

<manifest>
    <uses-permission />
    <!-- Internet Permissions -->
    <uses-permission android:name="android.permission.INTERNET" />

    <!-- Network State Permissions -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <permission />
    <permission-tree />
    <permission-group />
    <instrumentation />
    <uses-sdk />
    <uses-configuration />  
    <uses-feature />  
    <supports-screens />  
    <compatible-screens />  
    <supports-gl-texture />  

    <application>

        <activity>
            <intent-filter>
                <action />
                <category />
                <data />
            </intent-filter>
            <meta-data />
        </activity>

        <activity-alias>
            <intent-filter> . . . </intent-filter>
            <meta-data />
        </activity-alias>

        <service>
            <intent-filter> . . . </intent-filter>
            <meta-data/>
        </service>

        <receiver>
            <intent-filter> . . . </intent-filter>
            <meta-data />
        </receiver>

        <provider>
            <grant-uri-permission />
            <meta-data />
            <path-permission />
        </provider>

        <uses-library />

    </application>


</manifest>

問題是PhoneGap將文件名視為區分大小寫。 在網絡瀏覽器中window.location = "login.html"; 加載Login.html頁面。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM