launching windows phone via browser - windows-phone

i am new to windows phone app development. i have downloaded a sample from the url http://code.msdn.microsoft.com/wpapps/Association-Launching-535d2cec
i have tried below :
when i paste alsdkcs://helloworld in IE browser running on windows 8 desktop, the app is launching.
but when i paste the same in IE running on windows phone 8,the app is not launching instead its says unsupported address.

Hell... I got the answer. It's working if I call via javascript
function loadwindowsphone() {
window.location =
`enter code here` 'alsdkcs://hd';
} <input id="btnwindowsphone" type="button" class="button" name="" value="open windows phone" onclick="javascript:loadwindowsphone();" /><br /><br />
function loadwindowsphone() {
window.location = 'alsdkcs://hd';
}

WP8 IE result in "Unsupported address" error message : IE only treat URL as HTTP/HTTPS URL, not check against the custom URL scheme list like iOS Safari.
If you want check, you can use UC browser or others.

Related

How can I get the email body with a mobile Add-In

I'm working on a mobile extension point for my Add-In.
I want to get the HTML contents of an email, from a taskpane.
On the desktop version of the Add-In, I call Office.context.mailbox.item.body.getAsync() from the taskpane javascript file, which works fine.
However, on the outlook mobile app for android, Office.context.mailbox.item.body is an empty object. Office.context.mailbox.item seems to have all the context about the conversation but not about the actual email.
How can I get the HTML body of the email from mobile?
For accessing body on Outlook Android, you will have to use Office.context.mailbox.item.body.getAsync(). Please find same snippet below:
Office.context.mailbox.item.body.getAsync("text",
function (asyncResult) {
if (asyncResult.status == "failed") {
console.log("Action failed with error: " + asyncResult.error.message);
} else {
console.log(asyncResult.value);
}
}
);

Forced to browser-sniff Safari version

Can someone tell me the "best" way to detect Safari and then its version number?
Look, I don't want to do it but I can't find a way to pin down a WORKING version of speechSynthesis on Safari
See below for an example that works on iOS 7.1.2 IF you don't add the onEnd listener. Apart from that everything is peachy.
In my real world full blown example it talks but still won't deliver the at end event.
On iOS 8 there is no issue.
Please offer a best-of-breed agent/version sniffer or a better working-feature-detector.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function fini()
{
alert("end");
}
function talk()
{
if (!('speechSynthesis' in window)) {
alert("Unsupported browser");
return;
}
alert("Getting ready.");
var utterance = "Hello World";
var chat = new SpeechSynthesisUtterance(utterance);
chat.addEventListener('end', fini, false);
speechSynthesis.speak(chat);
}
</script>
</head>
<body>
<p>On Safari this example won't fire any known events<br />
onend, onerror, even onended: -</p>
<input type="button" value="Talk" onclick="talk()" />
<br /><br />
No probs on Chrome or Opera. Spewin!
</body>
</html>
For the record, the addEventListener was throwing an exception on 7.2.1 that could be trapped to signify unsupported speech synthesis.
Opera mobile has laryngitis
Different problem same topic: -
You (and I) may question the correctness of this behaviour in Opera but it appears to be as simple as there are no known/registered/available voices for Opera Mobile on my Android phone :-(
"Sing for me Christine! Sing my angel, SING!" Sorry couldn't help it.
So are there any files I have to download?
FYI on Safari, apparently, the speechSynthesis.getVoices method is synchronous which makes life easy. Elsewhere it is asynchronous and will return an array of length 0 on first call.
We need to register an event such as: -
speechSynthesis.onvoiceschanged = function() {
voices = window.speechSynthesis.getVoices();
alert("Voices " + voices.length);
if (!done) theWork();
};
This never fires on Opera Mobile. Curious!
Why don't I get a error from the synthesis specification like "language-unavailable" or "voice-unavailable"?
Because I didn't explicitly specify a language and a voice?
And why does Chrome deliver onvoiceschanged 3 times?

window.open addEventListener does not work on "Mobile Browser Simulator"

I'm using IBM Worklight 6.2
I'm using window.open to load some external pages for OAuth and I configure event listeners for the opened window.
var authWindow = window.open(authUrl, '_blank', 'location=yes');
authWindow.addEventListener('loaderror', function(e) {
console.log(">> load error. event: " + JSON.stringify(e));
});
also for "load" and "loadstart" events.
This works in Android and iOS but when I preview the app in the "Mobile Browser Simulator" the eventListeners are not executed.
I have also tested creating a "desktopbrowser" application.
Any idea?
Loaderror, loadstart, and loadstop are specific to Cordova and not supported in the Mobile Browser Simulator. It would be best to test these on emulator or device. Please see: http://cordova.apache.org/docs/en/3.0.0/cordova_inappbrowser_inappbrowser.md.html#addEventListener

Opening pdf files with the Trigger.io in-app browser?

I have a hybrid mobile app built on Trigger.io that opens links (some of them are user generated content) in the in-app child browser (forge.tabs module) per default. When trying to open a .pdf document the screen will stay blank white (tested on both Android and iOS).
Here is a cut down version of the code I'm using:
$(document).on('click', 'a', function() {
window.forge.tabs.open( $(this).attr('href') );
return false;
});
I would expect to either view the document in the in-app browser or be able to download it to the device.
Assuming your PDFs are local, you'll need to do a "getURL" first.
Here's a function that works just fine for me:
function showPDF (pdfName) {
forge.tools.getURL(pdfName, function (myPDF ) { forge.tabs.open(myPDF); });
}
Then just call showPDF with a relative or absolute url i.e.
<button class="btn" type="button" onclick="showPDF('assets/pdf/sample.pdf');">

DOJO 1.8 /dojo/request/iframe is deleting <form></form> when uploading a file

I'm seeing a really strange behavior under DOJO 1.8.0. I'm trying to asynchronously upload a file. The file is uploading just fine and I'm getting the payload as expected, but when clicking the submit button the tags and everything in between is inexplicably deleted! It just vanishes. (NOTE: I've isolated this testing to a test page, so there's nothing else at play that would account for it. You're looking at the entirety of the code.)
require(['dojox/form/Uploader',
"dojo/request/iframe",'dojo/dom','dojo/on',
'dojox/form/uploader/plugins/IFrame', 'dojo/domReady!'],
function(Uploader,iframe,dom,on){
on(dom.byId("myButton"), "click", function(){
iframe.post("UploadFile.php",{
form: dom.byId("myForm"),
handleAs: "json"
}).then(function(data){
console.log(data);
}, function(err){}
);
});
<form method="post" id="myForm" enctype="multipart/form-data" >
<input name="uploadedfile" type="file" data-dojo-type="dojox.form.Uploader"
label="Select Some Files" id="uploader" />
<input id="myButton" type="button" value="Submit" />
</form>
Any ideas from anyone with DOJO 1.8 experience? I've been using /dojo/io/iframe just fine with versions 1.6 thru 1.7. This started happening only with 1.8 using the new /dojo/request/iframe code.
See http://jsfiddle.net/seeds/XD4Dc/1/
The form element is set to have target of dojo's injected iframe. Then form gets like, 'dijitHidden' with abs position -1000 top/left. Cant see why tbh.
There's a fix in the fiddle, add to your callback:
with(dom.byId("myForm").style) {
position = "";
left = "";
top = "";
}
I took this issue to the DOJO-Interest group and it was found to be bug with DOJO 1.8.0. It'll be fixed with the upcoming 1.8.1 release.
http://bugs.dojotoolkit.org/ticket/15939
From the bug report:
The form wasn't getting "eaten", but rather the position was getting set on it and moved out of the viewport because of some faulty logic to check if the form was in the DOM. This has been fixed and should be in 1.8.1.