I just read that while Windows Phone 7.5 background tasks can poll for a location, they don't actually poll real-time from the GPS but rather the location API calls return a system-cached position that's only updated once every fifteen minutes.
That limitation of course completely invalidates any attempt at having navigation run in the background as you can get pretty damn far off-track in fifteen minutes, let alone that a background task can only run once every thirty minutes or so!
That said, Nokia's navigation app and reportedly Runtastic's app do continue tracking when in the background (i.e. not just under the lock screen) and both are in the marketplace meaning they have been approved, so does anyone know how they managed to do what the SDK supposedly doesn't support?
For reference, we don't actually need real-time tracking... maybe once a minuted or so, and we don't need that much accuracy... maybe 100 feet or so... but we do need more than we have been given. We just don't know how they're doing it in approved apps.
You'll only be able to retrieve the location when your PeriodicTask executes (Approximately every ~30 minutes, depending on OS scheduling). The location data it fetches from GeoCoordinateWatcher will be from the OS's cache rather than directly from the GPS hardware. If nothing is running the OS will update this with coarse-grained data approximately every 15 minutes. However if an application has executed and retrieved fine-grained GPS hardware data than this will be the data you'll retrieve in your PeriodicTask. You can see examples of this by accessing the GPS in your foreground app and force-scheduling your PeriodicTask with ScheduledActionService.LaunchForTest.
Based on my experience with background tasks, you will not be able to achieve what you want with either Periodic or ResourceIntensive background tasks.
Despite documentation claiming that they run every 30 minutes, my experience is that they run sporadically and unpredictably. Over the last 14 hours, my app's periodic task has run a total of 6 times, and this is pretty consistent every day - it runs about once every two hours. For resource intensive tasks, I find they usually run about twice a night. I guess the OS has to balance all the processes on the phone and all the other apps clamoring to run their background tasks, so sometimes yours doesn't make the cut. Obviously, your mileage may vary based on your phone (lumia 800 in my case) and the apps you have installed.
If you want to write an app that tracks your location once a minute, my advice would be to enable it to run under the lock screen by disabling idle detection and make sure it has a low memory footprint to conserve battery life.
Related
The Mac has decided to freeze and restart several times a day while I'm using it.
panic (cpu 2 caller 0xffffff801a579938): watchdog timeout: no checkins from watchdogd in 93 seconds .....
Used the repair disk utility tool multiple times in different recovery modes.
I Used every free admin fixing tool, clean up tool and error reporting tool on the app store.
Launched my Mac in all sorts of different recovery modes. I literally pressed and used every restart keyboard combination you can with a Mac. And I used them several times over and over in different scenarios.
Spent hours researching every forum and reading every article of similar problems and solutions.
Download the manual updates and installed them each separately
After a day of frustration i found then solution
The fans internal sensor wasn’t working any more.
I set the automatic controls using Macs Fan Control app and in Custom switched to Sensor-based value and selected CPU PECI from drop down and set 30 in Temperature that the fan speed will start to increase from and 90 in Max temperature. Fans now kicking in and cooling down the processors and preventing from re-starting.
Source
How to setup Windows 10 Notification when Stability Index drops certain percentage ?
This is to help me determine when to Restart which helps reduce risk of Excel Web problems; until permanent/concrete resolutions show up.
I have not been able to find solution for following:
real time
scheduled more frequent than hourly
https://4sysops.com/archives/monitoring-windows-system-stability-with-powershell/
https://www.ghacks.net/2010/08/30/how-to-create-desktop-notifications-for-windows-events/
Summary
When putting the monitor in sleep mode in Windows 10, Windows seems to execute some tasks that don't get executed with the screen on.
This is interfering with our software, and we need to get rid of it.
Ful story
For a hardware device with a touch screen, I need to be able to turn off the touch screen when it's not in use, for durability reasons. Windows has a message that you can send to turn it off, SC_MONITORPOWER. More specifically:
SendMessage(hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, 2);
This works fine, but when the screen is off, Windows is apparently sometimes performing some tasks that it doesn't do when the screen is on. We are careful to never write anything to the screen in this situation (that causes huge problems when the screen is off, in fact just having a blinking cursor in a DOS box is using up half a core when the screen is off).
Our software requires a callback to be executed every 0.25 ms. We have turned nearly every task, service and several other things in Windows off, and with the screen on, I can run our software for days without ever missing a callback. But with the screen off I get hiccups. The callback already runs at the highest possible priority.
So there is apparently something that we missed when we turned all services and tasks off. There appear to be 2 causes of hiccups:
One happens once every 10-30 hours or so (not sure of the exact time, it seems to vary). But it always happens 5 times, with EXACTLY 5 minutes (at most a few milliseconds off) in between (so in total it happens 5 times in a 25 minute period).
Beside this, we get a single hiccup typically every 4-10 hours, but the time between occurrences doesn't seem to be very constant so there could also be multiple causes.
I'm a bit at a loss here, and running analysis software can easily interfere with our own software, making it harder to detect when these hiccups really occur and when they are caused by running the analysis software.
Interestingly, I have seen this 5-times-every-5-minutes thing also on a completely different system (different hardware, different OS version), when recording audio in Adobe Audition. Audition misses pieces of audio every 5 minutes in this case, and I think it also only happens when the monitor is in sleep mode and you're not logged in remotely.
We have already tried to turn the touch screen off using direct monitor commands like Nircmd does, and it doesn't support those. My guess is that the SC_MONITORPOWER message is triggering more things in Windows, and if we can turn them off, that would fix our problem. Any ideas?
System
Intel i5-8700 with 6 cores, Windows LTSB, no extra software installed except our own.
Never mind, problem solved. It was not an extra task that was being started, it was one of the existing Windows processes that for some reason only causes issues when the display is off. Since killing them is not an option (Windows will just restart them), I've suspended the following processes, and the culprit is one of these (I don't know which one yet):
sihost.exe
igfxEM.exe (I very much suspect this one)
RuntimeBroker.exe
dllhost.exe
taskhostw.exe
explorer.exe
I have to continue testing a bit longer to be absolutely certain, but so far with these tasks all suspended I've not seen a missed callback in the last 38 hours. I don't know yet if there are any drawbacks to suspending all these things, so I'll try to find the cause(s) and suspend only that/those.
I have a simulator application which writes some enrypted data into a text file. The information that it writes also has the timestamp (which the application picks from system time) along with it which I can not see. I have automated this whole task of sending random data from application to the text file but I want that the records must be written with some time interval in between.
For this I can either put delay in my automation script or I can change the system time every time a new record is inserted.
If I adopt the second approach i.e. I programatically change the system time very frequently (about once in every second) would it cause any harmful effect on the Windows system on which I am running this application ? Would any other critical system processes get affected by it ? Is this approach advisable ?
The best option here is just going to be putting in a delay in the automation script. I can't think of any problems that would arise from changing the system clock every second, but it's best just to let that be handled by the CMOS and any time syncing instead of setting it to change every second.
Changing the System Time might solve your problem, but at the same time it might have adverse affects on time dependent other applications sharing the same System. For example, the automatic antivirus signature updates are time dependent and might get impacted by explicitly changing the System Time or an automatic System Time adjustment for day light saving might get triggered at an inappropriate time. Keeping this issue in mind, the best bet would be to ensure that your application runs on an isolated environment i.e. ensure that other time dependent applications are not present in the same system and also to ensure that auto updates are kept off.
Changing the system time requires administrative privileges, so users of your application will be unable to run it as ordinary users.
is it possible to fire up an event at a specified time interval in BlackBerry? I'm looking for something similar to AlarmManager class in Android (if anyone is familiar with it).
The goal is to is to run some code, even when the application is not in foreground and without it gaining foreground "focus". Preferably it should be possible to fire the event even if the app was killed by system or by phone reboot (I do not know the details about killing apps at this OS, I'm beginning development now).
I would prefer not to write a background process for this task as it is going to be fired every few hours (I think it would be a waste of battery to use a background task for a simple alarm-like event).
I've looked around a lot, but I cannot find any satisfying solution.
cheers,
kajman
The Timer and TimerTask classes are useful for running a task on a schedule. Take a look at the APIs here:
http://www.blackberry.com/developers/docs/7.0.0api/java/util/Timer.html
The Timer will create its own Thread and sleep until it has a task to run. It would involve having a background task running but it wouldn't be using an CPU or battery if it is just waiting.
If you don't want a Thread running all of the time you can use the ApplicationManager class to schedule your application to start later.
You can also configure your app to run on start up. The OS generally won't kill your apps unless you have a coding error. RIM refers to this as the Always-On Experience in their Super App document:
http://docs.blackberry.com/en/developers/deliverables/23567/Always_on_1380986_11.jsp#Keeping_the_app_running_1381022_11