{"id":65,"date":"2012-03-15T15:18:08","date_gmt":"2012-03-15T15:18:08","guid":{"rendered":"http:\/\/tier7.net\/blog\/?p=65"},"modified":"2012-03-20T16:37:00","modified_gmt":"2012-03-20T16:37:00","slug":"android-droidgap-cordova-1-5-error-with-getting-started","status":"publish","type":"post","link":"https:\/\/tier7.net\/blog\/2012\/03\/android-droidgap-cordova-1-5-error-with-getting-started\/","title":{"rendered":"(Android) DroidGap Cordova 1.5 &#8211; Error with &#8220;Getting Started&#8221;"},"content":{"rendered":"<p>Here is a simple fix to get the new version of DroidGap (1.5) working on Android.<\/p>\n<p>The &#8220;<a href=\"http:\/\/phonegap.com\/start\">Getting Started<\/a>&#8221; section for android simply states an incorrect import. &#8220;<strong><em>import com.phonegap.*<\/em><\/strong>&#8221; If Ecplise is showing errors, change it to &#8220;<strong><em>import org.apache.cordova.*<\/em><\/strong>&#8221;<\/p>\n<p>If you&#8217;ve used &#8220;quick fix&#8221; in Eclipse, you&#8217;ve probably gotten &#8220;<em><strong>import org.apache.cordova.DroidGap;<\/strong><\/em>&#8221; , which is close, just replace .DroidGap with .* and you should be set.<\/p>\n<pre>package com.phonegap.myapp;\r\n\r\n\/\/import android.app.Activity; \/\/remove\r\nimport android.os.Bundle;\r\n\/\/import com.phonegap.*; \/\/this doesn't work\r\nimport org.apache.cordova.*; \/\/this replaces above line\r\n\r\npublic class MyActivity extends DroidGap {\r\n\u00a0\u00a0\u00a0 \/** Called when the activity is first created. *\/\r\n\u00a0\u00a0\u00a0 @Override\r\n\u00a0\u00a0\u00a0 public void onCreate(Bundle savedInstanceState) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 super.onCreate(savedInstanceState);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/setContentView(R.layout.main);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 super.loadUrl(\"file:\/\/\/android_asset\/www\/index.html\");\r\n\u00a0\u00a0\u00a0 }\r\n}<\/pre>\n<p>Don&#8217;t forget to add \/lib\/cordova-1.5.0.jar to the build path.<\/p>\n<p>Within your AndroidManifest.xml, do a quick find and replace for <em><strong>&#8220;com.phonegap&#8221;<\/strong><\/em> , changing it to <em><strong>&#8220;org.apache.cordova&#8221;<\/strong><\/em><\/p>\n<p>For me, this replaced two entries.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a simple fix to get the new version of DroidGap (1.5) working on Android. The &#8220;Getting Started&#8221; section for android simply states an incorrect import. &#8220;import com.phonegap.*&#8221; If Ecplise is showing errors, change it to &#8220;import org.apache.cordova.*&#8221; If &hellip; <a href=\"https:\/\/tier7.net\/blog\/2012\/03\/android-droidgap-cordova-1-5-error-with-getting-started\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[16,12,14,15,17,13],"class_list":["post-65","post","type-post","status-publish","format-standard","hentry","category-mobile-development","tag-android","tag-cordova","tag-import","tag-java","tag-mobile","tag-phonegap"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/tier7.net\/blog\/wp-json\/wp\/v2\/posts\/65","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tier7.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tier7.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tier7.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tier7.net\/blog\/wp-json\/wp\/v2\/comments?post=65"}],"version-history":[{"count":5,"href":"https:\/\/tier7.net\/blog\/wp-json\/wp\/v2\/posts\/65\/revisions"}],"predecessor-version":[{"id":67,"href":"https:\/\/tier7.net\/blog\/wp-json\/wp\/v2\/posts\/65\/revisions\/67"}],"wp:attachment":[{"href":"https:\/\/tier7.net\/blog\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tier7.net\/blog\/wp-json\/wp\/v2\/categories?post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tier7.net\/blog\/wp-json\/wp\/v2\/tags?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}