[Q] Homescreen Widget - process dies, widget left in limbo, need recovery strategy - Android Q&A, Help & Troubleshooting

Guys
Hope you can offer me some sage advance.
I assure you it will be most appreciated.
I have a home screen widget backed by a Service and am seeking a guaranteed solution to recover from the death of the process hosting the widget.
The widget seems to die as the result of 'killing proc' or 'process has died'.
I might be missing a trick here and it might be blind to the blatantly obvious. If so please point me in the right direction.
I am currently using the ACTION_SCREEN_ON intent to check the state of the widget when the screen is turned back on. This works, but does not cater for the scenario where the process is killed while the screen is still on.
This leaves my widget in limbo, as the data it depends upon to function has been lost.
Q. Is the OS guaranteed to spawn a new process if the widget is killed?
Q. If so, is there a way to have the 'widget host' post an action when it spawns the
new process?
Q. If not, is there an action I can listen for that will result in a new process being spawned to handle the action?
As I understand it the android.appwidget.action.APPWIDGET_UPDATE action is only delivered on first initialisation of the widget so I can't use
this as a trigger to re-initialise the widget.
I had hoped to use the AlarmManager to implement a heartbeat in order to prompt the widget and provide it with the means to recover had it been killed.
This does not seem to work as the context is lost along with the process.
Any suggestions on a strategy for dealing with such a scenario.
Thanks in advance for your advice.

Related

[Q] (Code question) Need to figure out a way for my widget to update it's icon.

Hey all,
Forgive me if I need to post this elsewhere but the searches I have done have come up empty.
I'm pretty new to Java and Android development. So I'm sure this is an easy fix. But I could use some help.
The short version is I need to figure out a way for my widget to monitor the silent mode status. And would like to know what monitor's the home screen usage in android system.
The long version is this. The widget is pretty simple it just toggles the silent mode. (Hey we all have to start somewhere.) The problem is it's designed to update the icon to reflect the silent mode status, but the code triggers through a click action. See the problem? Yep silent mode can be toggled in many different ways. Thus what I need is an efficient way to monitor the silent mode status. My current idea is to have it run a simple check whenever the "home" or "back" buttons are pressed/whenever the home screen displays.
Problem is I don't know what SystemService checks that. I'm not really looking for an "ok plug this code into..." I want to learn. I'm looking for what I need to call in so I can monitor when the user returns to the home screen. Or if anyone has another more simple fix I'm all ears.

[Q] Rss/calender on lockscreen?

Greetings friends,
[Q] Is it possible to have my RSS feed or my calender, say upcoming events, displayed on the lock-screen?
You don't have to read below this line. Appreciate your help, thanks.
Now before you judge this redundant, I would like to inform you that I've already done some research and already tried a couple of options, namely an app called "lock-screen calender" and a number of lock-screen replacement apps. I've encountered some difficulties on a number of them and maybe even discovered a flaw or two in some apps. For instance, I've found that on my device (GSMRAZR:2.3.6 stock rooted) every time I hit the home button soft key while on Go launcher's lock-screen, it takes me straight away to my home-screen, bypassing the pin security option of the Go launcher lock-screen itself!!
I intend to write to the developers of that app about it after I receive confirmation from other GSM RAZR users, you know just to be sure it's not just me.
Widget Locker on Play Store.
thank you but
Thank you for suggesting widget locker. I've seen this app but have been reluctant to try it since I've heard complaints of battery drain among other things. I will give it a try, eventually, but would like to know your experience with this app and if there is any other options. Say a mod to the original RAZR lock screen, which I am really keen on.
Battery drain *is* a problem. 12-15% in my case.
You can also try Go Locker and create your own theme.

[Q] - Tasker - Event Trigger when landing on a specfic homepage

Hi Everyone,
Let me start by thanking everyone in advance for any help. I've recently started playing around with tasker and there's one thing I'd like to do that I can't seem to figure out. What I'd like to do is set up a tasker event to trigger a task when I reach a specific homescreen (ie: Homescreen 1 of 7) originally the intent was to hide the dock when on my main home screen and call it back whenever I was on any other. I know we can use the %WIN variable but that only returns the window. For example, my launcher is Nova and %WIN returns Nova regardless of which of the homescreens i'm on. Any help will be greatly appreciated!

[Q] Log touch events script help

Apologies if this doesn't belong here. I have been searching for a solution for a few days now. A bit about what I am trying to do. I own a Pivos Xios android device. It is a set top box type thing for your tv. Unfortunately my tv is slightly older and is still vulnerable to the screen burning if a static image is left to long. It has no display timeout so none of the screen savers on the play store will work. I started to mess with Tasker to make my own, but there is no way to detect a screen touch event in Tasker to know when to toggle a screen saver.
I am a complete newb when it comes to scripting for android. I took a look at an app called script manager, it looks useful, but doesn't help me much right now. So I wonder if this is possible or not, but what I would like to do is have a script that senses when the touch events happen and then writes to a text file. It doesn't even have to write anything worth a value. Tasker can detect the change in the text file and trigger my screen saver event.
I found out that using getevent -lt /dev/input/event2 in a terminal gives me a nice list of all my touch events. Is there a simple way to use it for what I want? Is there anyone that could give me a code snippet to fulfill my needs? Or at the very least point me in the right direction?
Thanks for taking the time to read!

[Q] Installing a widget from an APP.

Hello, I know i'm going to die as maybe i didn't place this post correctly, also i'm not a developer, only a graphic designer.
I'm looking for some advise, hope someone could help me with that.
Imagine that you launch your app, and within that there is a button that says "Install widget". You press that button, then the app closes and a widget appears on the home screen.
Is that possible?
i've been reading that before 4.2 i wasn't, but something changed from then. Problem is that i have no more information about this, and also i don't know if it changed over time.
I'm behind the graphic design of a widget. The idea is that you first download the app, which will help you to configure the widget, and then you have to manually place the widget in place.
They are afraid that some people wont understand, and they will cease trying.
I only would like to know if this is possible, (or something similar) and if someone knows any APP that does this thingie.
Note: APPS like "Swiftkey" guides you in the process of installing your keyboard. it asks you to go to a determinate place of the phone settings, and gives you a shortcut to that place so you don't have to go by yourself.
It would be amazing. To directly place a widget o to guide them trhough shortcuts.
Many many thanks in advance!

Categories

Resources