Windows Phone 8 ShellTile TargetUri - windows-phone-8

One Quick Question:
I want to navigate to settings(cellular..) from an secondary livetitle.
The Problem is the targetUrl for the Shelltitle(selectedShortcutsMenuControl.TargetUrl) in my app looks like this: "cellular",
and thats not an valid Uri format.
Exception : "An exception of type 'System.UriFormatException' occurred
in System.ni.dll but was not handled in user code"
StandardTileData data = new StandardTileData();
data.Title = selectedShortcutsMenuControl.Title;
data.BackgroundImage = myUri;
ShellTile.Create(new Uri(selectedShortcutsMenuControl.TargetUrl,UriKind.RelativeOrAbsolute), data);
Is there a way to fix this or is there a way, to directly navigate to cellular Settings form the livetitle?
<ctl:MenuData x:Key="ShortcutsMenuControlData">
<ctl:MenuItemData Title="Cellular" TargetUrl="wifi" Image="/Images/Item-fc0d2405-5b0f-4f3d-ba3e-5b93fbfe2c44.png"/>
<ctl:MenuItemData Title="WiFi" TargetUrl="cellular" Image="/Images/Item-c9f6c2c7-44e1-4079-ad90-e31b8a59333e.png"/>
<ctl:MenuItemData Title="Airplain Mode" TargetUrl="plaine" Image="/Images/Item-10845593-26f7-485a-bef7-cf9b9b0cf9fe.png"/>
<ctl:MenuItemData Title="Bluetooth" TargetUrl="bluetooth" Image="/Images/Item-294e2b67-5534-43b3-ae4e-aecf180c9274.png"/>
</ctl:MenuData>

So inorder to navigate to the native phone settings you need to use the built in URI schemes.
They can be found on MSDN here
Specifically for the ones you are asking for the codes are
ms-settings-airplanemode: Launches the Airplane Mode Settings app.
ms-settings-cellular: Launches the Cellular Settings app.
ms-settings-bluetooth: Launches the Bluetooth Settings app.
ms-settings-wifi: Launches the Wi-Fi Settings app.
replace your target url's with these and it should work

Related

Unauthorized Access Exception when Creating an instance of SpeechSynthesizer in WP8.1 Emulator

I was trying to recreate the simle Text to Speech example used on the MSDN website. However whenever the code came to create the instance of the SpeechSynthesizer class it failed with a Unauthorised Acception error when running on the WP8.1 emulator. I currently do not have an actual device to test on to see if this makes a difference.
My code was simply:
private async void TTS()
{
// The media object for controlling and playing audio.
MediaElement mediaElement = new MediaElement();
// The object for controlling the speech synthesis engine (voice).
var synth = new Windows.Media.SpeechSynthesis.SpeechSynthesizer();
// Generate the audio stream from plain text.
SpeechSynthesisStream stream = await synth.SynthesizeTextToStreamAsync("Hello World");
// Send the stream to the media object.
mediaElement.SetSource(stream, stream.ContentType);
mediaElement.Play();
}
I know there was an issue with the SpeechSynthesizer in Windows 8.1, and I found solutions to this when looking to fix the problem, but found little about the problem with WP8.1 SpeechSynthesizer. Has anybody else came across this problem and found a fix?
You should add one DeviceCapability in Package.appxmanifest file:
In DeviceCapability Tab, check the microphone, because it will provides access to the microphone’s audio feed, which allows the app to record audio from connected microphones.
Look at this library: App capability declarations (Windows Runtime apps)

Flash UrlLoader - prevent or suppress authentication dialog box

I have a rssfeed application made in Adobe AIR. It uses the UrlLoader to read the feeds. I need the application to never prompt the user to enter password for a website or accept a certificate of a website if is no longer valid. I prefer to have it fail instead.
I have setup the event listeners for IO+Error and Security_ERROR but that is not enough
Sample urls(this may not work in future)
http://www.dawnanddrew.com/rss2.xml (asks for user and pass atm)
I had another issue with a feed that even if it was a http url the website redirected the loader to https and then the certificate validation failed and the user was asked to accept the certificate. I need this to fail (I mark failed feeds and the user can check them when they want to find the issue and fix them or remove them)
Using AIR (which you are), you can actually tell the application to NOT handle authentication.
var request:URLRequest =new URLRequest("http://www.dawnanddrew.com/rss2.xml");
request.authenticate = false; //default is true, so you need to tell your request to not handle authentication
Then it will fail with an IO error instead of prompting for credentials.
Documentation
Note however, this will only work in AIR and is not a supported property for flash player.
You cannot do it this way. Now, the server returns specific status and the browser reacts to it by showing you a login dialog box. You cannot do this directly in flash and you cannot get default login button. You need to implement this by your own. The perfect way to do so is to check (server side) if the user is logged in and if not - return status ok (200) with an error message (let's say JSON). This specific message would be read by the flash client and a login screen would be shown (custom made). You will also need to implement the login feature by yourself :)
Sorry for the bad news, but this is the way it is with flash.

Windows Phone Custom URI

in my windows phone 8 application i am using custom uri association to launch another application through my phone.
i.e
await Windows.System.Launcher.LaunchUriAsync(new Uri("sixtag:"));
but my app is not able to get certified for store because of this. the testing team tells that you app terminates unexpectedly while executing this.
now, i don't know how to deal with this.
is there any way to throw exception if the app which i am launching is not installed on phone ?
or i should try something else so my task gets accomplished and app gets certified for store as well.
You do not need to wrap your launch in try/catch or check for success as described in the other answers. As soon as you call LaunchUriAsync, the platform takes over and will automatically handle the possibility of no app being installed by asking the user if she wishes to search in the store.
A couple of things to double-check:
1) Ensure that you can successfully back into your app following the navigation to sixtag.
2) Ensure that your call to LaunchUriAsync is the direct result of a user action (eg. tapping a button)
try
{
await Windows.System.Launcher.LaunchUriAsync(new Uri("sixtag:"));
}
catch
{
MessageBox.Show("please install Sixtag from the app store","AppMissing", MessageBoxButton.OK);
}
you can perhaps display another button and on clicking directly navigate to the app store. See if this solves your problem. Do vote it up if it does :)
You are needed to handle that as shown here . Also Read out Remarks given there.

WindowsPhone 8 (A jump to another application

WindowsPhone 8 (A jump to another application
)
I want to in my applications to invoke other applications, the application I don't know any news, just know the name, how do I use
. Await the Windows System. The Launcher. LaunchUriAsync (new Uri (" wechat: "));
"Wechat" should be placed here called program I want to use
First you have to write the following protocol in the WMAppManifest.xml under the Extensions tag. Thereafter you can launch your app from any other apps with the specified protocol name using Launcher.LaunchUriAsync method.
<Protocol Name="webchat" NavUriFragment="LaunchUri=%s" TaskID="_Default"/>
For further clarification you can refer the below link.
http://msdn.microsoft.com/en-in/library/windowsphone/develop/jj206987(v=vs.105).aspx

FaceboookDesktop user stays logged in after I call FaceboookDesktop.logout

Having the same issue as this user
As3 Graph API Logout
and this user
Facebook Kiosk Logout
Using the AS3 FacebookDesktop SDK for an AIR desktop based kiosk application
http://facebook-actionscript-api.googlecode.com/svn/release/current/docs/com/facebook/graph/FacebookDesktop.html
I can login, upload successfully.
Additionally when I call
FacebookDesktop.logout(handleLogout, APP_ORIGIN)
the response object returned in handleLogout = success
I have also defined APP_ORIGIN to = the same url associated with my APP_ID.
and set FacebookDesktop.manageSession = false
The problem is the user stays logged in after I upload and I need to log them out automatically after each upload.
This solution suggests targeting logout.php passing the ACCESS TOKEN.
https://stackoverflow.com/questions/7771821/log-out-from-facebook
But I don't have an access token, only a user ID.
Can anyone suggest a solution that works with an AIR desktop application?
see this thread
https://code.google.com/p/facebook-actionscript-api/issues/detail?id=206
'I had this problem and i solved using this workaround, you have to
download the source code of the 1.7 dist. Then open the
FacebookDesktop.as file and look for the logout function (not the
static one), then find the value 'params.next =
"http://static.ak.fbcdn.net/connect/xd_proxy.php#origin="+(appOrigin?appOrigin:"")'
and change it to 'params.next = "http://www.facebook.com/"'.