I have created a Window phone 8 app. Which changes the lockscreen image and notification in around 30 sec randomly.
My code works well in the emulator and device. When I install it through the code. My problem is that when I have submitted the app to the store as a beta app. And now I install the app from the store the app don't work as it was working. The lockscreen content don't change it remains static. I have checked the settings background agents that app is running in the background tasks but not showing the result.
What could be the cause that app is running well from the code but not from the xap uploaded to the store.
Link of app is http://www.windowsphone.com/s?appid=00d47e34-a551-4c98-b2a6-32e10babdc2f
am I missing any capability that need to fixed.
Your suggestions are welcome.
Because your title says you are using a background task and you are trying to do something every 30 secs, I assume that you're using ScheduledActionService.LaunchForTest to trigger your background task and which then performs the updating.
ScheduledActionService.LaunchForTest is only supported in DEBUG builds as a way to aid testing. It is not possible to submit an app to the store that is built in DEBUG mode so this will not work.
It is not possible to create an app which will update so often in the background. To have such an app would, potentially, drain the battery really quickly and so provide a very poor experience to users.
The best you can do is to have the background agent run on a periodic schedule (approx. every 30 mins) or trigger the updates via push notifications. (But this wouldn't work for the lock screen image.)
Related
I'm new and currently working on a Xamarin.IOS app based on a Xamarin.Android app. I noticed that the Android native app does background tasks using a class called Service from Android.App and classes from Android.Support.V7.App and Android.Content. I'm just wondering if there's any similar solution for Xamarin.IOS, or do I have to do it completely from scratch?
From document Backgrounding in Xamarin.iOS,we know that:
In iOS, backgrounding is recognized as an application state, and apps
are moved in and out of the background state depending on the behavior
of the app and the user. iOS also offers several options for wiring an
app to run in the background, including asking the OS for time to
complete an important task, operating as a type of known
background-necessary application, and refreshing an application's
content at designated intervals.
IOS regulates background processing very tightly, and offers three approaches to implement it:
Register a Background Task
If an application needs to complete an important task, it can ask iOS not to interrupt the task when the application moves into the background. For example, an application might need to finish logging in a user, or finish downloading a large file.
Register as a Background-Necessary Application - An app can register as a specific type of application that has known, specific
backgrounding requirements, such as Audio , VoIP , External Accessory
, Newsstand , and Location . These applications are allowed
continuous background processing privileges as long as they are
performing tasks that are within the parameters of the registered
application type.
Enable Background Updates - Applications can trigger background updates with Region Monitoring or by listening for Significant
Location Changes . As of iOS 7, applications can also register to
update content in the background using Background Fetch or Remote
Notifications .
For more details, you can check:https://learn.microsoft.com/en-us/xamarin/ios/app-fundamentals/backgrounding/introduction-to-backgrounding-in-ios.
I use background task with time trigger of windows phone 8.1 for update information and save it to offline, create a tile for notification for use.
I use Debug mode for testing on Emulator then every thing is ok, but every thing begin when I use Release mode for build in lumia 820 for testing.
Task is registered ok. But when BackGround task run, it close after some minutes.
I know there are some constraint about CPU and Memory for background task, but it is very hard for debug. Do you know any way for testing CPU and memory constraints? What is best practice for windows phone 8.1 backgrounds task?
I feel so tired with Background task of windows phone 8.1. Sometime it is ok, some time is none...
I would like to create an app which would pop-up fullscreen when user is not interacting with the device; the first tap would then close it. So it's exactly like a screensaver. It should "run" 24/7. Display should always be lit. Battery is of no concern.
I've already done this on android, but my WP skills are lacking and complete research would take me at least a couple of days, so I'm asking any WP gurus out there:
can the same functionality (screensaver) be achieved on the Windows Phone 8.1 platform?
If so, which are the basics that should be covered (programming-wise)?
Edit:
The only solution I have at this moment is changing the LockScreen background on a 30minute interval.
I'm still not sure whate happens in 2 weeks as some info suggests that the registered task will expire. Not to mention that LockScreen is shown only a few seconds.
Edit 2:
Subquestion: is there a way to keep LockScreen shown at all times (while charging)? Or maybe lauch lock screen from code?
Windows Phone doesn't usually allow apps to pop up on their own. Exceptions are made for specific usecases such as voip. There is also no way for an app that isn't running in the foreground to realise that the user hasn't interacted with the screen for any number of minutes.
Therefore your only option is to use the inbuilt lockscreen functionality.
In Windows Phone 8, it is suggested that, if I use LocationTracking as suggested in following code, my application will get location information continuously.
<BackgroundExecution>
<ExecutionType Name=”LocationTracking” />
</BackgroundExecution>
Now, Background Agent only executed after ~30 mins, and which is also with lots of limitations, like, it may run or may not run depending on OS.
How LocationTracking is different than Background Agent. Will it gives location every time location changes, or still it may invoke after 30 min.
Thanks.
As MSDN says:
On Windows Phone 8, a location-tracking app can continue to run in the background after the user navigates away, as long as the app continues to actively track location. This feature enables scenarios such as an app that provides turn-by-turn directions. For a walkthrough of creating a simple app that runs in the background, see How to run location-tracking apps in the background for Windows Phone 8.
There are also more differences and you must look out for API restrictions.
You can compare it with Background agent unsupported api.
And you should also be aware of some Additional requirements for specific app types.
I'm trying to build a basic tracking app for Windows Phone 8. However I can't figure out which model to use. The app shall log the location in a definable interval (e.g. 5 sec or even 2 hours).
If I develop the app as an foreground application the tracking will stop if the user opens another program, the screen locks (you can configure the app to continue running under the lock screen), or you reveice a phone call. Overall the risk of the app not being executed is to high.
There are also background tasks that are scheduled by the OS, and are only allowed to run a few seconds or minutes depending on the current state of the phone. Is there some workaround to schedule the background task execution as defined by the user? E.g. the Email client can be set to fetch emails every 15 minutes, therefore there must be some way.
The thrid option would be using the push notification service. This however seems stupid as some third party Microsoft server has to be involved and other limitations may apply. And more importantly, the app must run to receive the notification.
What is best practise on this? I don't care about battery drain as long as the app works as wanted. Similar solutions must exists for tiles that shall be updated more frequently (30 minutes or even more seems awfully long)? Am I missing something?
A basic app that can call it's own sleep would be great, but if it get's killed after a few seconds, that won't do it. Or does sleep time not count?
I'm afraid you can't do anything to make sure about your app execution.
Standard foreground application is always less important than things like incoming phone call, so you have to assume that it can be paused or stopped at any time. You also can't force user to use your app - that's why user is able to exit the app at any time.
Background execution on Windows Phone cannot be made permanent - that's how that OS is designed. And mail application is not a good example because it's a build in app. It was made as a part of that system, so it has another set of rules (if any).
I don't really see a way to do that using Push Notifications. But even if there is one, I'm sure it's not how that feature should be used.