[Q] Block AppWidget onReceive when not on home screen - Android Software Development

Hi all, some seconds ago I was debugging my widget and I've found that the "onReceive" method is called even if my widget isn't on the home screen (it listens for "WIFI_STATE_CHANGED_ACTION" ). Even if the process of my widget isn't running, it will be started and the method called.
I want my "onReceive" called only if my widget is effectively placed on home screen..there's a way to do this?
thanks in advance for the answers

If I'm reading this correctly then there is no change necessary in the onReceive. Rather, look at your onUpdate and make sure it is checking that is has valid AppWidgetIds before it starts the services.

Related

SMS your phone status with skschema.

First of all, I want to say thanks to all the developers in this great community. The talent here, is 2nd to none.
I am not a programer, just someone who enjoys messing with his wm6.1pro.
I turn the phone off frequently when using my wifi connection. So much, my better half never knows when I can be reached. So, I created this script so she would know if my phone is on or off.
The script requires SKScheMa. It is made of 2 parts. The main script called SMS phone status.sksc, and a watch-function.
Here is the script:
#sendkey(#R)
#rSKSW) #p(#install #stop)
#todaytext(Checking phone status) #sleep(6000)
#chkgsm()
#eval(gsm=SYSVAR)
#chkcondition(gsm==1)
#IFTRUE(phoneon)
#todaytext(Phone is off) #sleep(2000)
#todaytext(Turning phone on to send SMS) #sleep(2000)
#gsmon() #sleep(5000)
#sms(My phone is turned off) #phone(+8005551234) #+(1) #d(9)
#todaytext(Sending SMS phone off) #sleep(4000)
#gsmoff() #sleep(10000)
#goto(finish)
#label(phoneon)
#todaytext(Sending SMS phone is on) #sleep(4000)
#sms(My phone is on) #phone(+8005551234) #+(1) #d(9)
#label(finish)
#todaytext(Operation successful) #sleep(8000)
#todaytext()
#rSKSW) #p(#install #start)
The first line closes my phone on/off notification and can be left out. Change the phone #s and message as necessary. Save the script in "My Documents".
Open SKScheMa. Change to Watch mode screen. Create a new function with the following:
Watch for = Phone
Event title = Phone activity state changed
Execute = script
Choose the script file named SMS phone status.sksc
Save the watch file for easy access.
Turn watch mode on and you are set. Now every time your phone radio turns on or off, an SMS I sent to let someone know.
I hope someone finds it useful.
now incorporate this into a nice GUI/icon within the today screen

[APP] [25/3/09] [0.9 Beta] Cell Broadcast as Operator Name (Manila+Dialer)

Hey guys, my first real contribution here. I was using the Cell Broadcast solution with a today plugin posted here.
I had two major issues:
1. With Manila, can not use another today plugin
2. Need to use S2U2 because waking up of device, otherwise device stays on for sometime and screen touches are registered.
I played a bit with the registry and found out that setting two keys will reliably set a string which would be used for the operator name hence changing the string in Manila, dialer, etc.
I intercepted the messages coming from "Network" and extracted the CB body, if the device has been on for less than 5 seconds, then I assume that the cause of wake up was the CB, hence I suspend the device, its working quite nicely for now, will need your feedback for a probable general working release this weekend.
To do / Known Issues:
- FIXED: One key is hard coded as 41006 (my operator code), need to get it from phone. Otherwise ask user for it.
- Configurable from field, "Network*" is hard coded for now.
- Autostart using Init registry
- Hide / Remove UI
- For now UI shows incoming CB messages, power events, time difference between power on and message incoming for deciding to suspend or not.
Hello. I did search on this topic too. but did not find anything else that you do. but exactly what does not work. I got a newer version? thanks

HELP! Expired appointment still showing in lockscreen

Hello,
I have an HD2 with wm6.5 + manila 2.5.
I was looking for a fix during hours, but did not find anything...
When an appointment has just exprired, it still appears on the default lockscreen.
Example: it is now 7:16 and the appointment which was from 7:00 to 7:15 is still showing.
Actually this is the visible part of the problem.
After testing a bit, I think the issue is wm6.5 not refreshing appointment state often engough (I don't know how to explain that, but I think that the system is periodically refreshing the appointment state, which unables to know which appointment is the **current** appointment).
This would not be a big problem by itself (it actually refreshes after 2-3 minutes), but when you use a software like PhoneAlarm, which is supposed to change phone profile according to current appointment, then you have an issue: successive appointments make the automatic switch to fail, because the software thinks the "old" appointment is still active so ignores the new one...
Does anybody know this issue and how to fix it?
Thanks,
Looki
Anybody has this issue???
Critical for me because I make an extensive use of Pocketmax PhoneAlarm...
Any help would be much appreciated!
Thanks!
... I continue working on the topic.
I found in the registry the place where the "current appointment" is detailed.
It seems to be in "[HKCU]\System\State\Appointments\Current"
Also, I checked that this very key is not refreshed at the end of the appointment (behavior that I described in the first post).
As soon as some process (don't know which one) update this key, I observe:
1/ Information in this key is deleted (meaning that there is "no current appointment")
2/ Both lockscreen and phoneAlarm immediately react and adopt the appropriate status (lockscreen doesn't show the appointment and phoneAlarm switches to the correct phone profile)
The issue is that the key IS NOT updated at the end of the appointment, but some 1-2 minutes AFTER the end.
Does anybody know how to make more often system refreshment of this key?
Thanks for your help!

[Q]Titanium: automaticly expanding "default-selected" panel

Hi guys,
I am using Titanium as my default GUI and was wondering if there is a way to make the clock panel sort of "default", meaning that if you return to the home screen from an application or from the start menu, whatever panel was active (expanded) the clock will expand and the other panels will "condense" (cpr file language, I'm sure you all know it already).
There is this app floating around that will refresh the home screen. It's called CHomeRefresh.exe and if run it will expand the clock panel even if the active panel was another one and also some threads here talk about the refresh of today screen in detail - http://forum.xda-developers.com/showthread.php?t=533788 .
To sum it up, I wonder if it's possible to:
- refresh CHome screen when it is activated (start>home or when returning from an application, etc)?
- refresh CHome every 10 seconds if no other window covers it, so in case some panel was active and left like that, the clock panel to become active => a more elegant look of the Titanium GUI?
I know this is tricky and involves a good knowledge of winmo internals, but I'm eager to read some answers from the knowledgeable guys here. I'm sure I'll get some "can do" answers.
Thanks.
Perhaps this could help: the system already has a no-activity timer when it dimms light after a specified time. Could that mechanism be triggered to activate a CHomeRefresh if the start page is active (no other window covers it)?
I am no programmer and I so rely on you coders as Titanium interface is pretty dull and needs needs a more consistent looks.

[Q] Make invisible WebView emit onDraw() event

Hi all
My question will be quite strange but is what I need unfortunately. Basically I need to create an invisible WebView instance (invisible mean not showed inside the activity) and get screenshot from the showed web page every time something change in the page. No problem from get screenshot, the problem is the way to be advised when something change inside the web page currently loaded into my webview. Please note, changes I need to get can be also some images changed "on the fly" by javascript code inside the page, these kind of "events" can no be detected by standard calls like onloadpagefinished or so on (since images changed are preloaded). Another problem can be when images are fully downloaded by the browser but not yet showed in the view (in case of slow CPU per example). Normally I could to easily fix my problem by overriting the onDraw() event of the webview. Every time onDraw() event is emitted mean that something is changed into the view and I need to get new screenshot. Unfortunately my problem is onDraw() event is emitted only if the view is currently visible inside the activity. If the view is "hidden" or "offscreen" as my case the onDraw() event is not emitted since, obviously, doesn't need it. Android views lifecycle explained in the main android developer site show why this happen (the view is set in pause state once out of visible activity part). Now my question is: is there a way to "force" the view to manage onDraw() event as it would be showed but in offscreen mode like my case?
Thank you to all will can help me

Categories

Resources