When developing a sample list Hero widget application on the Amazon Fire phone I noticed that if I uninstall the application and install it again, the content from the previous application widget is displayed in the newly installed application.
Is this an expected behavior of the widget, because I cannot find any information about this?
The Amazon Fire phone just performed an update to a new operating system version(3.5.1) and after this update, the hero widget does not retain anymore information from the previous application.
It looks like this issue was fixed with the new system update.
Related
Developed an app that is feature intensive. (Complete and in testing)
User requests a widget on the home screen to display some summary data that will receive updates from the database that the app works with.
The widget is not difficult to create.
My question revolves around deployment. I want to be able to launch the app from the widget.
This of course means I have to install the app on the device along with the widget.
What is the deployment protocol for something like this or am I going about this the wrong way?
Summary:
Developed app
Developed widget that displays summary info entered through the app
Tapping on widget will launch app
How to deploy both together
Thanks
Q. Android Appwidget not showing in launcher immediately after installation:-
What I have already tried and does not work consistently
Included stub Activity with MAIN and LAUNCHER intent filter
Included this code in onCreate() of this stub activity
sendBroadcast(new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME));
What works consistently
Reboot
Change orientation of device with widget list opened. This causes a refresh of the widget list and shows the newly installed widget.
So is there something I am missing ? It creates poor perception when user installs widget and does not find the widget in the widget list. Generally leads to uninstall :(
This is an open issue for some devices and OS versions (mainly ICS it seems). What are you running? It should be the same issue which is, hopefully, soon fixed. I think the best option for you would be to inform your customers about this bug and that it is out of your hands. You should then also provide an easy way to fix it! An informed customer is less likely to have false expectations and uninstall your widget.
I'm developing a widget which gets updated via intents. However, when the homescreen app (tested with ADWLauncher EX, the default Android homescreen and HTC Sense) is restarted, the widget is displayed with it's default layout, and no notification event is received to update the widget's content. No widget added or widget updated events/intents seem to get fired.
Is there any way for a widget to get notified when the homescreen app is restarted and the widget is (re)displayed?
Thanks!
There may not be a reliable way to detect launcher restart on all platforms. I have seen ONLY com.sec.android.widgetapp.APPWIDGET_RESIZE on Samsung Touchwiz android 4.0.4, and ONLY android.appwidget.action.APPWIDGET_UPDATE_OPTIONS on Jellybean 4.1.1, and nothing on several other builds I tested.
That said, when I encountered a problem similar to what you describe, the root cause was improper use of RemoteViews. Check your code to ensure you are only using one instance of RemoteViews for all updates. If you are continually using a new instance of RemoteViews in your code, many of the updates to your appwidget will be lost the next time it restarts.
Similar question: Widget not updated on launcher restart
I developed an APP + Home screen widget for Android. Now I updated the app (incremented the version code/name) but when i install, it doesn't automatically replaces the existing widget on screen. It just says "problem loading widget".
Any Idea??
Did you change the class name of the broadcast receiver implementing your widget? If so, don't do that.
There is of course the related use-case where there was a widget loaded on the home page and the user then uninstalls the application that contains the widget and widget config app. I guess this is the same as a new version which must to an uninstall/install cycle.
When that happens, all you see is the "Problem Loading Widget" in a toast-like box on the home screen. As far as I can tell, the widget gets no indicatation that the package is being uninstalled and I guess then the home screen AppWidgetManager thows up a default message.
Not well thought out behaviour on the part of the OS team. I suggest that it would be better to call the widget's onDisbled() and onDestroy() methods and to remove the widgets from the home screen before the package is removed so they can tidy up if need be and the user (non-geek phone user) gets a clean experience.
All I can find is the indication that only the user can remove a widget from the home screen, says commonsguy: Removing AppWidgets programmatically
I sure us developers can handle the odd weird toast, but for non technical "ordinary" phone users this sort of behaviour drives them back to iPhones very quickly.
This is the right behavior to me. As app is installed again, its widgets should be installed again too. If, for instance, there is a new activity to configure the widget, how do you know it as a user ?
There is, indeed, no way to guarantee that a new widget would run at all from this perspective.
i am aware of android BROADCAST_PACKAGE_REMOVED for notify when any application is uninstalling from device.
Now it is possible that when i uninstall one application and that application do some work before and uninstall.
e.g: my application work with android contact if application uninstall at that time i want to change in contact data.
can i get any event for uninstalling app?
Thanks.
No.
(at least until the current version of Android)
In case it's any help, widgets do get notified when their last instance is removed. However, the app than contains the widget remains installed.