New GDR3 "close button" doesn't terminate the app? - windows-phone-8

So I was debugging my app on my phone with Visual Studio attached. I've decided to close the app using the new close button introduced in GDR3. At this point the app has disappeared from the screen and quick switch, but Visual Studio was still attached.
Does that mean that the new close button doesn't actually close the app? What does it do then? Tombstoning it?

The application is killed. Visual Studio stays attached to help you debug background tasks, if any, and alternative ways of starting your app (through a pinned tile for instance). The same thing happens when you exit the app "normally" by pressing the back button multiple times.

Related

What event is raised when the Start button is pressed in Windows Phone 8.1 RT

I used MediaCapture APIs in my App. Let's say I started recording and preview. During recording, I pressed Start key and quickly come back to the App by long pressing Back key and selecting my app (task swap). The result is that the preview is frozen either running on Emulator or 8.1 WP hardware. I don't find a better event to register for Start key. I understand that this.Resume can handle restoration when your APP is being deactivated. But here I mean I switch back from Start within 2~3 seconds and the Resume call is not get called. I am thinking that I can disable preview when Start key is pressed as a workaround. Then when App is brought back to foreground, user can restart recording. However, both scenarios I can't find a proper event. Of course if preview is not frozen when APP is swapped back, I don't need to do anything. Now it seems preview is not working after task swapped back from Start.
Here are the APIs I am using
_mediaCapture.StartRecordToStorageFileAsync(_profile, _recordStorageFile);
capturePreview.Source = App._mediaCapture;
_mediaCapture.StartPreviewAsync();
The issue you're hitting here has to do with the fact that as long as the debugger is attached, suspending/resuming won't work like it will once your app is running on its own.
See here: https://msdn.microsoft.com/en-us/library/windows/apps/hh974425.aspx
Try the same thing you're doing right now, except press the Suspend button in VS once your app is in the background. To bring it back, press the Resume button. Alternatively, try the same thing without the debugger attached.
As long as you're handling the Suspending/Resuming events correctly, MediaCapture lifecycle won't be a problem.
To learn more, have a look at the UniversalCameraSample on the Microsoft github repository: http://aka.ms/2015builduniversalcamerasample. It targets Windows 10, but a lot still applies to 8.1.
There are three events you can register for.
CoreWindow.Activated will be raised when you are no longer the foreground app. This can happen because the user switched away, or because something like a Reminder or Phone Call popped up on top, etc. Simply getting a toast notification does not raise the Activated event.
CoreWindow.VisibilityChanged will be raised when you are no longer visible. This happens when the user switches away, locks the phone, etc.
CoreApplication.Suspending will be raised when you are being suspended. The system doesn't suspend you immediately when the user switches away (in case they switch back quickly, eg they had accidentally hit the Start button). Instead it waits a few seconds before raising this event.

How to write an app that does not open a window in Windows Phone

I want to write an app that just manipulates the content of it's own tile and then silently terminates.
How do I get rid of any default window and splash screen?
Thanks!
You cannot do this fully. Tapping the tile will always launch the app so there will always be a context switch even if it exits immediately.
The closest you can get is to write a Silverlight app and not include a SplashScreenImage.jpg file. When the app starts up immediately exit by calling Application.Terminate (Runtime apps always show their splash screens while loading, but splash screens are optional for Silverlight apps).
This isn't recommended and is likely to confuse your users. A better design would be to let the app launch and do something useful such as displaying more information about what is on the tile or letting the user know what changes are being made.
As Romasz says, this may not pass certification. See Windows and Windows Phone Store Policies for the certification requirements. I suspect an immediate exit with no reason given will appear as and be treated as an app crash.

Windows Phone 8.0 Coded UI test

Hi I am having trouble creating a Coded UI Test for a Windows Phone 8.0 application and would be grateful for some help.
Environment: Windows 8.1, Visual Studio 2013, and working with a Windows Phone App for Windows Phone 8.0.
I can start an emulator and deploy the application to the emulator.
I have added a new Coded UI Test project to the VS 2013 solution.
The Coded UI Test Builder is started.
I click the Start Recording button.
I click a button in the deployed application's UI, and see Click 'Input Capture Window' client displayed above the Coded UI Test Builder window.
I click the Pause Recording button.
I click the Generate Code button.
At this point, I hope and expect that code will be generated for this simple test without any problems.
Actually what happens is that an exception is displayed in a dialog box:
Type 'Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException' in Assembly 'Microsoft.VisualStudio.TestTools.UITest.Extension,Version 12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f1d50a3a' is not marked as serializable.
I have seen this problem occur on two different Windows 8.1 machines and have tried googling to see if there is a solution to this, but have not found anything so far.
Thanks for any help, Martin
WP 8.0 automation is not supported by coded ui test. As per msdn only WinRT-XAML based phone apps (which were added in WP 8.1) are supported by coded ui test for phone.

Windows Phone 8 App Failed Certification

I recently submitted a very simple app to the WP app store that is basically buttons that play sounds on click.
However, the app failed certification for the following reason(s):
Comments: Result: Fail
The application terminates unexpectedly in response to user input.
Steps to Reproduce:
Play music from music+videos hub and Launch the application.
Tap on any option from MY APPS NAME HERE.
Notice the application unexpectedly terminates.
Comments: Result: Fail
The application terminates unexpectedly in response to user input.
Steps to reproduce:
Play music on the device from the Music + Videos Hub.
Launch the application.
Press the device's universal volume control.
Select "Pause" from the device's universal volume control.
Notice the application unexpectedly terminates.*
My questions are:
What is "the device's universal volume control" ?
How can I stop these errors from happening?
I used Blend to assign a sound to the buttons so there is no code to work with as far as I can see.
I've written similar apps for the Android market and always use a 'stop' and 'release' for each mediaplayer element at the beginning of each button's code. I'm assuming I need something similar here but not sure how to go about it in WP8. Any ideas?
Unviersal volume control refers to the phone physical volume buttons.
Did you have AdMod ads in your app? Recently i found an app with the same behavior failing certification and it was caused by AdMob control doesn't working right when the volume buttons show the volume popup over the app.
If you follow this link, you can see a workaround:
https://groups.google.com/forum/#!topic/google-admob-ads-sdk/vw61ZdJALYo
Hope this helps.

How to resume WP8 apps by click app icon again

I am writing a C++ DirectX application without XAML for Windows Phone 8.
first I use win key or long press back key to hang the app.
and then click the icon , the app will restart not resume.
same as
lots of games in store and the default template cube DirectX sample app.
but Gameloft's game Asphalt 7, when i click the icon, it resume the game
(it resume without loading , so I am sure that it is resumed ,it is not restated)
how can resume the apps by click icon.
and another question, how could I declare my apps as a game
(it will be listed in "XBOX GAME").
I used to think it will be declared when submitting. but when I tested a lot xap file, I find that it is declared in xap file,not a information defined in app store.
You can achieve this by implementing "fast app resume". You can read about this on MSDN here.
The question about game categorization has been covered before at How to make an app appear in games (xbox) section of wp 7/8.