Looking to get started on designing an appwidget and find that none of the tutorials on android.com have information on dealing with buttons (and other UI elements)?
I found a nice tutorial that deals with those issues and is pretty easy to follow:
http://www.helloandroid.com/files/xmaswidget/android_howto-hellowidget.pdf
Leave a comment if you've found it helpful.
Thursday, October 14, 2010
Monday, October 11, 2010
Appwidget lifetimes and persistance of data
So tonight's aggravation was caused by the letter null. Basically I couldn't figure out when I was trying to get my Speed Widget to work, why I could create a locationManager and initialize it, but subsequent calls would throw a NullPointerException.
The solution (as with most things), was to RTFM. If you look at the documentation for BroadcastReceiver (Which AppWidgetProvider is extended from), you would see:
The solution (as with most things), was to RTFM. If you look at the documentation for BroadcastReceiver (Which AppWidgetProvider is extended from), you would see:
A BroadcastReceiver object is only valid for the duration of the call to onReceive(Context, Intent)
.
So that pretty much solved why my local variables were disappearing each time. I figured that appwidgets had funky lifetimes, I just didn't know where to look.
Thursday, October 7, 2010
Hello All!
So I finally gave in and created a blogger account.
So, what is this blog about? Well I'll tell you: about 3 months ago, I started watching youtube videos about how to develop for android, and I thought to myself, "I can do that". So I downloaded the SDK and got to work.
I created the Hello World app, with no problems, so I thought I could try more complicated apps. Much failure ensued.
So This blog is about all the issues I've ran into and my fixes/work arounds as a sort of documentation for myself and hopefully to help others going through the same issues.
Also maybe others can comment on my postings and give me pointers on how to do it better.
It won't be updated much, since I have a Real Job (TM) and it'll be a while before This starts looking like a real site.
So, what is this blog about? Well I'll tell you: about 3 months ago, I started watching youtube videos about how to develop for android, and I thought to myself, "I can do that". So I downloaded the SDK and got to work.
I created the Hello World app, with no problems, so I thought I could try more complicated apps. Much failure ensued.
So This blog is about all the issues I've ran into and my fixes/work arounds as a sort of documentation for myself and hopefully to help others going through the same issues.
Also maybe others can comment on my postings and give me pointers on how to do it better.
It won't be updated much, since I have a Real Job (TM) and it'll be a while before This starts looking like a real site.
Subscribe to:
Posts (Atom)