appwidget

Android - AppWidgets, AlarmManager and AsyncTask

I'm not having much luck with updating an app widget with AlarmManager generated broadcasts. Here's what I do: Initializing AlarmManager on AppWidgetProvider#onEnabled AlarmManager alarms = (AlarmManager) context.getSystemService( Context.ALARM_SERVICE); alarms.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemC...

appWidget Orientation Code

I have code in an appwidget that I want to run when the phone's orientation changes on the home screen, ie like when the keyboard flips out. I have an image that I want to change in an imageview in my appwidget. I can't use different layouts linked to the orientation (ie "layout" and "layout-land") because I don't know the name of the im...

Android Widget Not Updating

I am trying to implement a simple widget for display on the home screen. The problem I am experiencing is that onUpdate is only being called once when I install the widget. The configuration is below. Note: I will not leave update period at 20 secs as I know that would kill battery (just testing). Configuration: `<appwidget-provider xm...

Decoupled AppWidget Intents after Home process restart

My Android app Transdroid offers several home screen widgets. Every AppWidget has 2 'buttons' (ImageButton), one starts the app and one starts some activity that refreshes the AppWidget content. Pretty simple. Here is a screenshot. The widget code is at my Google Code website, but most importantly: RemoteViews views = new RemoteViews(co...

Looking for an elegant appwidget skin solution

I have an appwidget application and would like to enable users to create skins which can be applied at runtime. My preferred solution is to use apk files with nine patch png images that stretch to fit the ImageView's of widget, however its starting to look like I might have to use another packaging technique (e.g. zip files). What I've ...

ProgressBar in an AppWidget

I ran into an interesting situation with using a ProgressBar in an App Widget... The documentation (http://developer.android.com/guide/topics/appwidgets/index.html) says that ProgressBar is a supported widget class... I have no problem getting the ProgressBar to display in my App Widget but the problem is that I want it to only be disp...

How can I get the correct DisplayMetrics from an AppWidget in Android?

I need to determine the screen density at runtime in an Android AppWidget. I've set up an HDPI emulator device (avd). If set up a regular executable project, and insert this code into the onCreate method: DisplayMetrics dm = getResources().getDisplayMetrics(); Log.d("MyTag", "screen density " + dm.densityDpi); This outputs "screen d...

How to launch activity from android home screen widget

Hi all, I am desperately trying to get my head wrapped around how to implement home screen widgets. Right now, I (finally) was able to get a button on my widget respond to a button press setting up an intent filter in the manifest. However, I cannot for the life of me figure out how to launch an activity when the button is pressed. B...

RemoteViews addView function returns errors on AppWidget

I'm trying to create a AppWidget that displays a number of items (which can change). I'd like to generate TextViews dynamically, I assume I do this by using: RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.id.widgetmain); RemoteViews newView = new RemoteViews(context.getPackageName(), R.id.widgetitem); updateViews...

How to highlight clicks in app widget?

Hi everyone, I have an app widget which runs neatly. However, I am unable to highlight a click on a linked item. I've seen it in the standard app widgets like 'Music' and 'Power Control', for instance. Moreover, I've also been studying the Music app widget's source at album_appwidget.xml. The only thing I could think of is the LinearLay...

Force Android widget to update

Hi all, I respond to a button press on my appwidget in the onreceive method. When the button I pressed, I want to force the widget to call the onupdate method. How do I accomplish this? Thanks in advance! ...

Custom component which displays voice recognition button if available

Hi evereyone, I'd like to create a custom component which supports voice recognition. It will primarily be an extended EditText which should show the microphone button for voice recognition if it is available. I wanted to to look at the search app-widget on the homescreen but I don't find it in the source. This is intended to use the v...

Auto Screen Rotation Disabling Widget RemoteView onClick event

Hi, I have a bit of a strange bug with a widget I've coded- after the screen rotates the widget stops responding to onClick events. The code is exactly the same as in the Android Developer Documentation for App Widgets here. I've noticed other widgets from the market don't have this problem- is there a known workaround perhaps? I've tri...

Getting App/Widget on Homescreen ?

I was wondering if it's possible to get the icon (shortcut) of your app on the home screen during installation instead of inside the standard apps folder ? And I did find out that Android has AppWidgets but I was wondering if it supports "standard" widgets as well (javascript/html/css) ? ...

Why is my android alarm manager firing instantly?

I am following sample code for sending an update notification every 10'seconds. The code follows and it is in an "UpdateService" for an AppWidgetProvider. If I put a Thread.sleep(10*1000); I can see the expected behavior of my servicing loop. I obviously have something fundamentally wrong that is triggering immediately. It is suppose...

Android AppWidget layout troubles with ellipsize

I'm writing an app-widget that displays some numbers, each with label in front of it. The layout looks like this: .-----------------------------. | Label1 | AAAAAAAAAAA | | LongerLabelLabel2 | BBBBBBB | | LongLabel3 | CCCCCCCCCC | '-----------------------------' There is one outer (vertical) LinearLayout, and each row is a...

Updating AppWidget

Hi, I'm launching an activity on a buttonclick from AppWidget. The user enters some data on the activity and when user closes the activity, I want to update the data user entered in a TextView on AppWidget. Any idea how to do that? I have successfully launched activity from AppWidget, only problem being updating the AppWidget. ...

Is Toast allowed from an Android appWidget?

I would like to pop-up an error from the appwidget when one of its background tasks fails, but I don't think that is permissible -- or if it works, that it is safe. ...

How can one get the appwidget's own ID?

I am trying to debug a problem where my widget becomes invalid and a new one fills in. This only happens once at the beginning of time and then it remains the second widget forever. So, I want to put code in to narrow down the point in time when it happens. What I would like to do it something like this: e.g., (not real code) Log.d(T...

Can I have a TableLayout in an AppWidget?

LinearLayout just works fine in an AppWidget. However, when I change the layout's xml to a TableLayout, I am unable to get the widget working :(. Can anyone point me to a sample? [could not find anything on the web] -Sri ...