{"id":6393,"date":"2013-12-15T05:15:06","date_gmt":"2013-12-14T21:15:06","guid":{"rendered":"http:\/\/mynotes.org\/tech\/?p=6393"},"modified":"2015-02-01T10:55:12","modified_gmt":"2015-02-01T02:55:12","slug":"%e7%94%a8phonegap%e6%8a%8a%e7%b6%b2%e9%a0%81%e5%81%9a%e6%88%90%e6%87%89%e7%94%a8%e7%a8%8b%e5%bc%8f-html-to-app","status":"publish","type":"post","link":"https:\/\/mynotes.org\/tech\/2013\/12\/15\/6393.htm","title":{"rendered":"\u7528PhoneGap\u628a\u7db2\u9801\u505a\u6210\u61c9\u7528\u7a0b\u5f0f HTML to APP"},"content":{"rendered":"<p>\u70ba\u4e86\u628a\u52a0\u83f2\u8c93\u6f2b\u756b\u7684\u7db2\u9801\u96e2\u7dda\u7248\u672c\u505a\u6210\u624b\u6a5f\u61c9\u7528\u7a0b\u5f0f\uff0c\u63a1\u7528PhoneGap\u7684\u5de5\u5177\u4f86\u5b8c\u6210\uff01<\/p>\n<p>\u6210\u679c\u4f5c\u54c1\uff1a<br \/>\n\u52a0\u83f2\u8c93\u6f2b\u756b\u5009\u5eabAPP\uff08\u6f2b\u756b\u96e2\u7dda\u95b1\u8b80\uff09\uff1a<a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.mygarfield.garfieldcomics\">\u8aaa\u660e\u53ca\u4e0b\u8f09\u9801\u9762<\/a>\u3001\u624b\u6a5f\u76f4\u63a5\u9023\u7d50\u5230<a href=\"market:\/\/details?id=com.mygarfield.garfieldcomics\">Google Play\u4e0b\u8f09\u9801\u9762<\/a>\u3002<\/p>\n<p>\u9019\u662f\u4e00\u500b\u771f\u6b63\u514d\u8cbb\uff0c\u800c\u4e14\u4e0d\u6703\u6709\u60f1\u4eba\u5ee3\u544a\u7684\u4f5c\u6cd5\u5594\uff01\uff01<br \/>\n<!--more--><\/p>\n<p>\u5982\u679c\u60f3\u505a\u96fb\u5b50\u66f8\u7684\u61c9\u7528\u7a0b\u5f0f\uff0c\u6700\u7c21\u55ae\u7684\u65b9\u6cd5\u61c9\u8a72\u5c31\u662f\u5beb\u6210\u7db2\u9801\uff08HTML\uff09\u683c\u5f0f\u3002\u5229\u7528PhoneGap\u9019\u500b\u5de5\u5177\uff0c\u4f60\u53ea\u8981\u6703\u5beb\u7db2\u9801\uff0c\u5c31\u53ef\u4ee5\u628a\u4ed6\u505a\u6210\u61c9\u7528\u7a0b\u5f0fAPP\u3002\u7c21\u55ae\u4e2d\u7684\u7c21\u55ae\u65b9\u5f0f\uff0c\u5c31\u662f\u5229\u7528PhoneGap Build\u7684\u7dda\u4e0a\u670d\u52d9\uff0c\u76f4\u63a5\u628a\u6240\u6709\u7684\u7db2\u9801\u8cc7\u6599\u6253\u5305\u4e0a\u50b3\uff0c\u61c9\u7528\u7a0b\u5f0f\u5c31\u505a\u597d\u4e86\uff0c\u7c21\u55ae\u5427\uff01\u786c\u8981\u628a\u6b65\u9a5f\u5beb\u5f97\u8907\u96dc\u4e00\u9ede\u7684\u8a71\u662f\u9019\u6a23\uff1a<\/p>\n<p>1.\u628a\u7db2\u9801\u6a94\u6848\u6e96\u5099\u597d\uff0c\u8981\u6709\u500bindex.html\u7576\u9996\u9801\uff1b<br \/>\n2.\u6e96\u5099\u4e00\u500b\u8a2d\u5b9a\u6a94config.xml\uff0c\u5728<a href=\"http:\/\/docs.build.phonegap.com\/en_US\/2.9.0\/configuring_basics.md.html#The%20Basics\">\u9019\u88e1<\/a>\u6709\u7bc4\u4f8b\u53ca\u8aaa\u660e\uff1b<br \/>\n3.\u628a\u524d\u9762\u5169\u500b\u6b65\u9a5f\u7684\u7db2\u9801\u6a94\u6848\u8ddf\u8a2d\u5b9a\u6a94\u58d3\u7e2e\u5230\u540c\u4e00\u500bzip\u58d3\u7e2e\u6a94\u88e1\u9762\uff0c\u8a18\u5f97\u4e0d\u8981\u628aindex.html\u548cconfig.xml\u653e\u5230\u5b50\u76ee\u9304\u88e1\u9762\u53bb\uff1b<br \/>\n4.\u5230<a href=\"https:\/\/build.phonegap.com\/\">PhoneGap Build<\/a>\u7684\u7db2\u7ad9\uff0c\u9700\u8981\u5148\u8a3b\u518a\u4e00\u500bAdobe\u7684\u5e33\u865f\uff1b<br \/>\n5.\u628a\u58d3\u7e2e\u6a94\u6848\u4e0a\u50b3\uff0c\u61c9\u7528\u7a0b\u5f0f\u5c31\u505a\u597d\u4e86\uff01\uff01<br \/>\n*\u5982\u679c\u6a94\u6848\u8981\u4e0a\u50b3\u5230google play\u4e0a\u982d\uff0c\u8a18\u5f97\u8981\u5148\u505a\u4e00\u500b\u7c3d\u540d\u8a8d\u8b49\u7684\u6a94\u6848\uff0c\u53c3\u95b1<a href=\"http:\/\/docs.build.phonegap.com\/en_US\/signing_signing-android.md.html#Android%20Signing\">\u76f8\u95dc\u8aaa\u660e<\/a>\u3002<\/p>\n<p>\u6ce8\u610f\u53ef\u80fd\u51fa\u932f\u4e8b\u9805\uff1a<br \/>\n1.\u5728config.xml\u4e2d\u7684id\u53ef\u4ee5\u7528\u82f1\u6587\u3001\u82f1\u6587\u6578\u5b57\u6df7\u5408\uff0c\u4f46\u662f\u7528\u7d14\u6578\u5b57\u597d\u50cf\u4e0d\u884c\uff1b<br \/>\n2.\u5982\u679c\u8981\u4e0a\u50b3google play\uff0c\u5728config.xml\u4e2d\u7684id\u4e0d\u53ef\u4ee5\u548c\u5225\u4eba\u91cd\u8907\uff1b<br \/>\n3.\u5982\u679c\u8981\u4e0a\u50b3google play\uff0c\u6bcf\u66f4\u65b0\u4e00\u6b21\u8981\u6539\u4e00\u6b21versionCode\u548cversion\uff1b<br \/>\n4.\u4e0a\u50b3\u6a94\u6848\u7684\u5927\u5c0f\u9650\u5236\u662f15mb\u3002<\/p>\n<p>\u4ee5\u4e0a\u7684\u6b65\u9a5f\u771f\u7684\u5f88\u7c21\u55ae\uff0c\u6210\u529f\u7387\u4e5f\u5f88\u9ad8\uff0c\u751a\u81f3\u4f60\u9084\u53ef\u4ee5\u540c\u6642\u958b\u767cWindows Phone\u3001iPhone\u7b49\u5176\u4ed6\u4e0d\u540c\u7248\u672c\u7684\u61c9\u7528\u7a0b\u5f0f\u3002\u4f46\u662f15mb\u7684\u9650\u5236\u5c0d\u6211\u4f86\u8aaa\u662f\u81f4\u547d\u7684\uff0c\u56e0\u70ba\u6211\u8981\u505a\u52a0\u83f2\u8c93\u6f2b\u756b\u7684\u96e2\u7dda\u7248\u672c\uff0c\u4e00\u5e74\u7684\u6a94\u6848\u91cf\u5c31\u898120mb\uff0c\u6240\u4ee5\u6211\u4e0d\u5f97\u4e0d\u9078\u64c7\u4e0b\u9762\u9019\u500b\u6bd4\u8f03\u9ebb\u7169\u7684\u65b9\u5f0f\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u5229\u7528\u6a19\u6e96\u7684Android\u61c9\u7528\u7a0b\u5f0f\u958b\u767c\u5de5\u5177\u52a0PhoneGap\u4f86\u5b8c\u6210\uff0c\u6b65\u9a5f\u5982\u4e0b\uff08\u8a73\u7d30\u6d41\u7a0b\u8207\u5716\u7247\u53ef\u53c3\u95b1\uff1a<a href=\"http:\/\/blog.chinatimes.com\/tomsun\/archive\/2011\/11\/08\/1029787.html\">Android 4.0 SDK \u4e0b\u8f09\u5b89\u88dd\u4e2d\u6587\u6559\u5b78\u8ab2\u7a0b\u8b1b\u7fa9<\/a>\uff09\uff1a<br \/>\n1.<a href=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/index.html\">\u4e0b\u8f09JAVA SDK<\/a>\uff0c\u76ee\u524d\u7248\u672c\u597d\u50cf\u662f8\uff0c\u5f88\u7c21\u55ae\uff0c\u4e00\u76f4\u6309\u4e0b\u4e00\u6b65\u5c31\u53ef\u4ee5\uff1b<br \/>\n2.<a href=\"http:\/\/www.eclipse.org\/downloads\/\">\u4e0b\u8f09Eclipse<\/a>\uff0c\u9019\u662fJAVA\u61c9\u7528\u7a0b\u5f0f\u7684\u958b\u767c\u74b0\u5883\uff08\u9078Eclipse IDE for Java Developers\u90a3\u500b\uff09\uff1b<br \/>\n3.\u89e3\u58d3\u7e2e\u4e0a\u500b\u6b65\u9a5f\u4e0b\u8f09\u7684\u6a94\u6848\uff0c\u4e0d\u7528\u5b89\u88dd\uff0c\u76f4\u63a5\u6253\u958b\u8cc7\u6599\u593e\u4e2d\u7684Eclipse\u57f7\u884c\u6a94\u5c31\u53ef\u4ee5\u57f7\u884c\uff1b<br \/>\n4.\u57f7\u884cEclipse\uff0c\u5728Help\u4e0b\u9762\u6709Install New Software\uff0c\u8f38\u5165\u300chttps:\/\/dl-ssl.google.com\/android\/eclipse\/\u300d\u5b89\u88ddADT Plugin for Eclipse\uff1b<br \/>\n<strong>*2015.02.01\u66f4\u65b0<\/strong><br \/>\n\u4eca\u5929\u91cd\u65b0\u5b89\u88dd\u4ee5\u4e0a\u6b65\u9a5f\uff0c\u91cd\u958bEclipse\u6642\u51fa\u73fe\u300clocation of the android sdk has not been setup in the preferences windows\u300d\u932f\u8aa4\u8a0a\u606f\uff0c\u4f9d\u7167\u7db2\u8def\u4e0a\u7684\u6240\u6709\u8aaa\u660e\u90fd\u6c92\u8fa6\u6cd5\u89e3\u6c7a\uff0c\u4e5f\u627e\u4e0d\u5230adt\u5b89\u88dd\u7684\u4f4d\u7f6e\uff0c\u6700\u5f8c\u5728<a href=\"http:\/\/stackoverflow.com\/questions\/16731126\/location-of-the-android-sdk-has-not-been-set-up-in-the-preferences-in-64-bit-win\">stackoverflow<\/a>\u627e\u5230\u4e00\u5247\u96f6\u5206\u7684\u89e3\u6c7a\u65b9\u6cd5\uff0c\u89e3\u6c7a\u4e86\u6211\u7684\u554f\u984c\u3002\u9019\u500b\u89e3\u6cd5\u662f\u53bbgoogle\u540c\u6642<a href=\"https:\/\/dl.google.com\/android\/adt\/adt-bundle-windows-x86_64-20140702.zip\">\u4e0b\u8f09Eclipse\u548cadt<\/a>\uff0c\u7136\u5f8c\u76f4\u63a5\u89e3\u58d3\u7e2e\u5c31\u53ef\u4ee5\u4f7f\u7528\uff0c\u6211\u61f7\u7591\u662f\u4e0d\u662f\u65b0\u7248Eclipse\u7684\u554f\u984c\uff0c\u7e3d\u4e4b\u66ab\u6642\u5148\u89e3\u6c7a\u4e86\u3002<\/p>\n<p>5.\u5b8c\u6210\u4e0a\u500b\u6b65\u9a5f\u5f8c\uff0c\u91cd\u65b0\u958b\u555fEclipse\u61c9\u8a72\u6703\u51fa\u73feInstall new SDK\u7684\u6b61\u8fce\u756b\u9762\uff0c\u8a18\u5f97\u8981\u5b89\u88dd\u6700\u65b0\u7684SDK\u548c2.1\u62162.2\u7248\u7684SDK\uff0c\u9019\u6a23\u7a0b\u5f0f\u53ef\u4ee5\u76f8\u5bb9\u65bc\u66f4\u591a\u6a5f\u5668\uff1b<br \/>\n6.\u5982\u679c\u4e0a\u500b\u6b65\u9a5f\u6c92\u6709\u81ea\u52d5\u8df3\u51fa\u6b61\u8fce\u756b\u9762\uff0c\u53ef\u4ee5\u5728Eclipse\u7684window\u7684android sdk manager\u8655\u9078\u64c7\u4e0b\u8f09\uff1b<br \/>\n7.\u5230Eclipse\u7684window\u7684android sdk manager\u8655\u6309\u4e00\u4e0binstall packages\uff0c\u4e3b\u8981\u662f\u8981\u5b89\u88ddbuild tools\uff0c\u5b89\u88dd\u5b8c\u91cd\u958bEclipse\uff1b<\/p>\n<p>\u63a5\u8457\u662f\u5b89\u88ddPhoneGap\u7684\u6b65\u9a5f\uff1a<br \/>\n1.<a href=\"http:\/\/phonegap.com\/install\/\">\u4e0b\u8f09PhoneGap<\/a>\uff0c\u5efa\u8b70\u4e0b\u8f092.2.0\u7248\uff0c\u4e0b\u8f09\u5f8c\u89e3\u58d3\u7e2e\uff1b<br \/>\n2.\u63a5\u4e0b\u4f86\u7684\u6d41\u7a0b\u53ef\u4ee5\u53c3\u95b1<a href=\"http:\/\/docs.phonegap.com\/en\/2.1.0\/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android\">\u5b98\u65b9\u8aaa\u660e\u6587\u4ef6<\/a>\uff1b<br \/>\n3.\u5728\u4e0a\u8ff0\u6b65\u9a5f\u4e2d\uff0c\u6709\u500b\u628aActivity\u6539\u6210DroidGap\u7684\u5730\u65b9\uff0c\u9019\u4e00\u884c\u7a0b\u5f0f\u7684\u958b\u982d\u539f\u672c\u662fprotected\uff0c\u8acb\u6539\u6210public\uff1b<br \/>\n4.\u4f9d\u7167\u5b98\u65b9\u6587\u4ef6\u7684\u8aaa\u660e\uff0c\u628a\u4f60\u7684\u7db2\u9801\u6a94\u6848\u90fd\u4e1f\u9032asset\/www\u7684\u88e1\u9762\u4e4b\u5f8c\uff0c\u5c31\u53ef\u4ee5\u628a\u5c08\u6848\u7de8\u8b6f\u6210APK\u6a94\u7d66\u5e73\u677f\u5b89\u88dd\u4f7f\u7528\u4e86\u3002<\/p>\n<p>\u8981\u5e6b\u7a0b\u5f0f\u52a0\u5165\u6b61\u8fce\u756b\u9762\uff1a<br \/>\n1.\u53c3\u8003<a href=\"http:\/\/docs.phonegap.com\/en\/2.2.0\/cordova_splashscreen_splashscreen.md.html#Splashscreen\">\u5b98\u65b9\u8aaa\u660e\u6587\u4ef6<\/a>\u3002<\/p>\n<p>\u8981\u8b93\u7a0b\u5f0f\u9810\u8a2d\u5b89\u88dd\u5728SD\u5361\uff1a<br \/>\n1.\u4fee\u6539AndroidManifest.xml\u6a94\uff0c\u5728 manifest \u6a19\u7c64\u4e2d\u52a0\u5165\u4e00\u500b\u300candroid:installLocation\u300d\u5c6c\u6027\uff08<a href=\"http:\/\/blog.gasolin.idv.tw\/2010\/05\/sd22.html\">\u53c3\u8003\u8cc7\u6599\u4f86\u6e90<\/a>\uff09\u3002<\/p>\n<p>\u4fee\u6539\u61c9\u7528\u7a0b\u5f0f\u7684\u540d\u5b57\uff1a<br \/>\n1.\u4fee\u6539\u5728res\/value\/string.xml\u4e2d\u7684app_name\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u70ba\u4e86\u628a\u52a0\u83f2\u8c93\u6f2b\u756b\u7684\u7db2\u9801\u96e2\u7dda\u7248\u672c\u505a\u6210\u624b\u6a5f\u61c9\u7528\u7a0b\u5f0f\uff0c\u63a1\u7528PhoneGap\u7684\u5de5\u5177\u4f86\u5b8c\u6210\uff01 \u6210\u679c\u4f5c\u54c1\uff1a \u52a0\u83f2\u8c93\u6f2b\u756b\u5009\u5eab [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[126,131],"tags":[88,102,36,100,101,89,33],"class_list":["post-6393","post","type-post","status-publish","format-standard","hentry","category-android","category-app-android","tag-app","tag-eclipse","tag-java","tag-phonegap","tag-phonegap-build","tag-89","tag-33"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/posts\/6393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/comments?post=6393"}],"version-history":[{"count":5,"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/posts\/6393\/revisions"}],"predecessor-version":[{"id":6574,"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/posts\/6393\/revisions\/6574"}],"wp:attachment":[{"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/media?parent=6393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/categories?post=6393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mynotes.org\/tech\/wp-json\/wp\/v2\/tags?post=6393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}