2016-05-18 89 views
0

我可以在我使用phonegap建立的瀏覽器中本地查看應用程序。我上傳到adobephonegapbuild中的相同應用程序的zip文件,一旦構建完成,我下載了apk文件以查看我的應用程序本地在我的手機中。但我無法執行操作,如登錄和註銷在我的應用程序。應該做些什麼來避免這種情況?有人可以儘快提供解決方案嗎?phonegap,cordova,adobephonegap build

這是我一直在使用這個應用程序的config.xml中我建立:

<?xml version='1.0' encoding='utf-8'?> 
<widget id="com.Netvarth.YNW1" version="1.0.0" versionCode="1" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://netvarth.com/ns/1.0"> 
    <name>ynw</name> 
    <description>Appointment managagement app</description> 
    <author email="[email protected]" href="http://netvarth.com">netvarth Team</author> 
    <content src="index.html" /> 
    <preference name="permissions" value="none" /> 
    <preference name="orientation" value="default" /> 
    <preference name="target-device" value="universal" /> 
    <preference name="fullscreen" value="true" /> 
    <preference name="webviewbounce" value="true" /> 
    <preference name="prerendered-icon" value="true" /> 
    <preference name="stay-in-webview" value="false" /> 
    <preference name="ios-statusbarstyle" value="black-opaque" /> 
    <preference name="detect-data-types" value="true" /> 
    <preference name="exit-on-suspend" value="false" /> 
    <preference name="show-splash-screen-spinner" value="true" /> 
    <preference name="auto-hide-splash-screen" value="true" /> 
    <preference name="disable-cursor" value="false" /> 
    <preference name="android-minSdkVersion" value="14" /> 
    <preference name="android-installLocation" value="auto" /> 
    <gap:plugin name="org.apache.cordova.battery-status" /> 
    <gap:plugin name="org.apache.cordova.camera" /> 
    <gap:plugin name="org.apache.cordova.media-capture" /> 
    <gap:plugin name="org.apache.cordova.console" /> 
    <gap:plugin name="org.apache.cordova.contacts" /> 
    <gap:plugin name="org.apache.cordova.device" /> 
    <gap:plugin name="org.apache.cordova.device-motion" /> 
    <gap:plugin name="org.apache.cordova.device-orientation" /> 
    <gap:plugin name="org.apache.cordova.dialogs" /> 
    <gap:plugin name="org.apache.cordova.file" /> 
    <gap:plugin name="org.apache.cordova.file-transfer" /> 
    <gap:plugin name="org.apache.cordova.geolocation" /> 
    <gap:plugin name="org.apache.cordova.globalization" /> 
    <gap:plugin name="org.apache.cordova.inappbrowser" /> 
    <gap:plugin name="org.apache.cordova.media" /> 
    <gap:plugin name="org.apache.cordova.network-information" /> 
    <gap:plugin name="org.apache.cordova.splashscreen" /> 
    <gap:plugin name="org.apache.cordova.vibration" /> 
    <icon src="icon.png" /> 
    <icon gap:platform="android" gap:qualifier="ldpi" src="www/res/icon/android/icon-36-ldpi.png" /> 
    <icon gap:platform="android" gap:qualifier="mdpi" src="www/res/icon/android/icon-48-mdpi.png" /> 
    <icon gap:platform="android" gap:qualifier="hdpi" src="www/res/icon/android/icon-72-hdpi.png" /> 
    <icon gap:platform="android" gap:qualifier="xhdpi" src="www/res/icon/android/icon-96-xhdpi.png" /> 
    <icon gap:platform="blackberry" src="www/res/icon/blackberry/icon-80.png" /> 
    <icon gap:platform="blackberry" gap:state="hover" src="www/res/icon/blackberry/icon-80.png" /> 
    <icon gap:platform="ios" height="57" src="www/res/icon/ios/icon-57.png" width="57" /> 
    <icon gap:platform="ios" height="72" src="www/res/icon/ios/icon-72.png" width="72" /> 
    <icon gap:platform="ios" height="114" src="www/res/icon/ios/icon-57-2x.png" width="114" /> 
    <icon gap:platform="ios" height="144" src="www/res/icon/ios/icon-72-2x.png" width="144" /> 
    <icon gap:platform="webos" src="www/res/icon/webos/icon-64.png" /> 
    <icon gap:platform="winphone" src="www/res/icon/windows-phone/icon-48.png" /> 
    <icon gap:platform="winphone" gap:role="background" src="www/res/icon/windows-phone/icon-173-tile.png" /> 
    <gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="www/res/screen/android/screen-ldpi-portrait.png" /> 
    <gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="www/res/screen/android/screen-mdpi-portrait.png" /> 
    <gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="www/res/screen/android/screen-hdpi-portrait.png" /> 
    <gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="www/res/screen/android/screen-xhdpi-portrait.png" /> 
    <gap:splash gap:platform="blackberry" src="www/res/screen/blackberry/screen-225.png" /> 
    <gap:splash gap:platform="ios" height="480" src="www/res/screen/ios/screen-iphone-portrait.png" width="320" /> 
    <gap:splash gap:platform="ios" height="960" src="www/res/screen/ios/screen-iphone-portrait-2x.png" width="640" /> 
    <gap:splash gap:platform="ios" height="1136" src="www/res/screen/ios/screen-iphone-portrait-568h-2x.png" width="640" /> 
    <gap:splash gap:platform="ios" height="1024" src="www/res/screen/ios/screen-ipad-portrait.png" width="768" /> 
    <gap:splash gap:platform="ios" height="768" src="www/res/screen/ios/screen-ipad-landscape.png" width="1024" /> 
    <gap:splash gap:platform="winphone" src="www/res/screen/windows-phone/screen-portrait.jpg" /> 
    <access origin="http://54.215.5.201/" /> 
    <plugin name="cordova-plugin-whitelist" version="1" /> 
    <allow-intent href="http://*/*" /> 
    <allow-intent href="https://*/*" /> 
    <allow-intent href="tel:*" /> 
    <allow-intent href="sms:*" /> 
    <allow-intent href="mailto:*" /> 
    <allow-intent href="geo:*" /> 
    <platform name="android"> 
     <allow-intent href="market:*" /> 
    </platform> 
    <engine name="android" spec="~5.1.1" /> 
</widget> 
+0

你可以提供你使用的代碼嗎? –

+0

代碼用於什麼?對不起沒有得到你Arpit – Sethu

+0

你的意思是你的應用程序無法對API進行網絡調用? –

回答

0

您困境的解決方案不在於在config.xml

在開發和測試相對因爲這些文件在物理上位於相同的位置,所以它確實可以工作,例如(./services/login.php)。但是,一旦你打包應用程序,這些相關鏈接被破壞,因爲php不能在手機上運行,​​mysql數據庫也不會與應用程序的HTML5和PHP文件一起導出。

讓您所調用的數據庫和文件駐留在Internet上很重要。然後編輯你要壓縮的文件並上傳到Phonegap Build,使API調用http://your-domain.tld/services/login.php