The Xamarin.Forms application I'm currently developing must send the user to a particular location, using any maps application he has installed.
I'd like to prompt the user to choose one of any maps application that he has installed (either native app - iOS Maps or Android Google Maps, or any other application, like Waze).
The Device.OpenUri(new Uri(request)); works fine but it just opens the native app, without showing available apps.
Is there a way I can do this?
There is no way in iOS to get list of applications that displays map.
However you can display your own list of application that supports displaying map using DisplayActionSheet()
then you can show or hide an application from that list by checking if application is installed on users device or not.
In iOS this can be done by CanOpenURL()
see documentation.
Example,
To check if google maps is installed or not you can do
UIApplication.SharedApplication.CanOpenUrl(new NSUrl("comgooglemaps://"));
to make it work you need to declare it in info.plist file like
<key>LSApplicationQueriesSchemes</key>
<array>
<string>comgooglemaps</string>
</array>
Related
I have developed a cross platform app using Phonegap (and some other technologies). Recently, we have made the switch to Xamarin, and are looking to find the equivalent of a feature we used in Phonegap.
In the phonegap build, we were using Cordova In App Browser.
We were able to open the map, phone, email, and web browsers of the users choice, pre-populated with locations, phone numbers, email addresses, and urls respectively.
This was a good solution because it enabled us to open these as the user would normally expect, and it worked on both platforms (iOS and android). This meant that on an Android device, if they were using a different browser or email client, it would open using whatever they had set to their default.
What is the Xamarin Forms equivalent of this?
Opening 'Phone' application with a number filled in
Opening 'Email' application with an email address filled in
Opening 'Web Browser' application to a specified URL
Thanks!
Consider using Xamarin Form's OpenUri() function for this. Here are some examples:
Device.OpenUri(new Uri(String.Format("tel:{0}", "+49000000")));
Device.OpenUri(new Uri(String.Format("sms:{0}", "+49000000")));
Device.OpenUri(new Uri(String.Format("mailto:{0}", "myCoolHotmail#hotmail.com")));
Is it possible to get a list of the installed apps which provide Map functionality?
In the maps settings menu, you can select which app should be the default one for voice navigation - in that list, my phone displays HereDrive+ and Windows Phone Maps.
How is it possible to search for apps like this? Is such API open or that list result was acquired using a restricted API?
Not a correct answer, but maybe the way you should use this is by using the ms-drive-to or ms-walk-to Uri scheme! When you use those, the phone itself will launch HERE drive if it is present, otherwise Bing maps!
My guess, in the future the user will be able so set this as an option, that he can indicate what default map app he wants to use in general. But for now it's default Bing or HERE if that is installed when using the given URI scheme.
Get the needed example code and usage on MSDN here: http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj710324(v=vs.105).aspx
There is no public API to list apps like this. The referenced settings menu is part of the OS not an exertion point for apps.
Apps are blocked from setting information like this from other apps or the OS.
Basically I want to achieve the same fucntionality which you normally see in android or ios devices. So if I click on login it should open facebook application(not webview) if facebook is installed but in case app is not installed it should open webview.
Currently it shows me a message do you want to search on store which I don't want.
Any help will be highly appreciated.
Thanks
Vinod
Windows Phone SDK only has the API to launch an app from another app which wouldn't work in your case since you would not be able to share session tokens.
Your best approach to achieving this would be to try out the third party Facebook SDK for .NET. Take a look at the Login API which seems to provide the ability to invoke the facebook application on the app and if not available would take the user to the store (LoginBehaviorApplicationOnly - Windows Phone 8.1).
I understand you would like to bring up the WebView if app isn't available but this SDK doesn't seem to have that functionality. You could contribute to the project or request a feature addition.
Hope this gives you a good start?
I want to create an app (for Windows runtime), that will get data about user preferences, history of downloaded apps and so on. I want to gather that data and analise it to create some kind of App Advisor.
So: Can I get data like installed apps or something of that sort?
Not that I know of from a Windows Store app. You can get some of it through Windows.Management.Deployment APIs, but those are restricted to full-trust processes and thus have to be used from a desktop/Win32 application.
I want to run a program in c# and try to access id of application run in android emulator. I have use Eneter Messaging Framework but it will not provide id of control. Anyone knows how to access control information in c# code when user clicks on any control in android emulator. I am beginner