{"id":472,"date":"2012-04-08T10:38:00","date_gmt":"2012-04-08T09:38:00","guid":{"rendered":"http:\/\/www.nobugs.org\/blog\/?p=472"},"modified":"2012-04-08T10:59:23","modified_gmt":"2012-04-08T09:59:23","slug":"remote-android","status":"publish","type":"post","link":"https:\/\/www.nobugs.org\/blog\/archives\/2012\/04\/08\/remote-android\/","title":{"rendered":"Remote android"},"content":{"rendered":"<p>I&#8217;ve got an HTC Wildfire, but text input is pretty dire.  Even with a swype-style keyboard, it&#8217;s still too laggy to do things quickly.  I could send texts twice as fast on my old phone which had real keys.<\/p>\n<p>However, I do spend most of my life at a computer with a full keyboard.  Recently, I tried out some apps (eg. <a href=\"http:\/\/airdroid.com\/\">Airdroid<\/a>) which start a web server on your phone and let you control it via a browser.  That&#8217;s pretty cool, but often my phone is connected to a wifi behind NAT, and my computer is connected to a different part of the network.  NAT == no server.  Also, my phone gets a random IP address each time it joins wifi, so there&#8217;s not a stable network name for &#8216;my phone&#8217;.<\/p>\n<p>So, I decided to fix the problem.  If NAT means my phone can&#8217;t be a server, then my phone needs to dial out to the outside world.  It needs to meet up with my computer somewhere and exchange messages.  Sounds like a chat server?  That&#8217;s what I thought.  So, I set up a private jabber server on t&#8217;internet and wrote a new android app for my phone.  The app connects to the jabber server as &#8220;phone&#8221;.  I connect to the jabber server like normal from my computer as &#8220;andy&#8221;.  By striking up a conversation with my phone (!), I can instruct it to do a bunch of stuff.  So far, it can send SMS&#8217;s, start beeping, vibrate and report its location.  The app is smart enough to reconnect to the jabber server whenever wifi becomes available, which means it&#8217;s connects automatically when I go to work or arrive home &#8211; the main times at which this is useful.  It also means if I lose my phone (at home or work) I can cause it to beep (ala WheresMyDroid).<\/p>\n<p>I thought about adding the reverse direction &#8211; ie. if the phone receives an sms, it routes it to jabber &#8211; but I don&#8217;t have a pressing need for that yet so I&#8217;ve not added it.<\/p>\n<p>This was an interesting project.  Jabber\/XMPP was a pragmatic solution.  I originally planned on doing a custom socket protocol, using SSL\/SASL for encryption\/authentication.  But then I&#8217;d need to handcraft a &#8220;command sending&#8221; application and carry it around.  I&#8217;d also need to make it robust &#8211; automatic reconnections etc.    I also looked at using various &#8220;message queue&#8221; technologies as the hub instead of jabber.  They&#8217;d all work, and I kinda like queues, but there&#8217;s no need for that rich a feature set.  Jabber is fine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve got an HTC Wildfire, but text input is pretty dire. Even with a swype-style keyboard, it&#8217;s still too laggy to do things quickly. I could send texts twice as fast on my old phone which had real keys. However, I do spend most of my life at a computer with a full keyboard. Recently, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-472","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/posts\/472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/comments?post=472"}],"version-history":[{"count":3,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/posts\/472\/revisions"}],"predecessor-version":[{"id":475,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/posts\/472\/revisions\/475"}],"wp:attachment":[{"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/media?parent=472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/categories?post=472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nobugs.org\/blog\/wp-json\/wp\/v2\/tags?post=472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}