Detect windows phone call click - html

I have tried giving dialUp dial Up
This works fine in android phones but doesnot work in Windows.
Any work around for this. I tried onclick.
Even That doesnt work

There is no embedded "Call Button" in Windows Phones. If you mean to trigger Phone Call task, which will call a number/person, here's how:
PhoneCallTask phoneCallTask = new PhoneCallTask();
phoneCallTask.PhoneNumber = "123456789";
phoneCallTask.DisplayName = "TestNumber";
phoneCallTask.Show();

Related

Adobe AIR bring to front - activate() not working

I have an adobe desktop AIR app. When I send some data with a local connection, I want the app in front of all the other windows with focus on it.
I tested on a brand new air app with just this code:
import flash.display.NativeWindow;
var window:NativeWindow = stage.nativeWindow;
var aspa = setInterval (activateWin,8000);
function activateWin (){
trace("Activate window");
window.activate();
clearInterval(aspa);
}
And nothing happens. While if I write:
window.alwaysInFront=true;
window.alwaysInFront=false;
It brings the app to the front, but this command gives no focus to the window.
If I add
NativeApplication.nativeApplication.activate(stage.nativeWindow);
This makes the status bar icon blink, but still no focus or front action.
Reading this page, it seems it should work.
Am I missing something?
I've just use
window.activate();
window.alwaysInFront = true;
window.alwaysInFront = false;
and it's works fine on windows and mac os

When using React-native, why does my iPhone or emulator hang with a white screen unless Chrome Debugging is on?

When running an app using react-native 0.4.4, I see that the app will hang the iOS emulator or the phone unless Chrome Debugging is turned on. Does anyone have an idea what is going on?
I'm not getting any errors at all on Chrome when I open it. I have noticed that the "sample" React-native app doesn't have any problems when running without Chrome, so it seems like it's something within my own code, but I have no idea what!
I took the react-native example code and started adding code from my existing project to it one file at a time until I found the offending line.
Here it is:
render: function () {
let buttonStyle = styles.disabledLgButton;
let buttonTextStyle = styles.disabledLgButtonText;
if (this.state.submitEnabled) {
buttonStyle = styles.activeLgButton;
buttonTextStyle = styles.activeLgButtonText;
}
It took me a while to figure it out, even when I was staring at the code that was breaking things.
I have gotten into the bad(?) habit of using certain ecmascript 6 features such as let. Chrome will deal with let without any difficulty, but the JavaScript engine on the phone chokes. As soon as I changed those let lines to var, the phone was happy rendering on its own without Chrome's help.

Share Target and JumpListItemBackgroundConverter

I've added the Share Target declaration to my app for the data format WebLink and everything works as expected. However, when I add a JumpListItemBackgroundConverter or JumpListItemForegroundConverter anywhere in the app, the app hangs on the splash screen when you enter the app using the Share from IE. No exception, no crash, the debugger doesn't even stop. All I get is a cryptic error in the output window, "The program '...' has exited with code -1073741819 (0xc0000005) 'Access violation'." The documentation for those converters say they're fine with universal apps, just that they've been moved to a different namespace. Has anyone been able to get these two things to work in the same app? If so, where did I go wrong? Or is there something better than those two converters to get the LongListSelector look and feel?
Steps to reproduce:
Create a new universal app. I chose hub.
Add a share target of format WebLink to the appxmanifest declarations.
Add a new page to point the share contract to.
Add the OnShareTargetActivated code to app.xaml.cs to open the new page. See code below
Add a JumpListItemBackgroundConverter to the resources of the main page of the app. You don't need to apply it to anything, just declaring it is enough to break the sharing.
Go to IE and share a link. It should hang on the splash screen.
Code for app.xaml.cs:
protected override async void OnShareTargetActivated(ShareTargetActivatedEventArgs args)
{
// Replace SharePage with the name of the share target page
var rootFrame = new Frame();
rootFrame.Navigate(typeof(SharePage), args.ShareOperation);
Window.Current.Content = rootFrame;
Window.Current.Activate();
}
It turns out this is a bug in the emulator. It works if you test on a physical device.
MSDN Forum - JumpListItemBackgroundConverter and Share Target in Windows Phone 8.1

Showing m.bing.com in the WP8 WebBrowser control

I'm having a problem getting bing.com to load in a WebBrowser control on Windows Phone 8. It seems that doing that will launch the WP8 Search App (same as pressing the Search button on the phone). The problem is, once you click a result in that search app, it doesn't take you back to your original app - it goes to IE to show the result. This isn't going to work for me and seems to be a massive flaw (IMO) in the WebBrowser behavior.
There does seem to be a few apps out there that have succeeded in being able to show bing.com without launching the phone's search app - for example Image Downloader Free. There was another one, but I can't remember what it was...
After some research, I've found that the WebBrowser_Navigating event gets fired 3 times when going to bing.com: first request to the user-entered URL (www.bing.com), it then gets redirected to http://wp.m.bing.com/?mid=10006, then it redirects to bing://home/?mid=10006.
Preventing it from forwarding to the Bing search app is quite simple, just add this to the Navigating event:
e.Cancel = (e.Uri.Scheme == "bing");
The problem is, it then only shows the Bing search page place holder which says "Bing Search" and has a link that says "Back to Bing search" which does nothing (it would typically relaunch the Bing Search app).
I have a few thoughts, but I'm not sure how feasible they are.
In the WP8 WebBrowser control, is it possible to fake the User Agent?
Can one of the items in the WebBrowser.Uri.Flags property be removed or added to affect the way Bing.com handles the request?
If none of those work, I can simply create a dummy page on my web server, redirect all bing.com requests to it, and have it grab the m.bing.com front page with a card-coded user-agent. I really would like to avoid having to do this option though. From an End-User perspective, they would never know, but I just added a whole new layer of overhead, maintenance and resource-wise.
If you're interested, attached are the diff's for the EventArgs object between the 3 requests that occur in the WebBrowser.Navigating event:
Request 1 (bing.com) -> Request 2 (forwarded to wp.m.bing.com/?mid=10006)
Request 2 (forwarded to wp.m.bing.com/?mid=10006) -> Request 3 (forwarded to bing://home/?mid=10006)
tl;dr Does anyone know of a way to prevent www.bing.com from causing the search app to launch in the WebBrowser control in my application?
Thank you!
I don't know if there's a better way to handle this, but I found a solution. I haven't gotten it to work perfectly when the back button is clicked, so I will update my answer if/when I found a more solid solution. I still think this is a big flaw in the WebBrowser control in WP8.
Here is the code:
private bool _customHeaderRequest = false;
private void MainBrowser_Navigating(object sender, NavigatingEventArgs e)
{
string host = e.Uri.Host.ToLowerInvariant().Trim();
if ((host == "bing.com" || host.EndsWith(".bing.com")) && !_customHeaderRequest)
{
e.Cancel = true;
Dispatcher.BeginInvoke(() =>
MainBrowser.Navigate(e.Uri, null,
"User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; NOKIA; Lumia 710)\r\n"));
_customHeaderRequest = true;
return;
}
_customHeaderRequest = false;
}
private void MainBrowser_Navigated(object sender, NavigationEventArgs e)
{
_customHeaderRequest = false;
}
I don't have access to my emulator, but I tried it on my phone, and:
The redirect doesn't happen when you "Prefer desktop version" and open m.bing.com. Warning: The mobile version isn't very pretty.
Try disabling scripts on your WebBrowser, that could stop the redirect from happening.
Any chance you could just use Google?

How to make phone numbers into clickable links in Windows Phone?

In Android development, I'm able to use the Linkify object to transform a phone number into a clickable link that will present the phone's dialler to the user.
Is this possible with Windows Phone? If so, how can I make a phone number into a clickable link?
PhoneCallTask MSDN
What you could do is make a textblock that looks clickable. Then on its click event launch the PhoneCallTask
PhoneCallTask pct = new PhoneCallTask();
pct.PhoneNumber = "1112223333";
pct.Show();
I think you are trying to apply a style to a text which is detected to be a number?
If i guest what are you trying to do, then create a style for your text and do this:
if (var something == phonenumber) //think of a logic to detect that
{
something.Style = (Style)this.Resources["YourStyleKey"];
}