{"id":33,"date":"2010-12-20T12:38:44","date_gmt":"2010-12-20T16:38:44","guid":{"rendered":"http:\/\/46.19.32.152\/blog\/?p=33"},"modified":"2010-12-20T12:38:46","modified_gmt":"2010-12-20T16:38:46","slug":"android-development","status":"publish","type":"post","link":"https:\/\/www.fitzsim.org\/blog\/?p=33","title":{"rendered":"Android Development"},"content":{"rendered":"<p>A patch I wrote for mobileorg-android was <a href=\"https:\/\/github.com\/matburt\/mobileorg-android\/commit\/d8304484bc653817d1a16d4e6a3d8681f480137c\">accepted<\/a> and shipped to the Market in mobileorg-android 0.4.8.  It works around <a href=\"http:\/\/redmine.lighttpd.net\/issues\/1017\">lighttpd&#8217;s missing support for the Expect HTTP header<\/a>.  The <a href=\"https:\/\/github.com\/matburt\/mobileorg-android\/issues\/closed#issue\/34\">issue<\/a> was that pulling from lighttpd to the phone would work, but pushing from the phone to lighttpd wouldn&#8217;t.<\/p>\n<p>To debug the problem I set up an Android development environment.  In doing so I found <a href=\"https:\/\/github.com\/remvee\/android-mode\">android-mode.el<\/a> and android.el (shipped with the SDK in android-sdk-linux_86\/tools\/lib) very useful both during development and initially for learning the Android Emacs workflow.  For the most part, developing for my Nexus One was very straightforward.  The only issue I ran into was <a href=\"http:\/\/code.google.com\/p\/android\/issues\/detail?id=9437\">not being able to start \/sbin\/adbd on the phone<\/a>.<\/p>\n<p>Since none of the Android development tutorials I Googled mentioned this problem, I&#8217;ll outline the symptoms here.  If this issue affects you, the Settings -> Applications -> Development -> USB debugging check box on your phone will have no effect.  After you&#8217;ve checked &#8220;USB debugging&#8221;, when you plug your phone into your development machine via USB, the USB file storage dialog will come up.  &#8220;adb devices&#8221; on your development machine will not list the USB-connected phone.  If you open a terminal window on your phone,<\/p>\n<p>$ getprop persist.service.adb.enable<\/p>\n<p>will print 0, and<\/p>\n<p>$ ps<\/p>\n<p>will not list \/sbin\/adbd.<\/p>\n<p>When things are working correctly, checking USB debugging causes \/sbin\/adbd to be run on the phone.  \/sbin\/adbd exports different USB endpoints to &#8220;adb fork-server server&#8221; (started by adb on the development machine) so that the phone shows up as an Android development device, instead of a USB hard drive.<\/p>\n<p>In my case the workaround was to check &#8220;USB debugging&#8221; then reboot my phone.  After the reboot, persist.service.adb.enable was set to 1 and \/sbin\/adbd started when I checked USB debugging.<\/p>\n<p>Unfortunately I couldn&#8217;t find a way out of this scenario without rebooting my phone which I avoid doing if possible (my best uptime so far is 60 days ended by the 2.2.1 system update).  I haven&#8217;t rooted my Nexus One so \/sbin\/adbd caused &#8220;Permission denied&#8221;, and I couldn&#8217;t change persist.service.adb.enable to 1 with setprop; it would stay set to 0.  Without \/sbin\/adbd (and before I discovered the reboot workaround), I was left having to manually install a mobileorg-android .apk file via the SD card which was a pain.  I was disappointed that I didn&#8217;t have control over persist.service.adb.enable (which I assume I would if I had root).  The main reason I bought the Nexus One was for its unlocked hackability, so things like this leave a bad taste.  Hopefully the issue I linked to gets resolved.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A patch I wrote for mobileorg-android was accepted and shipped to the Market in mobileorg-android 0.4.8. It works around lighttpd&#8217;s missing support for the Expect HTTP header. The issue was that pulling from lighttpd to the phone would work, but pushing from the phone to lighttpd wouldn&#8217;t. To debug the problem I set up an &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.fitzsim.org\/blog\/?p=33\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Android Development&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-33","post","type-post","status-publish","format-standard","hentry","category-uncategorized","entry"],"_links":{"self":[{"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=33"}],"version-history":[{"count":0,"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fitzsim.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}