Advancing Backwards

Boldly going in the wrong direction since 2008

Browsing Posts tagged Programming

So, after a rather long absence from Android, I decided to dive back in and start tweaking an app I started a while back. This particular app uses the GPS to store a location in a database. The problem was, the app would sometimes try and store the location before the GPS was even ready, resulting in coordinates of 0, 0. At the same time, I also wanted the GPS reading to be as accurate as possible before it was stored in the database. Accuracy of +/- 80 feet is not so useful in the long run.

After some thought on how best to accomplish this without pissing off the user (nobody likes an application that seems to hang, even if there is something ticking in the background), I settled on displaying a ProgressDialog to let the user that something is indeed happening, and they can continue once its done.

continue reading…

One thing I’ve been grappling with recently is how to get home screen applications widgets to work for my application. There is a decent tutorial in the Android developer documents about the subject (located here), but it doesn’t really go into too much detail on how to make your widgets interactive. Sure, it shows you how to set up an OnClickListener on an element of your widget to load an activity from elsewhere, but what if you want the widget to do something more, like redraw itself with a new image when its clicked? This seems pretty simple, but to be honest, it took me a lot of fiddling to get it to happen.

continue reading…

In my ongoing quest to write about little known or poorly documented features of Android, I stumbled across something this morning that I feel needs a little bit more exposure, as it frustrated me for quite a while trying to figure it out.

continue reading…