José Pablo Rodríguez Cuéllar

unread,
Apr 30, 2019, 4:44:47 PM4/30/19
to MIT App Inventor Forum
Hey, I have a school project, it involves entering an adress and opening it on a map, I used the 

Map It: Displaying Locations on a Google Map program that I found on the tutorials section of the web page, the thing is that I am using exactly the same codes and algorithms and the emulator shows an error, I have also tried to use the where is my car app to understand the working process of maps but it shows the same error. 

Any suggestions? How can I actually make this work???
plsss help. 

SteveJG

unread,
Apr 30, 2019, 4:59:38 PM4/30/19
to MIT App Inventor Forum
Hi Jose... what is wrong?

You are using " exactly the same codes and algorithms and the emulator shows an error, "

The big probability is you are using an emulator.  These tutorials use the LocationSensor component which does not work in the emulator because the emulator cannot emulate GPS hardware.
You got an error... what was the error?   Possibly Error 601: No corresponding activity was found.  

Also, if you downloaded the MapIt tutorial from the MIT tutorials, and compile the app and load it to a device you probably will see a different error.   See this Forum thread for that solution https://groups.google.com/forum/#!searchin/mitappinventortest/map$20it$20steve%7Csort:date/mitappinventortest/4yakXyv5sxM/9tQdmeNhBAAJ .


Does this help Jose?   Do you have an Android phone you can live develop with.   Use it and you should have a better result.

Regards,
Steve

José Pablo Rodríguez Cuéllar

unread,
Apr 30, 2019, 5:26:21 PM4/30/19
to MIT App Inventor Forum
Hey Steve thanks for the help, I have already tried on an android phone but it is still showing the same error...
Any other ideas?

SteveJG

unread,
Apr 30, 2019, 5:42:58 PM4/30/19
to MIT App Inventor Forum
Without knowing the error message you receive or seeing the Blocks you use, no one can help?   Sorry " already tried on an android phone but it is still showing the same error." is not helpful.  Did you try the tutorial with a downloaded aia or did you reproduce the Blocks?   Is the Location settings on your phone turned on in the phone's Settings.   You should see something like this:

LocationSettings.png


If you have that set, you might not be getting a GPS receiver signal because you are testing indoors or for other reasons (see   Using the Location Sensor   ). The tutorial at that link contains an explanation about how the LocationSensor and GPS works.  Try the two aia projects there; do they work?

You might post an image of the Blocks you tried here in the Forum.

José Pablo Rodríguez Cuéllar

unread,
Apr 30, 2019, 6:39:43 PM4/30/19
to MIT App Inventor Forum
sorry, the error it showed was Error 601: No corresponding activity was found.  if theres any way I can show you the blocks let me know and I can send them. thank you so much!

SteveJG

unread,
Apr 30, 2019, 6:59:14 PM4/30/19
to MIT App Inventor Forum
Post the Block image into your Forum Post.  Capture an image of all your Blocks by going to the Blocks screen, right-clicking on a white area and then selecting  Download Blocks as an Image   . Do that and  start a download of the Block image to your computer.   After you receive the download the downloaded png image should be in your Downloads folder), use the blue icon (to the left of the word Link) to attach your Blocks image into your post.(just drag the image into the space provided).










José Pablo Rodríguez Cuéllar

unread,
May 1, 2019, 12:28:50 AM5/1/19
to MIT App Inventor Forum
blocksfinalproject.png

José Pablo Rodríguez Cuéllar

unread,
May 1, 2019, 12:29:21 AM5/1/19
to MIT App Inventor Forum
Done. I hope I can make this work, this is 30% of my final grade LOL

SteveJG

unread,
May 1, 2019, 9:09:29 AM5/1/19
to MIT App Inventor Forum
Several possibilities Jose....

One link I provided offered this code snippet



You might add the last Block which your code does not have and see what happens.

Another potential issue is to substitute the following for what you have in  MyLocationButton   

LocationButton.PNG

and in you Screen2.Initialize  event handler perhaps set the ListPicker1.Enabled from  false    to   true

Make some changes.  What happens?




José Pablo Rodríguez Cuéllar

unread,
May 1, 2019, 3:21:15 PM5/1/19
to MIT App Inventor Forum
okay, I modified the things you told me to, the map still not working, is there a way to use the app inventor map but that it displays the address that is on the listpicker?? 
what other alternatives do I have if I need to display a map with a pin on the address that I log in?

SteveJG

unread,
May 1, 2019, 3:52:21 PM5/1/19
to MIT App Inventor Forum
You still have not explained what does not work Jose, only the error message.

Try the attached code.  Does it run in your device?  The issue could be a problem with your hard coded addresses not being recognized as addresses.
Try  entering and using     1600 Pennsylvania Ave.  Washington  D.C.    Do NOT uses commas (  ,   )   The example works here just fine.   Make sure it works, then type in one of YOUR hard coded addresses.  What the ActivityStarter attempts to do is show a Google Map using  intents ...

Google Maps Intents for Android | Maps URLs | Google Developers



If the example does notwork, what Android version is your device?


Alternatives:
Google Static  Maps API using a WebViewer ...there are examples in the Forum
MIT Maps component ... then you need to using the latitude and longitude of the street address that you figure out some how.

Latitude and Longitude from an address  :   what you will want to do is geocoding ...explained in these articles https://www.google.com/search?q=latitude+and+longitude+from+an+address&oq=latitude+and+longitude+from+an+address&aqs=chrome..69i57.11311j0j7&sourceid=chrome&ie=UTF-8  :   

MapIt_MIT example.aia

José Pablo Rodríguez Cuéllar

unread,
May 1, 2019, 5:38:30 PM5/1/19
to MIT App Inventor Forum
Steve, thank you so much for your help.
It finally worked, I think the problem was on the device and not in the code. 
Thanks for your time!
Reply all
Reply to author
Forward
0 new messages