2012-04-18 72 views
3

我正在嘗試使用Phonegap for Android平臺學習移動應用程序開發。所以,我下載了最新的PhoneGap 1.6版。我在http://wiki.phonegap.com/w/page/30862722/phonegap-android-eclipse-quickstart發現了一篇不錯的文章,它展示瞭如何設置PhoneGap for Eclipse。在Eclipse中添加示例應用程序後,我現在可以運行該應用程序,但是,沒有一個列表項似乎不適用於我的模擬器和我的手機。示例應用程序包含一個列表(如鏈接示例中所示),即獲取位置,蜂鳴聲,振動,呼叫411,拍照等。只有呼叫411正在工作代碼或手機有什麼問題?Android的PhoneGap示例應用程序不起作用

logcat的

04-19 05:45:01.538: I/CordovaLog(325): Changing log level to DEBUG(3) 
04-19 05:45:01.538: D/DroidGap(325): DroidGap.onCreate() 
04-19 05:45:01.559: D/DroidGap(325): DroidGap.loadUrl(file:///android_asset/www/index.html) 
04-19 05:45:01.559: D/DroidGap(325): DroidGap: url=file:///android_asset/www/index.html baseUrl=file:///android_asset/www/ 
04-19 05:45:01.958: D/DroidGap(325): DroidGap.init() 
04-19 05:45:02.078: D/PluginManager(325): init() 
04-19 05:45:02.178: D/SoftKeyboardDetect(325): Ignore this event 
04-19 05:45:02.358: D/SoftKeyboardDetect(325): Ignore this event 
04-19 05:45:10.470: D/CordovaLog(325): TypeError: Result of expression 'navigator.notification' [undefined] is not an object. 
04-19 05:45:10.470: D/CordovaLog(325): file:///android_asset/www/main.js: Line 21 : TypeError: Result of expression 'navigator.notification' [undefined] is not an object. 
04-19 05:45:10.499: E/Web Console(325): TypeError: Result of expression 'navigator.notification' [undefined] is not an object. at file:///android_asset/www/main.js:21 
04-19 05:45:15.108: I/Database(325): sqlite returned: error code = 14, msg = cannot open file at source line 25467 
04-19 05:45:21.128: D/CordovaLog(325): TypeError: Result of expression 'navigator.notification' [undefined] is not an object. 
04-19 05:45:21.128: D/CordovaLog(325): file:///android_asset/www/main.js: Line 25 : TypeError: Result of expression 'navigator.notification' [undefined] is not an object. 
04-19 05:45:21.128: E/Web Console(325): TypeError: Result of expression 'navigator.notification' [undefined] is not an object. at file:///android_asset/www/main.js:25 
04-19 05:45:22.908: W/KeyCharacterMap(325): No keyboard for id 0 
04-19 05:45:22.908: W/KeyCharacterMap(325): Using default keymap: /system/usr/keychars/qwerty.kcm.bin 
04-19 05:45:26.228: D/CordovaLog(325): TypeError: Result of expression 'navigator.network' [undefined] is not an object. 
04-19 05:45:26.228: D/CordovaLog(325): file:///android_asset/www/main.js: Line 108 : TypeError: Result of expression 'navigator.network' [undefined] is not an object. 
04-19 05:45:26.249: E/Web Console(325): TypeError: Result of expression 'navigator.network' [undefined] is not an object. at file:///android_asset/www/main.js:108 
+1

如果沒有logcat或關於您遇到的錯誤的具體信息,則不容易回答您的問題。你能提供屏幕截圖或日誌顯示問題? – 2012-04-18 17:06:44

+0

添加logcat顯示'navigator.notification'錯誤 – Tuscan 2012-04-18 17:31:17

回答

1

我覺得你有拼寫錯誤在你的代碼,否則錯過了一些屬性,如字符集=「utf-8」

<script type="text/javascript" src="cordova-1.7.0.js" charset="utf-8"></script> 

<script type="text/javascript" charset="utf-8"> 
0

它爲我工作,但要確保在你的indext僅添加第一線.html文件不是第二行。對於我刪除第二行後只有它工作。只添加

添加確保cordova-1.7.0.js存在於www文件夾中。

相關問題