brad's life - Fun with Android [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Fun with Android [Oct. 20th, 2008|10:31 am]
Previous Entry Add to Memories Share Next Entry
[Tags|, , ]

I've been having fun writing Android apps.

My main Android app I care about is my garage door opener. I have a webserver hooked up my garage door opener, so I can open my garage over the network. Combined with a background process doing wifi scanning, the idea's that when I'm on my way home, I pull up to my house on my motorcycle and the garage door magically opens and I back into my garage without taking off my helmet/gloves/etc.

Last night I wrote the background wifi scanning service part and walked around my house and neighborhood to get the signal strengths to the three different APs in my house (and the other ones of my neighbors). Looks like it'll work perfectly. Now I just need to wire up my wifi scanning service with my garage door opening code (simple http client that HMAC signs one-time timestamped URLs).

I just mentioned to evan that it looks like I have enough data to real-time triangulate within my house which room I'm in, since I have enough access points and their signal strengths vary enough. I was going to just make some stupid widget on http://bradfitz.com/ show where I'm at (which room at home, at work, in car via Bluetooth detection, on google shuttle via wifi detection, etc...) even without GPS (or with, if available).

But evan went one further:
make it turn on the lights for whatever room you're in.
that'd be cute.
you could call it "magic wand of light"
Hell yes.

Update: See the conclusion in Part 2.
LinkReply

Comments:
[User Picture]From: ariel72
2008-10-20 05:53 pm (UTC)

That's so...

(Link)

Lenny von Dohlen in Electric Dreams..
[User Picture]From: ydna
2008-10-20 06:38 pm (UTC)

(Link)

My car sorta does that. It slowly turns on the cabin lights when I approach and lets me open the door. It knows if I'm standing by the trunk and lets me open it. Now I insanely want everything to work that way.
[User Picture]From: brad
2008-10-20 06:55 pm (UTC)

(Link)

Likewise with my Audi. Just wish I didn't have to carry multiple fobs/keys/devices around. Why can't my Android be my car key?

[User Picture]From: mjg59
2008-10-20 07:01 pm (UTC)

(Link)

Mm. What's the battery life hit for doing wifi scanning frequently enough that you don't end up sitting outside (or in the dark) for ages?
[User Picture]From: brad
2008-10-20 07:27 pm (UTC)

(Link)

For now I manually activate the scanning service when I'm on my way home. Right before I get on my motorcycle I turn it on. Then in ~3-5 minutes I'm home and it opens.

In the future I'll make it automatically adapt its scanning rate based on circumstances. (e.g. if it's 4-7pm and it previously saw the google shuttle's wifi, then it lost it, it can assume I just got off the shuttle and am on my way home and start garage door scanning at a much faster rate.....)

From: (Anonymous)
2008-10-21 12:17 pm (UTC)

(Link)

Have you looked into using the Locale API for this?
[User Picture]From: brad
2008-10-21 03:10 pm (UTC)

(Link)

The location APIs? The GPS won't work in my pocket (it barely works ever anyway) and I don't think the wifi/celltower triangulation database has my home APs in it. More reliable to do it by hand.
From: (Anonymous)
2008-10-22 11:52 pm (UTC)

(Link)

Could you use the accelerometer to tell when you're on your motorcycle? Or does that eat up too much battery?
[User Picture]From: brad
2008-10-23 12:08 am (UTC)

(Link)

Yeah, but not exactly sure what I'd look for... lots of acceleration and braking?
[User Picture]From: jproulx
2008-10-27 09:40 pm (UTC)

(Link)

Do you keep the phone in your pocket during rides? I wonder if the accelerometer is sensitive enough to detect specific degrees of rotation...coupled with a little bit of jitter from the ride I think you could maybe pull it off.
[User Picture]From: interimlover
2008-10-20 07:24 pm (UTC)

(Link)

what do you use to actually activate the switch that opens the garage?
[User Picture]From: brad
2008-10-20 07:43 pm (UTC)

(Link)

X10 relay.
[User Picture]From: interimlover
2008-10-20 08:49 pm (UTC)

(Link)

rad. It's sad that iPhone doesn't support running background apps... I guess Android will have a leg up here for these kinds of applications for awhile...
[User Picture]From: webmaven
2008-10-20 07:34 pm (UTC)

(Link)

I think you should call it 'Magic Missile' and use it to attack the darkness.
[User Picture]From: dossy
2008-10-20 10:13 pm (UTC)

(Link)

+1. Definitely.
[User Picture]From: notlosers
2008-10-20 09:47 pm (UTC)

(Link)

Hmm. I've got a house to myself, with no-one to chastise me for messing with the wiring; this sounds like the kind of stupid trick I want to try. Any ideas what to use to control the lights?
[User Picture]From: hughe
2008-10-21 07:04 am (UTC)

(Link)

At the catflat I stuck all the sensor wires from an old alarm system into the parallel port pin holes on the fileserver. Never underestimate the power of the parallel port. Great for catching rouge lanlords.
[User Picture]From: dossy
2008-10-20 10:15 pm (UTC)

(Link)

Now, if you can X10 control each individual light fixture and use dimmer switches ... you could have lights brighten and dim as you get closer or further away from them ... all as you travel throughout the house.

It'd be creepy to watch from the curbside, of course.
[User Picture]From: dan_lane
2008-10-20 11:38 pm (UTC)

(Link)

It's the ability to hack together things like this that make me really excited to ditch my iPhone and get an Android device!
[User Picture]From: brad
2008-10-21 06:38 am (UTC)

(Link)

Yeah, it's wonderful not needing anybody's permission.

I can just put apps online and set my webserver's mimetype mappings appropriately and install applications directly from the phone's browser. No certifications or applications required.
[User Picture]From: brad
2008-10-21 06:40 am (UTC)

(Link)

And the SDK is lovely. Great command-line tools & great Eclipse tools. And near-perfect emulator. ("near" because I still need to use the real phone to test things like Wifi scanning, but installing to the app vs. the emulator is a trivial change, and they're both the same speed to deploy to.... couple seconds)

[User Picture]From: kfk2
2008-10-21 02:34 am (UTC)

(Link)

Are you using T-Mobile's phone for Android or are there other phones out there?
[User Picture]From: brad
2008-10-21 06:36 am (UTC)

(Link)

Yeah, using a production T-Mobile G1.
[User Picture]From: nyssabee
2008-10-21 02:52 am (UTC)

(Link)

That's one of the most awesome things I've ever heard of.
(Deleted comment)
[User Picture]From: brad
2008-10-21 03:10 pm (UTC)

(Link)

Yes.
[User Picture]From: robflynn
2008-10-21 05:20 pm (UTC)

(Link)

That sounds really fun :)
[User Picture]From: thefowle
2008-10-21 05:40 pm (UTC)

(Link)

are all your AP's on the same frequency?
[User Picture]From: lisa
2008-10-21 05:53 pm (UTC)

(Link)

1) Your garage door on the internet is pretty much the coolest thing about your house (until you manage to pull off the helicopter + hot tub thing)

2) I'm voting for more development of the sad trombone app, with the internal gyro mod for full hand motion effect
From: (Anonymous)
2008-10-31 04:10 am (UTC)

Idea

(Link)

This is very awesome, what you have done here. My idea would be to have speakers running through out my entire house and depending what rooms I am moving between the music/audio playing over the speakers follows me. It never plays in a room I am not and even fades from room to room so that I never hear any strange disturbances with speakers going on and off. Possibly than the phone can also be the volume control, or mute(fade to low lvl) the speakers when I receive a call or am in a specific room. That would be sweet!

-digitalmlewis
[User Picture]From: serg0007
2008-11-29 09:31 pm (UTC)

(Link)

it is cool, but ask your self, do i need it?
[User Picture]From: brad
2008-11-30 12:27 am (UTC)

(Link)

Of course not. It's fucking cool, though.