Windows phone 8.1 background tasks - windows-phone-8

I just downloaded the universal app background task sample application for windows phone 8.1 and windows 8.1.
http://code.msdn.microsoft.com/windowsapps/Background-Task-Sample-9209ade9
So after going through the code, I understand that the background task is being implemented using the windows runtime component. I am trying to use the timertrigger.
Is it a possibility that the background task be implemented using the Silverlight 8.1 windows phone project instead of a windows runtime project?

The answer above is wrong. Wonder how it has 5 votes. Anyways, background task cannot run in a silverlight applciation but it can only register a background task. It has to be a runtime project that runs a background task.
A silverlight application can just register a background task which is a separate runtime project. Its a different process all together.

Yes, it is possible. The reason why they chose a Windows Runtime project in this example was to show the new Universal Apps. You can use the BackGroundTasks in a Silverlight based project and in a Windows Runtime base project.
But if you ever plan to expand you app to Windows 8 you should think about making it a Universal App.

Related

Trigger a Windows Runtime background task from Windows 10 Desktop

I have a Windows 10 Desktop application that needs to use a Windows Runtime API.
Solutions I tried:
Enabling Windows Runtime libraries from within my Windows Desktop application – the API was available but failed;
using the API in a Windows Runtime background task. There I have not found a reliable trigger so far. The best would be to trigger the background task from my Windows Desktop application.
start the Windows Runtime App from Desktop application using the IApplicationActivationManager – works fine, but the suddenly popup of an screen that disappears after few seconds will annoy the customer;
For solution 2., Is there a way to trigger a Windows Runtime background task from my Desktop app?
Issue solved by using AppServices, see https://msdn.microsoft.com/de-de/library/windows.applicationmodel.appservice.aspx

Need to convert my Windows Phone 8.1 app code to Windows phone 8

I have developed an app for Windows Phone 8.1 but now I want the same app to developed in Windows phone 8.0. It is possible to do that? Is there any migration tool available or I need to develop from scratch.
No you can't downgrade any app after you've started developing. IF you wanted to develop a WP8 as you said have to start it from the scratch. But still you can upgrade a WP8 app to WP 8.1 (For Silverlight Apps). If it's normal WinRT app you can only develop targeting 8.1 only.
For more have a look here
Hope it helps!
You just compile the 8.0 release and upload the *:xap to the store without deleting your 8.1 *.appxupload.
Uppdate App >> Upload and describe your package(s) >> Add new
You might wanna consider making a phone 7 app for best coverage (7 will work for 8.0 users).

How can I port a Windows Phone 8 app to Windows Phone 8.1?

I've been working on a Windows Phone 8 app, which I now want to change to be Windows Phone 8.1. How can I do this?
Should I create a new Windows Phone 8.1 app and copy all my existing files into it? Or is there an automated way for me to upgrade the existing solution to 8.1?
There are two ways to do that:
like in comment - right click on oyour project and you should see Retarget to Windows Phone 8.1
or you can open Properties window of your project and the in dropdown box Target Windows Phone OS version you can choose Windows Phone 8.1
In every case the VS should ask if you are sure to do that - it's one-way operation, so it's worth to make a backup of your solution. As WP8.1 has backward compability, in most cases there shouldn't be any problems.
Some clarification for the followers:
As WP8.0 apps are Silverlight, after retargetting it will still be a Silverlight app but WP8.1 (some new features and enhancemens).
Thought, if you want to retarget to WP8.1 Runtime, it's a totally different thing - it's a different type of an app, different API and more. You will have to port it manually. Note that not all features from WP8.0 are yet available in WP8.1 Runtime - here is a good article about that.

Windows Phone 8 get foreground application

Is there a way to get current foreground application, by some background process or application running in background?
I would like to make a history of user's activity. In Android we can use package manager and get running applications. Is there a similar approach in Windows Phone 8?
No. there is no any API or any other technique available to do that as of now in Windows Phone.

How do I build the source code for controls from Windows Phone toolkit to use with my Windows Phone 8.1 app?

The source code for different toolkit controls are available from:
http://phone.codeplex.com/SourceControl/latest
How do I build the same to use it with my Windows Phone 8.1 app (runtime) ?
Windows Phone Toolkit for WP8.0 and WP7.0 was build for Silverlight and it has slightly different Controls/Namespaces (more) comparing to Window Runtime.
So in case you want to rebuild Controls for windows runtime, it won't be so simple - you will have to do it manually for the whole code.
For more information about developing for Silverlight and Runtime take a loook here at MSDN.
You could go for other controls like Telerik or Syncfusion while you wait for WP Toolkit for 8.1 OS. Telerik has really cool controls.