I need to wake up windows phone 8 device. App is in foreground and I lock the screen.
I tried Toast, but it wakes up only when the app is in background.
I also tried Alarms and Reminders. But this button "snooze" is not acceptable for me.
I couldn't find any other way.
Alternatively maybe is it possible to send the app in background programmatically?
By waking up you mean unlocking the screen?
You cannot do that. Nor you can resume the app from the background or launch it using any means.
It is simply impossible due to the OS restrictions.
Related
Any way I can write a windows store app (for phone or other) which will allow me to draw on top of other apps? In other words, I'd like my app to run in the background and not handle any user gestures but be able to draw on a semi-transparent overlay / canvas above any other running apps. I can do this in windows 7 but WinRT is new to me.
thanks
I do not believe it is possible due to the sandboxed nature of Windows Store Apps to do something like this (much akin to iOS). Windows 8 has much tighter security in its applications, so much so that you can't even take a screenshot in a metro app, because if a user has split the screen to hold two apps, you could potentially capture information from the other application.
Please correct me if I'm wrong, but I've encountered this problem before and have found no viable solution.
I am developing a Windows phone 8 app that need to run only in background with UI. Is there any way I can run the app in the background, or without actually being open?
It depends upon what you want to do in the background. Generally speaking you can't implement something like a Windows service that will startup automatically when the phone is launched.
That said you can run your app in the background within given limitations. Check out MSDN for detailed information.
Why all these limitations you might ask yourself? It's to provide a good battery life to the user.
Edit:
For the periodic agent to start running the app must be started once. Further the agent must update a live tile (user must pin it to the start screen) or the app has to be once opened every 14 days.
Another option might be using push notifications to trigger an update..
I'm in the process of developing a WP8 app that makes use of the background location tracking abilities provided by the OS. The idea is to monitor the users position and to notify them when they are near certain types of places.
So far it all seems to work fine and when running the location tracking works as I would expect.
The problem is, it seems that the phone times out background apps after around four hours, stopping the location tracking.
I can understand why Microsoft did it, to preserve battery life etc. But there's not much point having a background location tracking app that has to be manually restarted every four hours! If a user chooses to run this app and is made aware of the potential battery hit, surely it should be able to run indefinitely - to a point of course, if the system runs out of resources or similar then that's fair enough.
Does anyone have any experience with this? There must be hundreds of others apps in the store that have run into this issue I would have thought? And presumably there must be some way of keeping the location tracking running?
I've tried periodically updating the live tile (using a DispatcherTimer) while the tracking is running but this doesn't seem to be enough to keep the app alive either :(
Anyone have any ideas?
Thanks.
There is no way to achieve your desired behavior. The app will be deactivated under anye of following conditions:
The app stops actively tracking location. An app stops tracking location by removing event handlers for the PositionChanged and StatusChanged events of the Geolocator class or by calling the Stop() method of the GeoCoordinateWatcher class.
The app has run in the background for 4 hours without user interaction.
Battery Saver is active.
Device memory is low.
The user disables Location Services on the phone.
Another app begins running in the background.
Source: Running location-tracking apps in the background for Windows Phone 8
What you could do is to show a toast notification before app is deactivated advising the user, and make him navigate back to the app, extending the period for other 4 hours that way.
There is no way to keep it running without any user interaction.
I'm having a problem integrating Fast App Resume into my Windows Phone 8 app. When I hold the start button and enter a voice command, the command won't fire a Navigate event if the app is already loaded. I've tried intercepting every event I can when the app loads.... nothing.
Does anyone have any insight on how this should be handled in code?
Thanks!
I have confirmed with Microsoft that this behavior is indeed the case, and it is the way they intended it. They have left feedback to Engineering to take a look, but we can help it along by voting for it on UserVoice here.
This is how you do it on Windows Phone 7 http://blog.jerrynixon.com/2011/11/mango-sample-lock-and-run.html is it possible in Windows 8?
This sample is showing you how to implement the functionality so your app will still "run" when the device is locked. It only seems to work with a kind of "background tasks" which makes it not exactly the same as it is for Windows Phone.
http://code.msdn.microsoft.com/windowsapps/Lock-screen-apps-sample-9843dc3a
Please note that an app that can run when the device is locked should have at least one of the following background tasks:
Control Channel
Timer
Push Notification
Here is some more info on the lockscreen: http://msdn.microsoft.com/library/windows/apps/Hh779720
UPDATE:
As far as I have found there is no exact behaviour like in Windows phone to run your app under the lockscreen. There are a few recent posts on the MSDN blogs which explain the background model http://blogs.msdn.com/b/windowsappdev/archive/2012/05/16/being-productive-when-your-app-is-offscreen.aspx?wa=wsignin1.0
Sorry to see that at this moment there is no way to make it work under the lockscreen