Get location Address from given gps data

Hi,
the location sensor gives me the address of the current location.
Now the other way round: I have the gps datas: lat: 0,0925 long 28,956 (or other) and want to have the address of it.
How can I do it?

Horst

A forum search would have returned your answer.....

thanks.
i searched with the keywords from the title.. :smirk:

Hi,
I have a pair of gps data and want do make (WhereIsMyCar) to show me the place of these data.
It worked before.
I tried with https://www.google.de/maps/@51.52990,7.22643
But now it does not work any more.
What has changed? How can I do it?

I asked an other question before. A bit different. So has google changed this too?

Get location Address from given gps data

Horst

In which case, read the link that was provided:

You can do reverse geocoding with the google api, but you need an api key, and you need to set up a pricing plan and billing (there is potentially a cost) to do this. There are other reverse geocoding providers but you will also find they have pricing plans.

Moving this to your other topic.

Here is the same map inputting coordinates into my PC browser

What worked before? Where is My Car worked before or plotting on a Map worked? Show your Blocks and I might be able to help.
What does not work any more? The Where is My Car app or what?
Google continually changes (improves) it GoogleMap application. When you use the ActivityStarter in the app to display a map ActivityStarter commands Google Map (via an intent) to display a map.

Using the coordinates you provide, the following map is what I get using the following code:

asMapAndPin

If you run the above code, do you see what I see on my Android 8.1 tablet Horst? I circled the map pin that displays in green. The map is a map provided by the GoogleMap app on your device.

Please read Tim's post. You can only get the address 'the other way around' when you use the LocationSensor; sorry, you can not input the lat and long and get an address any other way using App Inventor Blocks.

I hope this extension will help you

http://kio4.com/appinventor/285C_extension_sensor_localizacion.htm

first thanks to all. That helped me.

  1. Getting the address I understood is not possible (without pay) It is not so important. I added the link to explain my need and what I have done.
  2. The link put in a browser shows my current position(maybe last shown position), not the position wanted. Using https://www.google.de/maps/@51.5299,7.22643,14z so with ,14z it works (?) in the broswer.
  3. So trying again with my app. First run it gaves me the right position. second run gives the last position on map. But sometimes it works. :upside_down_face:
  4. I tried in companion and app sometimes it works. :upside_down_face: :weary:
    Very confusing.
    now i made this (from SteveJG proposition)

    in companion: Button 1 worked; Button 2 gave last position on map
    in App: same result.
    Now back in my other app I made this:

    first call it shows the last position; second call: my location; third call: last position and so on. (When not going back from the browser to the blocks)

When the browser with maps is open and I ececute manually -sometimes it worked and doing again it does not work.

Sorry I cannot describe it good. It is confusing. Somtimes it worked and next time it refuses.
The same action!!
I suppose there is a basic feature, that I don't know.
:thinking:

I have a version of 'Where's My Car' that seems to be running correctly. You didn't share all your Blocks or an aia so I can only guess at your issues. :cry:

What worked? Your code using the local name or somewhere else? Please try to explain in more detail.

  1. I note you probably are not following the Where's My Car tutorial ... you modified it.
  2. I think Google made some changes to its api that causes some issues using intents. The ability to specify the zoom factor has disappeared when requesting a single map using the z intent script.
  3. The Google Map that results using the ActivityStarter today is slow to render compared to what I remember the response was to similar code once upon a time. If you quickly change from one set of coordinates to another; ActivityStarter seems to have issues refreshing. Google Maps seems to cache data and this seems to cause issues. Are you running the Where's my Car code simultaneously with your local name code without disabling the LocationSensor? Having your LS code running might be causing collisions
  4. your name local variable is a Problem (see # 1 below). Developers must change name to something meaningful (like lastcoordinates). Why? The compiler has issues when you do not rename name.
  5. Using a Label as a 'variable' instead of using a global variable can cause issues. It is not very good practice.
  6. Calling a Notifier is a bad idea. When I insert at Notifier prior to the ActivityStarter.StartActivity block, it slows the implementation. See # 2 below
  7. Using http://maps.google ..... might work. There are numerous ways to call the Google Map intents. I use what is shown in # 3. Have you tried using the exact code I suggested. It always seems to work for me. :slight_smile:
  8. using a LongClick and a Click in the same Button can cause issues and confusion. It can work. Suggest you test using separate Buttons for each version of code.

OK. That behavior is a possible indication there may be issues with Google's servers . I too notice strange behavior. As Google adds features to the mapping app, it may be creating unintended behavior. What do you mean 'execute manually'

If you continue to have issues using the AS to display a map, you could modify the tutorial to use MIT's Map and Navigate components. Using Map will allow you to avoid the problems you are experiencing. Yes, rebuilding your app might be a lot of reprogramming. :frowning:

Thank you.
I noticed, that I got into the old discussion. Sorry about that.

I didn't change something on the WhereIsMyCar App except adding these buttons.
Here are the files:
AndroidWheresMyCar_TEST.aia (7.2 KB)

Manually means not with the button but using do it command of the component.

But I think also that there may be a limit for requests on Maps or something special.
I try with the MapIt-MIT App to found something.

Tested your WheresMyCar aia. The basic app works fine when used with the Companion and WIFI. I did not test with a network connection on an Android 8.1. I added Button3 and repurposed Button2 as indicated in the image below.

The Blocks with green check marks work ALL the time! This is the example I provided earlier.
The Blocks with red x's never work reliable.
The Blocks with ? seem to work some of the time.


Notice that the working Blocks never reference Label1 and do not use it as a variable.

Perhaps someone else will test your aia and share the results.

Good luck. Your basic app works fine here, it is only your modifications that create issues.

Thank you Steve,

I changed the blocks to the given propositions with 4 buttons.
I wonder if the composition with join could give another result compared with the address in one string. But I see no difference
AndroidWheresMyCar_TEST.aia (7.6 KB)
But it does not work: The block with ..geo:.. does not work.
I tried the app on Galaxy S9, S5, S2 and Huawei 20.
1 und 3 (castle and Butembo) worked
2 and 4 Hospital and Tandandale worked not.


In block Button4 I erased the label.text block. That should make no difference and the result was the same. it didn't work.

So I will use version 1 and 3 for my app. But I fall back on my initial problem: Sometimes it does not work.
Append:
I tried the MapIt_MITApp: It worked.
Then I added two Buttons with the blocks form Button3 and Button4 from above.
Now I found this. Once you started one of these procedures, google.maps or geo.0,0?.... the other does not work anymore.
So I guess my problems are coming from that.
I do not know why, but my suggestion to this problem is, to use only one of the both ways. I think the way with geo.... is the best.
Thanks.

A link to MapIt tutorial for those who might be interested :slight_smile:

An alternative is to use the MIT Map component instead of the ActivityStarter to display your maps. The Map component always works to show a map at coordinates you supply. Good luck with your continuing Project.

Here is the mapIt Tutorial
http://appinventor.mit.edu/explore/displaying-maps
and the aia-file:
http://appinventor.mit.edu/explore/sites/all/files/ai2tutorials/mapIt/MapIt_MIT.aia

Thanks for the information about the Map-Component. I didn't saw it before. But for the region I want to use the app even Google Maps has to few informations.

Here are your coordinates in the Congo displayed on a version of MapIt that uses the Map component instead of Google Maps using the ActivityStarter.

.
OpenStreetMap tiles are fairly detailed, even in remote locations.:slight_smile:

Here is what you other coordinates displays

Yes. I will see how to get the satelite pic of the remote Tandandale in my app