Remote android

I’ve got an HTC Wildfire, but text input is pretty dire. Even with a swype-style keyboard, it’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, I tried out some apps (eg. Airdroid) which start a web server on your phone and let you control it via a browser. That’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’s not a stable network name for ‘my phone’.

So, I decided to fix the problem. If NAT means my phone can’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’s what I thought. So, I set up a private jabber server on t’internet and wrote a new android app for my phone. The app connects to the jabber server as “phone”. I connect to the jabber server like normal from my computer as “andy”. By striking up a conversation with my phone (!), I can instruct it to do a bunch of stuff. So far, it can send SMS’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’s connects automatically when I go to work or arrive home – 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).

I thought about adding the reverse direction – ie. if the phone receives an sms, it routes it to jabber – but I don’t have a pressing need for that yet so I’ve not added it.

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’d need to handcraft a “command sending” application and carry it around. I’d also need to make it robust – automatic reconnections etc. I also looked at using various “message queue” technologies as the hub instead of jabber. They’d all work, and I kinda like queues, but there’s no need for that rich a feature set. Jabber is fine.

5 replies on “Remote android”

Interesting. Hmmm, how do you handle actions that require exploring a parameter space? (e.g. choosing which contact to message.) You’re just relying your human memory of such spaces for now I guess?

Of course you could write an ad hoc message-based menu system for each useful interaction. But what I was wondering is: could you use the fine existing textual command abstraction of a shell? I.e. you Jabber shell commands, Android device runs them and Jabbers back the output?

It’s all adhoc and memory-reliant just now. I already have an ‘echo’ command which is good for testing, but I never thought of it as a shell until you mentioned it. Actually, I’ve tried to tab-complete once or twice .. that alone suggests something!!

The primary usecase was to make it easier to send sms. I had the idea of making the application connect to jabber as multiple users – each one being someone from my contacts. Then, to send an sms to Bob, I just send an jabber message to him and the android app forwards the message to the SMS world. Kinda like jabber avatars, I guess.

Back when I had a PPC 12-inch Mac with Tiger and a boring Sony T610 phone, I could send SMS from my laptop, and even receive them if the app was running. The Mac Contacts app had an SMS function that worked over Bluetooth, and the phone worked with it too. It wasn’t perfect, but I felt like all it needed was better reconnect/wake up/try to sync later logic.

Sadly, that was a high point of integration. Instead of polishing Bluetooth workflow to make it fully usable, both Apple and the phone manufacturers regressed on it and eventually abandoned it. It’s frustrating when manufacturers do this.

Comments are closed.