Simple app to show map doesn't work android - android

I am doing online coursera class on android, and there is a simple application that is supposed to take a string for a location and show a map of where it is. I imported the maplocation project in android studio from this site https://github.com/aporter/coursera-android/tree/master/Examples/MapLocation, ran on the emulator, entered the address provided in the video and clicked "Show map" but there is nothing.
Screenshot:
In the error log it says:
06-30 18:14:55.317 2151-2151/course.examples.maplocation
E/MapLocation: android.content.ActivityNotFoundException: No Activity
found to handle Intent { act=android.intent.action.VIEW
dat=geo:0,0?q=washington+dc }
How do I resolve this? Why isn't an activity being started?

Since you are using an emulator, I have a suspicion that your emulator does not have an app installed that can view the coordinates. Try running the app on actual device instead. The emulator usually does not have Google Play Services installed and thus you probably don't have the Google Maps app installed on the emulator either. i.e. There is no app on the emulator that can open that location data.

Related

UTM values always not set

I'm trying to send some data from one app to another(not installed on device). I've started to use CampaignTrackingReceiver, but I have a strange issue.
When a user opens PlayStore, click install, then open app on devices with original Android OS(pixel, nexus) my UTM values(utm_source, utm_medium) have not set value.
BUT when I'm doing the same on samsung or xiaomi everything works. I'm getting my values from utm_source.
Why is it working like this?
I was thinking that link can be shortened, but I cannot check this

MS Graph can't open a new browser activity when Chrome is disabled/deleted of device

I have developed a xamarin form app that it uses MS Graph in order to user sign in. I have used samples of GitHub that open a new browser activity where user sign in and then the app goes to home activity. It works correctly. But some users have blocked or deleted Chrome app in order to use MS Edge as default browser, and then when app tries to start the browser activity, it launches an error because it can’t find chrome activity. I have asked on MS Graph GitHub (https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/242 ) but they and I are thinking that it isn’t problem of SDK but I don’t know how I could fix it. How should I fix it in order to work with any installed browser?
Thank you
It is done by design. The Microsoft Identity Client library uses Custom Chrome tabs and does not have any fallback strategy to run using a WebView.
You are probably encountering this exception thrown when it doesn't find Chrome installed: https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/dev/src/Microsoft.Identity.Client/Platforms/Android/AuthenticationActivity.cs#L131
string chromePackageWithCustomTabSupport = GetChromePackageWithCustomTabSupport(ApplicationContext);
if (string.IsNullOrEmpty(chromePackageWithCustomTabSupport))
{
string chromePackage = GetChromePackage();
if (string.IsNullOrEmpty(chromePackage))
{
throw new MsalClientException(MsalClientException.ChromeNotInstalledError,
"Chrome is not installed on the device, cannot proceed with authentication");
}
#Cheesebaron is correct, this is by design. Currently, Xamarin Android in MSAL can only launch chrome or chrome custom tabs. If the device doesn't have them, it will cause an exception, as you noted above.
#cansado2930 This part of the error message pkg=com.android.chrome means Chrome is not installed on the device.
Embedded webview support in MSAL will be an option in near future.
Here's a link to the issue in the MSAL repo.

geo:lat,lng uri does not work in phone gap

Im quite new to phone gap and mobile app development.
I want to use the geo: uri format to open the google maps application but it does not work.
From what I understand I should be able to just add a line like:
test
but when I click on the "test" link nothing happens. I created an apk and loaded it onto my device and in the console I get an error 404 not found error for the link geo:38.897096,-77.036545
I found comment that there needs to be an app on the device with the uri associated to the app. the Google Maps app is definitely installed on the device.
I can't find anywhere to set the association for geo: on the phone.
In my config.xml I have an intent line as:
<allow-intent href="geo:*" />
Questions:
Is there some setup in the phone gap app for the geo: uri to work ?
Is there some place on the device to set the association for geo: to
google maps
What am I missing here ? seems so simple. Google searching
indicates people have success - but not me.
regards
gmax
Well I did not find a fix for that method but I found a really simple solution to the actual problem - opening google maps app and get turn by turn instructions.
Two lines of code
var url = "http://maps.google.com/maps?saddr=&daddr=15 south st, tuncurry"
window.open(url, '_system');
works like a charm
saddr is the start address (leave it blank for current location)
daddr is the destination address
I hope this helps someone.

Open here map url from mobile

I'm developing hybrid application and want to access to HERE map url from any device (android / ios / windows phone / web)
I tried to follow this answer : Create URL to here.com
But It's not working in all cases.
In my case, i tried this url : https://www.here.com/directions/drive/start:48.85,2.35/end:52.51,13.38
Android without Here map app installed : open m.here.com -> ok
Android with Here map installed : open m.here.com but do not find app installed -> failed
iOS without Here map app installed : open m.here.com -> ok
iOS with Here map app installed : open m.here.com and ask if we want to use app installed, but if i click yes, app say me 'cannot find itinerary' -> failed
Windows Phone 10 without Here map app installed : ask me to install Here map app, if i say yes, redirect to store with no result (failed), if i say no, error page -> failed
Windows Phone 10 with Here map app installed : open app but say me 'cannot find itinerary' -> failed
Web : ok
I have more errors than success cases, so i can't use this kind of url.
Is there a different kind of URL that I can use to open m.here.com if there is no installed application, and launch application if it is installed?
(or open m.here.com in all cases at least)
The deeplinking developer guide has been recently made public, you could use that.
https://github.com/heremaps/map-linkbuilder-app
http://heremaps.github.io/map-linkbuilder-app/
So, try creating share urls
(You'll get something like this: https://share.here.com/r/52.51607,13.37699,Berlin%2C%20Germany/51.05364,13.74082,Dresden%2C%20Saxony%2C%20Germany?m=d&t=normal)

navigator.geolocation.getcurrentposition throws Timeout error

I'm developing a cordova application that find a particular retailer on the map near to the user's current GPS coordinates. I used the navigator.geolocation.getCurrentPosition to get the user's current position and use the Google Maps API v3 javascript to do a text search to find the retailer on the map.
I have the standard and recommended settings in both Android and iOS config files, it works find on iOS but not on Android. I exported the APK file and installed on Moto G, the application name is listed in Settings -> Location -> Current Location Requests but the browser still throws Timeout error.
Any ideas what could be wrong and why unable to detect the current position?
EDIT: To add more info, sometime the application opens up and stays blank without any timeout alerts.
You must add the geolocation plugin to your project using the following command. This sets the appropriate permissions in your platform config.xml file to allow the APK to speak with the OS:
cordova plugin add org.apache.cordova.geolocation
More: http://docs.phonegap.com/en/3.2.0/cordova_geolocation_geolocation.md.html

Categories

Resources