{"id":900,"date":"2012-08-20T17:45:20","date_gmt":"2012-08-20T23:45:20","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=900"},"modified":"2012-08-20T17:45:20","modified_gmt":"2012-08-20T23:45:20","slug":"geolocation-and-the-android-2-3-3-emulator","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/900","title":{"rendered":"Geolocation and the Android 2.3.3 emulator"},"content":{"rendered":"<p>Just so someone else doesn&#8217;t waste an afternoon banging their head against a wall, here&#8217;s how to make the Android 2.3.3 emulator work if you want to access geolocation.\u00a0 This applies to the javascript apps I&#8217;m writing&#8211;I don&#8217;t know if a native app would have the same issue.<\/p>\n<ol>\n<li>Install an Android 2.2 AVD (<a href=\"http:\/\/code.google.com\/p\/android\/issues\/detail?id=13046\">2.3.3 doesn&#8217;t work with geolocation<\/a>).\u00a0 Make sure you enable the GPS in your hardware settings when setting up the AVD.\u00a0 That&#8217;s right, the first step to making the Android 2.3.3 emulator work is to downgrade to Android 2.2.\u00a0 Why <a href=\"http:\/\/developer.android.com\/about\/dashboards\/index.html\">would you want to target 2.3.3+<\/a>?<\/li>\n<li>Make sure you add &lt;uses-permission android:name=&#8221;android.permission.ACCESS_FINE_LOCATION&#8221; \/&gt; to your Android manifest.<\/li>\n<li>Add &lt;uses-feature android:name=&#8221;android.hardware.location.gps&#8221; android:required=&#8221;false&#8221; \/&gt; just to be sure.<\/li>\n<li>Start your emulator and install your software.<\/li>\n<li>telnet localhost 5554 (if you don&#8217;t have telnet installed on Windows 7, <a href=\"http:\/\/www.fettesps.com\/windows-7-enable-telnet\/\">here&#8217;s how to enable it<\/a>).<\/li>\n<li>In the telnet window, type in &#8220;fix geo -101 50&#8221;.\u00a0 Note that you can&#8217;t use the backspace, so cutting and pasting is your best option.\u00a0 Also note that longitude is before latitude.<\/li>\n<li>Execute the action that requires a geolocation.\u00a0 (If using phonegap, make sure to pass these options to the geolocation call: { enableHighAccuracy: true }.)<\/li>\n<\/ol>\n<p>You should see a GPS satellite in the notification bar of your emulator.<\/p>\n<p>Also, note that each time you execute the action that calls the geolocation service of your phone, you have to type the &#8216;fix geo&#8230;&#8217; line in the telnet session.<\/p>\n<p>I also found <a href=\"http:\/\/www.merkwelt.com\/people\/stan\/geo_js\/sample.html\">this page useful for testing<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just so someone else doesn&#8217;t waste an afternoon banging their head against a wall, here&#8217;s how to make the Android 2.3.3 emulator work if you want to access geolocation.\u00a0 This [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57,7],"tags":[],"class_list":["post-900","post","type-post","status-publish","format-standard","hentry","category-android","category-mobile-technology"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/900","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=900"}],"version-history":[{"count":1,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/900\/revisions"}],"predecessor-version":[{"id":901,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/900\/revisions\/901"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}