Creating widgets

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

Creating widgets

Postby danc81 » Fri Oct 02, 2009 6:19 pm


I'm learning Android development and have an application running but I would like to create a widget to be placed on the home screen like Twitter or Google search. Is there a way to create and application which also provides a widget?

Posts: 3
Joined: Fri Oct 02, 2009 6:13 pm


Postby MOnline » Mon Oct 05, 2009 10:32 pm

Hi danc81

To answer your question yes there is ;). But I guess thats not the answer you are hoping for. If you don't know how to create widgets yet please check out this website: ... th-source/ as for creating an application (which is actually the right word) it is possible. I must say I haven't tried it out myself but I did google for it (a while back) and found this thread: ... 12692.html. Main difference is that this guy want to add multiple icons / entries to single application but it should get you going ;).

A small explanation about the thread i found. As I see it 1 apk is assumed to be a single application. Thats fine because we only want multiple activities with there own entry. If we look at the code below all we need to do is specify the activity name and the taskAffinity.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  2.     ...
  4.     <activity android:name=".Foobar1" android:label="Foobar1" android:taskAffinity=".Foobar1">
  6.     ...
  8.     <activity android:name=".Foobar2" android:label="Foobar2" android:taskAffinity=".Foobar2">
  10.     ...
Parsed in 0.013 seconds, using GeSHi

Hope this helps. Btw let us know if the multiple programs in single apk stuff works. Could be usefull to have it verified.

With kind regards,

Junior Developer
Junior Developer
Posts: 11
Joined: Mon Sep 21, 2009 9:51 pm


Return to General

Who is online

Users browsing this forum: No registered users and 6 guests