Showing posts with label protips. Show all posts
Showing posts with label protips. Show all posts

Thursday, June 23, 2011

How to Build Location-Based Apps That Don't Suck

If I were forced to choose between a smartphone that could make / receive voice calls, and one with Google Maps - I would choose Maps without blinking.

Here Back in London, getting a reliable 3G connection is a challenge at the best of times - getting one while sat in most venues is about as likely as a South West Trains running a good service. So it doesn't help when I go to view details for, checkin, or review a location and a lack of 3G signal thwarts my efforts.

Whether it's opening a FourSquare app to checkin, or Qype / Zagat / Where to choose where to eat, or the London Cycle Hire Widget to find a Boris Bike - I always feel like a douche standing around with my phone in my hand for half a minute while my phone gets a GPS fix and downloads the nearest locations.

High latency and a lack of offline support in location-based mobile apps is a blight that must be cleansed

Rather than (or indeed: after) shaking my fist at the sky in impudent rage, I wrote an open-source reference app that incorporates all of the tips, tricks, and cheats I know to reduce the time between opening an app and seeing an up-to-date list of nearby venues - as well as providing a reasonable level of offline support.

You can find out more in the associated deep-dive into location on the Android Developer Blog.

Android Protips: Location Best Pratices

It should came as no surprise to learn that I've borrowed heavily from my Android Protips presentation from Google I/O. Including (but not limited to) using Intents to receive location updates, using the Passive Location Provider, using Intents to passively receive location updates when your app isn't active, monitoring device state to vary refresh rate, toggling your manifest Receivers at runtime, and using the CursorLoader.

But Wait There's More!

The post on the Android Developer Blog focusses on freshness - I'll be posting another deep-dive into the code that examines how I've made the app psychic and smooth on this blog early next week. Stay tuned.

Monday, May 16, 2011

Android Protips: Where to Download the Slides and Code Snippets

For those of you who want to take a closer look at my Android Protips session for Google I/O, you can now enjoy the video, slides, and code snippets in whichever format you prefer:
One of the nice things about SlideShare is that it lets you embed slideshows into your blog post:


I plan to do a series of more blog posts that dig into some of the topics I cover in the presentation in more detail. Where do you guys think I should start?

Android Protips at I/O: The Session Video (and How I Presented It)

[Update 16/May: Reposted after Blogger outage]
[Update 2: Working links to the sessions slides are available from here]

Another Google I/O, another jam-packed Android session room. This year they nearly doubled the room capacity for the main Android track making space for 1,000 seats. That still wasn't enough though - once again people were sitting on the floor and lining up to get in.

Android Protips: Advanced Topics for Expert Android Developers

After delivering my Android Best Practices for Beginners for the better part of last year, I was really excited to take things up a notch and deliver some real advanced content. To push things one step further, I presented my session using a pair of Xoom tablets. More on that after the video.



The awesome video content was created for me by an old friend of mine (he's still young, but we've been friends since high school) pandamusk - thanks panda!

How did you do that?

There were a lot of questions on Twitter asking:
  1. What app did I use to do the presentation using an Android tablet
  2. How did I live tweet my own presentation in real time?
  3. How did I not re-tweet everything when the tablet rebooted?
I'm an engineer so (of course) I took this as an excuse opportunity to write an app that does the former and built in functionality to do the latter (and come on — you think I didn't consider the case of having to restart? Please.)

How does it work?

One app, running on two tablets, both running Android 3.1 (with USB hostmode support) connected via Bluetooth.

Tablet one was wired up with HDMI out and a USB-connected clicker let me transition between slides. I added a "finger paint" View with a transparent background on top of the ImageView that displayed each slide which let me do the real-time annotations.


A second device (out of sight on the lectern) showed me my "Speaker View": My speaker notes, the current / next slide preview, my pre-written live tweets, and a countdown timer.


The two devices were paired and connected over Bluetooth, with the speaker view tablet set up as a slave to the presentation device. Whenever the display tablet transitioned slides, it transmitted the current slide to the speaker view tablet. It works the other way around too, so I can transition slides on the speaker view and have the live view update accordingly.

The tweeting happened on the speaker view tablet based on slide transitions (with a button for me to disable it if — for example — I had to restart half way through). I connected this one to a wired ethernet connection using a USB to ethernet dongle to avoid the notorious conference wifi syndrome.

I've got a bunch of ideas I'd like to incorporate (particularly around remote viewing), but ran out of time before I/O to get them implemented.

Can I Get the App? Can I See the Source?

Yes and yes. I need to make a few improvements before I release it on the Android Market and I need to refactor and tidy the code before I open source it. In the mean time I'll do a couple more posts the go into more detail on how each of the components work. Stay tuned.