Create a background service in Windows Store Application - windows-store-apps

I'm new in development Windows Store applications but I have some experience in Android.
Is there any analog of Android service in Windows Store Apps?
I need some service to run on a background, for example, service that writes to file some information when application is not active.
I read about BackgroundTasks but it's not what I'm looking for.

Windows Runtime was designed for maximum battery life so there are not any Windows Store "service" applications. The closest thing would be Background Tasks, which you have said will not work for you.
From the MSDN Blog article Being Productive When Your App Is Off Screen:
The Windows Runtime does provide facilities for doing things in the background, such as:
Background file download or upload
Background audio
Sharing
Device data sync
Live tiles
Scheduled notifications
Background tasks (mentioned above)
I would suggest taking a look at the above article and see if any of the listed things will work for you.

Related

Criteria for 'with Live Tile' sign in Store for Windows Phone Store app

In Windows Phone Store for Windows Phone 8.1 OS are applications with or without the with Live Tile sign under logo in app overview.
Which criteria must the application meet to be detected by Store as it supports Live Tile?
I know that the answer should be obvious – it must support Live Tile, but it is not as simple as it looks like. My app is not detected as it supports Live Tile.
It calls PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync, uploads the PushNotificationChannel.Uri to the server and the server sends tile updates via WNS. The tile is regularly updated.
It contains all scales of all visual assets.
Contacted MSFT Support:
There is no explicit check. The flag is set during manual instigation
of the app in the publishing process.
As the app submission has been changed to publish your app immediately, this flag will only come up once your app is manually checked. That usually only happens some days after your app is published and only in rare cases for updates (or when somebody complains about your app).
Also: The tester has to notice that there is a live tile. If it comes through push or there is no data at the moment of testing or it requires a specific setup, that will just not be visible.
I recommend hinting your live tile in the certification notes field (under describe your package) to make sure the tester is informed that you have a live tile option.
Most probably the Store show the with Live Tile tag for Silverlight (XAP) apps but not for Store (Runtime) apps.

how to track user experience windows phone 8.1

I have to develop an application that track user experience. When he used my application? how much he spent time using it ? so is there thread or attributes that i could use them to know if my application is running, is opened or is closed ?
You can either write all your own code to track usage with timers etc., to track events when it is started and when it shutdown etc.. Then write a lot more code to somehow store that data for you to access.
Or you can use one of many analytic tools that are available to really reduce your development time and stress of figuring all this out.
Google Analytics for Windows Phone
Article from Nokia on how to use Flurry Analytics
PreEmptive also used to make one for Windows Phone
You can use an analytics solution like Google Analytics for tracking app usage. You can take a look at this article i wrote on my blog (original in spanish, automatic translated with microsoft translator).
Hope this helps you.

Deezer SDK for Windows Phone?

When is Windows Phone 8 (WP8) SDK going to be released?
I have studied and prototyped Deezer API with 30s previews but I would like to get access to streams itself.
I would appreciate early access even to alpha/beta if available... Thanks in advance.
First, non of our SDKs let's you access the full music stream. Our JavaScript/iOS/Android SDK give you the permission to play full tracks - according to user's right.
Are you looking for playing the full track length, or access the Stream to for a specific usage ?
We do not share plans about a "Windows Platform" SDK availability.
Meantime, you can follow my unofficial SDK on GitHub Deezer Unofficial SDK.
It does not includes full song playback, and right now, the list of methods covered are very light, but I'll add support for more methods in the following weeks. You can also raise an issue if you need something, or create a pull request.

Run Windows Phone App in background without UI

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..

How to make settings persist after uninstall on Windows Phone 8?

I need to make a certain setting stay on the device even when the app itself has been uninstalled. For iOS we are using user's keychain to store this information. Is it possible on WP8 somehow?
If you want to keep, let's say user settings after an app is uninstalled, I highly doubt that this is possible on Windows Phone. First of all it would create a lot of orphan files on the phone that you would not be able to get rid of. One of the services on Windows Phone is Package Manager. This manager is in charge of installing/uninstalling apps, keeping track of what is pinned to the start screen and other metadata about an app and any extensibility points like Share..., etc. If you uninstall an app this manager should clean everything related to you app, even your user settings in any file or IsolatedStorage that you create.
iPhone and Android give you an ability to use some sort of file manager to explore your phone. As far as I can remember you could use Putty to connect to your phone to see the folders and stuff. In Windows Phone you cannot go this far. There are some tools like Windows Phone Power Tools that you can use to check the installed apps, but that's about it.
Apps and all their related data are stored in sandboxed folders. When an app is uninstalled this whole folder is deleted. As such this means that all saved data is removed.
There are two, probably non-ideal, workarounds.
You could create an image saved in the users photo library. You could embed the identifier in the image or it's name but the user has control of these images and may delete it. You also can't programmatically delete such files so you may end up with lots on the device. Having lots of "rogue" files on a device is also likely to cause a user to tidy them up (delete them).
You could store a record of the setting, linked to the device on a web server. This has the downside of needing to maintain the server and handling data sync and offline scenarios.