Calling winrt api from windows phone silverlight app - c#

I have existing windows phone silverlight app that works fine on windows phone 8.0 and 8.1. However on windows 10, my app terminates during suspend event.
It took me a while to understand that problem in that my app takes too much time on main thread during suspending and system terminate it as stop responding.
Using winrt api the solution can be accomplished by this code:
var defferal = SuspendingEventArgs.getDeferral();
await someSavingMethod();
defferal.Complete();
However I simple don't have access for that api, as my app uses only windows phone api (for running on windows phone 8.0)
Is this possible to somehow call this winrt api in my code or maybe fix suspending termination with other way on windows phone 10?

Not possible, you have to use what the 8.0 API offers to accomplish your goal.

Related

Windows Universal App Development Shutdown Timer Possible?

Is there a way to shut down the device by calling a method in c#? And if yes, an example would be nice. Be aware of that i'm asking if it's possible in a windows universal app.
You can NOT shut down the device with a windows universal app.

Substitute for EasClientDeviceInformation() in Windows 10

In one of our projects on Win-RT targeting Windows 8.1 , we had used EasClientDeviceInformation() to get the client device information. But, now we want our app to be working on windows 10. So is there anything else that we could be using?
You need not change your code at all. EasClientDeviceInformation API is available on Windows 10 and you can use it in universal windows app and it would work on both Desktop and Phone. MSDN Page for this API lists the detail.

Convert Universal app to Windows Phone app only

I am developing an Universal app capable of running on both Windows Phone and Windows. But initially I want it to be available to phones only because I have not made the Windows part of it. So how can I limit the target devices of this Universal app without creating a new app and without removing the Windows Code from it. I want it to be available to phones only for deployment. Can anybody give a solution?
Windows and Windows Phone apps are submitted separately to the Store. The process for submitting Windows apps is outlined here and for Phone here. So you can simply submit one without the other.
You can also stop building the Windows portion of the app using the Configuration Manager if you want to (to save time or avoid compilation errors you don't want to fix yet).

ActivationPolicy="Replace" not working in Windows Phone 8.1

In Windows Phone 8.1 the default ActiovationPolicy changed from Replace to Resume.
I have a Windows Phone 8.1 Silverlight app and I want to use ActivationPolicy="Replace". Changing ActivationPolicy="Resume" to ActivationPolicy="Replace" does not work, the app still resumes.
I remember one video from build claiming that this should work, but is this really possible? If so, what is the way to make the app replace instead of resume?
Windows Phone 8.1 Silverlight apps always resume (http://social.msdn.microsoft.com/Forums/wpapps/en-US/caf0d79a-c55e-4046-afc1-86260c005205/activationpolicyreplace-not-working-in-windows-phone-81?forum=wpdevelop)

How do I programmatically launch an application?

I'm trying to programmatically call an event to launch an application in Windows Phone 7. How do I go about doing this?
What I'm looking for is how do I schedule this event call? (for example, opening an app in WP7)?
I think you are talking about Tasks. All available tasks can be consulted here: http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks(v=vs.92).aspx
The call app you are talking about is the PhoneCallTask: http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.phonecalltask(v=vs.92).aspx
If you want to call and app, that is, to open an application from the phone, you can't really do it. Please look at: Launching other applications in Windows phone 7 Programatically

Categories

Resources