Android :: AppWidget Configuration Activity Required?
Apr 15, 2009
I'm playing around with the new AppWidget API, I get the impression from the docs that I don't need an android:configuration attribute in my AppWidgetProviderInfo xml resource. Curiously though, when I try to add my AppWidget to the home screen, I just get a black textview that reads "Problem loading widget".
View 2 Replies
Sep 3, 2010
Say that there is an App Widget that shows a configuration Activity when placed. The configuration page allows adjusting the appearance of the widget.
The user may place multiple instances of this widget on their home screen. What would be the best way to maintain the unique configuration states on each of the widget instances? Or would each widget instance have to adopt the same global state?
View 1 Replies
View Related
Aug 26, 2009
In Java ME we can set .jad configuration in description file and we can get this values in midlet by getAppProperti(""); So in Android we can set apk configuration (eclipse) apk configuration. But when I set this! my file default properties change and my projet signal some error. So in activity when can add System.setProeprty("name","values"). My problem I wan to specify the server IP and some code in apk only for this apk file. Each apk can have his code and server IP.
View 2 Replies
View Related
Jun 23, 2009
I was under the impression that onRecieve runs in the main UI thread and we can launch an activity in onRecieve without setting the flag as new task.Why do we need to create a new task and launch the activity there.Why cant the activtiy launch in the task in which main UI thread is running?
View 3 Replies
View Related
Sep 29, 2010
I'm writing a widget with a configuration activity which calls the following method when its OK button is clicked:
CODE:..............
This is almost verbatim from the documentation. widget_id holds the widget ID that was dug up during the activity's onCreate().
When I place an instance of the widget on the home screen, I've verified that I get the expected sequence of events:
onReceive() gets an ACTION_APPWIDGET_ENABLED if it's the first one.
onUpdate() gets called (in which I detect that the widget isn't configured and draw something as a default action).
The configuration activity appears.
When I press OK, the ok() method above gets called.
The method gets all the way through to the finish() and the configuration activity goes away, but there's no call to onUpdate() or onReceive() after this point. (The widget itself has no updatePeriodMillis.) I end up with a widget on the screen that has the results of my default action but never gets updated.
If I set the widget up without a configuration activity, it gets updated when created and everything works as expected (just without the configured bits).
View 1 Replies
View Related
Oct 17, 2010
I have a widget with a configuration activity.
Currently the configuration launches when you click on the widget.
I want to add the configuration as an app icon to the launcher.
The problem is that when the configuration launches on click, I get a specific widget id , so each widget instance can have a different configuration.
What will happen if I start the activity from the launcher?
I wont be able to show multiple configurations on the same activity.
View 1 Replies
View Related
Sep 18, 2010
I'm having an issue with a config activity for a widget. According to the dev docs, if I specify a configuration activity than the onUpdate method of the AppWidgetProvider doesn't get called until after you request an update once you've completed the configuration activity. For me its happening in reverse, the onUpdate method of the AppWidgetProvider gets called first, followed by the configuration activity. Then the onUpdate method is never called after completion of the config activity even though I request it explicitly. I tried with level 4 and level 7 API, same result. Here is some of the source:
Manifest:
<?xml version="1.0" encoding="utf-8"?> <manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.chris.android.swidget"
android:versionCode="1" android:versionName="1.0">
<application android:icon="@drawable/app_icon" android:label="@string/app_name">
<activity android:name=".SWidgetConfigure">
<intent-filter> <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter> </activity>
<receiver android:name=".SWidgetProvider" android:label="@string/ widget_name">
<meta-data android:name="android.appwidget.provider" android:resource="@xml/swidget_info"/> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter> </receiver>
<service android:name=".service.PUpdateService" />
</application> <uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
swidget_info.xml: <?xml version="1.0" encoding="utf-8"?> <appwidget-provider
xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="294dp" android:minHeight="72dp"
android:updatePeriodMillis="86400000"
android:initialLayout="@layout/swidget_layout"
android:configure="com.chris.android.swidget.SWidgetConfigure" >
</appwidget-provider>
I can include source of the onUpdate method from the AppWidgetProvider activity and the onCreate method of the configuration activity if necessary, but they are both being called find its just the order they show up on the emulator is wrong.
View 5 Replies
View Related
Sep 16, 2010
Is there a way how I can tell the Preference Activity that value should be saved as integer? So far my all values are saved as strings... I can limit input to integers via XML easy:
<EditTextPreference android:key="SomeKey" android:numeric="integer" />
but it is still saved as string and later trying to getInt("SomeKey") on preferences object I always get java.lang.ClassCastException: java.lang.String.
Is there a way that EditTextPreference value would be saved not as string? Or maybe I should use some other type of Preference for numeric input?
View 7 Replies
View Related
Jul 20, 2009
I have an app widget.It has 4 buttons, one one of the buttons I want it to show me the current location of the user on the map.when I run the app the following errors occur, looks like it cannot find the MapActivity class, im running it on the GoogleApps 1.5 instead of normal android 1.5 as well.
View 6 Replies
View Related
Jul 31, 2010
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.Then I would get a list of all the enabled IDs and see if I am in the list. I cannot find a method, member, attribute, etc. that would give me my id?
View 1 Replies
View Related
Jan 3, 2010
I am attempting to query a database and update information in the appwidget screen based on changes to the database done while in an activity so that when the user exits, the changes are reflected in the widget on the screen.The appwidget is being updated with a broadcast from OnPause() and OnStop() in my primary Activity.Relevant pieces of the code are below.The Toast shows me that the data is correctly being pulled when OnUpdate() is called.But the widget refused to change
View 2 Replies
View Related
Aug 9, 2009
I have a problem, I want a appwidget with a listview, but it seems that appwidget does not support this elment.so is there any way to reslove it?
View 2 Replies
View Related
Apr 25, 2009
Just wonder what limitations there are for UI elements in AppWidgets? I tried a ListView and was met with an error. I saw the other post that EditText isn't available.Just wondering if there was a full list somewhere?
View 8 Replies
View Related
Dec 31, 2009
I have a strange problem, on a few devices. I have developed an AppWidget, and it uses a database to store the configuration for each instance of the widget. The widget id is the key in the database.Everything works on most devices, but I got a bug report a couple of days ago. A user said that the widget never worked after reboot. The user who was very helpful sent me a log from his phone, and I could then see that the widget got a new id each time he did a reboot.
View 2 Replies
View Related
Jan 10, 2010
Can anyone tell me what views can I use in an appWidget?
View 2 Replies
View Related
Jul 31, 2010
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]
View 1 Replies
View Related
Nov 9, 2009
Is it possible to launch an app widget from another application.
For example, I have a button in an application. When I click on that button, an appwidget must be launched.
View 7 Replies
View Related
Sep 7, 2010
I am trying to update an AppWidget manually when a user setting changes on the device.I can tell that my AppWidget onUpdate method is being called as a result since I log some debug strings to logcat in the code. However the AppWidget itself doesn't change on the screen.Here comes the interesting part: if I rotate my device and force a refresh of the home screen (from PORTRAIT to LANDSCAPE or vice-versa) then finally my AppWidget gets updated. However rotating the device does not trigger the onUpdate method to be called, so the AppWidget must be using the RemoteViews provided in the earlier update. Can somebody explain me what to do to force the home screen redraw of my AppWidget when it processes an update?
View 2 Replies
View Related
Nov 4, 2009
I wrote a widget that has been working fine for most folks. However, I started getting bug reports about how the widget would be blank on reboot (not receive an update?), and it seemed that the Sprint Hero continually came up. I thought I was crazy but I'm finding that other people are having the same problems:Searching Google for "sprint hero appwidget problems" yields:"Added warning about the problem on the Sprint Hero device: On the Sprint Hero (HTC ROM v1.29.xxx) the AppWidget API is broken in such a way that it won't."I e-mailed the author in hopes of getting an answer, but I haven't received any response. Does anybody with a Sprint Hero know what the problem is?
View 8 Replies
View Related
Jun 24, 2009
Using Appwidgets, If we use TextView in layout provider xml then, we are able to set the text in Provider.java using remoteViews.setTextViewText() method.
Similarly, if I use AnalogClock as AppWidget in xml then, is there any method available to change the android:dial value using RemoteViews or AnalogClock api's in Provider.java ?
For Ex- I need to load two dial png's based on AM or PM.
View 4 Replies
View Related
Aug 22, 2010
I'm developing a Android AppWidget for my application. For updating my appwidget I need to download data from network. But when I try to do that in onUpdate method, my appWidget is killed by Android system. I learnt that time consuming operations can't be done in receivers so I launched a service from onUpdate method and launched a thread from that. But still the problem persists.
Can anyone please let me know how to do network operations in Appwidget?
View 1 Replies
View Related
Apr 15, 2009
I've been looking at the new 1.5_pre SDK today, and the new AppWidget API in particular. I was hoping to write a widget for posting to Twitter as part of my nanoTweeter app. The interface I had in mind would look very similar to the Google Search widget, with an EditText and a submit Button, but as far as I can see there's no way to get at user input in a RemoteViews. Is that right, or am I overlooking something?
View 6 Replies
View Related
Apr 30, 2010
I seem to be having trouble reading preferences from my AppWidgetProvider class. My code works in an Activity, but it does not in an AppWidgetProvider. Here is the code I am using to read back a boolean:
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
boolean autoreplyon = settings.getBoolean("autoreplyon", false);
However, I get the "The method getSharedPreferences(String, int) is undefined for the type widget" error (widget is the name of my AppWidgetProvider class).
View 1 Replies
View Related
May 3, 2010
Is it possible to receive SMS message on appWidget?
I saw android sample source(API Demos).
In API Demos, ExampleAppWidgetProvider class extends AppWidgetProvider, not Activity.
So, I guess it is impossible to regist SMS Receiver like this code...
My goal is to receive SMS message on my custom appWidget.
View 1 Replies
View Related
May 29, 2009
The documentation hints that: "...the lock screen could also contain widgets, and it would have a different way of adding, removing and otherwise managing widgets." [1]
Now that I have 1.5, I can see the lock screen changed to show the same background as the home screen. Is there a way to put AppWidgets on the lock screen in 1.5?
[1] http://developer.android.com/reference/android/appwidget/package-desc...
View 3 Replies
View Related
Apr 12, 2010
is it possible to play a video in an appwidget?
View 2 Replies
View Related
Aug 9, 2009
I want to create an appwidget with a listview, but it seems that remotview do not support thsi element(there is some error) so is there any way to resolve it or some other view to replace listview.
View 2 Replies
View Related
Sep 9, 2010
How can i put appwidget on my view and let it updated itself??now,i can put the remoteviews on my activity,but it seems not update itself, how can i make it update itself?
View 1 Replies
View Related
Feb 15, 2010
I would need a fast updating (minimum 5 frames/second) appwidget which can be on the desktop all the time (like the cpu usage or other things mostly measurement gauges).The appwidget is not a "must" but I've found it easy to configure for any customer so the management is easy and I need those gauges to be shown like an appwidget on the desktop.The only problem is the update speed - I've seen that appwidget is not really thought for my needs. In my case it's not about phones, the small unit will always have power supply so draining the battery is not an issue. I could tweak the 30 minute update time but it doesn't helps too much - the appwidget framework is simply too slow with all that serialization and would eat too much CPU. What other solutions can be used? I've seen that a system service (LoadAverageService for example) would do the job but that one is not really configurable, has to be compiled into Android so I kinda don't like it. The same is valid with custom app screens or any other solution which needs an custom Android build. So this is a last solution if nothing else works.
A good solution could be if the Appwidget framework would accept other views than the enlisted ones (AnalogClock, Button, Imageview, etc.) and the update would be done internally in the widget, not through the appwidget serialization chanels.
View 7 Replies
View Related
Nov 7, 2010
I'm trying to create an appwidget with a customizable background. I use a NinePatchDrawable and I would like to change it's color (using the setColorFilter method). This is no problem in an Activity, but it does dot seem possible with the RemoteView object used for appwidgets.Is there some way to get an ImageView in an appwidget to be updated with a new Drawable, not a Bitmap?Or if not, perhaps it's possible to get the actual size of the appwidget and convert / save the colored NinePatchDrawable to a Bitmap and then update the ImageView with that?I already searched quite a bit for a solution, but haven't found anything so far. I hope it's not impossible.
View 2 Replies
View Related