android widget question.

Questions about programming languages and debugging
Post Reply
User avatar
l0ngb1t
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 598
Joined: 15 Apr 2009, 16:00
15
Contact:

android widget question.

Post by l0ngb1t »

i am having hard time google'ng what i want, so i will try to explain it her...
i am building a widget, i want when the user press on the widget(on the home screen) a configuration box opens where he can edit the info used by the widget then update the widget, any examples on how it can be done or what should i google for ? any specifique techniques are used...

Thank you.
There is an UNEQUAL amount of good and bad in most things, the trick is to work out the ratio and act accordingly. "The Jester"

User avatar
l0ngb1t
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 598
Joined: 15 Apr 2009, 16:00
15
Contact:

Re: android widget question.

Post by l0ngb1t »

i think this is similar to what am looking for
http://stackoverflow.com/questions/4073 ... m-activity

but more links or examples or even guidelines from you guys will be very helpful.
There is an UNEQUAL amount of good and bad in most things, the trick is to work out the ratio and act accordingly. "The Jester"

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: android widget question.

Post by ayu »

Here's some information on how to bind a click event to the widget.
Not sure if it still works with the newest version (ICS) of Android, so might depend on what version you are developing on.

Code: Select all

http://stackoverflow.com/questions/2748590/clickable-widgets-in-android
My Android phone is broken and the new one will arrive today, so might be able to help you more later (never trust the Android emulator).
But this is as far as I can help you at the moment ^^
"The best place to hide a tree, is in a forest"

User avatar
l0ngb1t
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 598
Joined: 15 Apr 2009, 16:00
15
Contact:

Re: android widget question.

Post by l0ngb1t »

much appreciated cats *thumb*
and you are right about the emulator, my phone is a test field now... i think using a phone is kinda faster and more reliable to test apps.
what phone you ordered ?
There is an UNEQUAL amount of good and bad in most things, the trick is to work out the ratio and act accordingly. "The Jester"

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: android widget question.

Post by ayu »

l0ngb1t wrote:much appreciated cats *thumb*
and you are right about the emulator, my phone is a test field now... i think using a phone is kinda faster and more reliable to test apps.
what phone you ordered ?
I have ordered the Samsung Galaxy S3 (Metallic Blue) :)
"The best place to hide a tree, is in a forest"

User avatar
visser
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 472
Joined: 03 Apr 2007, 16:00
17
Location: online
Contact:

Re: android widget question.

Post by visser »

Take a look at this helper class here:

http://developer.android.com/reference/ ... mmary.html" onclick="window.open(this.href);return false;

The widget itself can be treated a lot like a view so that shouldnt make it to hard to do. Much like with an application where you had to create a file that defined your application you have to create a file to define your widget. I am fairly certain that the one application definition file can be used to define the app, widget, and services that you will need to create the widget.

For a widget there are a couple ways of doing it really.
You can just have the widget and everything can run through that guy. Not a big deal and its relatively straight forward and easy to implement and produce.
If you go the route of creating an application, services, and a widget that would be my personal choice. Reason being: you set up the application to simply edit the preferences of that widget (when you click on the widget it would actually launch this application then from within the application you edit how the widget acts and shit). The widget gets all of its needed data from services. The service is kind of like a layer between the widget and the application. Plus if you use services then later down the road you can expand your widget without having to rewrite it.
AKA Scottyrabbit

software engineers unite!

//When my words are remembered its because my actions were loud enough.

Post Reply