Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Maps without internet

172 views
Skip to first unread message

István Pometkó

unread,
Nov 11, 2019, 3:52:41 PM11/11/19
to MIT App Inventor Forum
Hi Guy!

Please help me! I want to use offline maps. But i dont know how i use it. My app is dont use internet.
Thanx for yor help!


SteveJG

unread,
Nov 11, 2019, 5:46:40 PM11/11/19
to mitappinv...@googlegroups.com
Yes, you can display 'maps' without the Internet Istavan.   Could you please explain in more detail what you mean by "I  want to use offline maps. But i dont know how i use it"?

Where do you expect the map to come from?  A map you have, from Google or one you make yourself perhaps?    How do you want to use the map in your app?

1)  An image of a map can be displayed in an Image control.  Just show the map image in your app.

2) Use a 'Flat Map'    A flat map is an image of a map posted as the background of a Canvas that can be plotted to using your current position information captured from your device GPS receiver.  It uses the position information to plot your location when  using the LocationSensor.  The LocationSensor works with your GPS receiver without a network or wifi Internet connection to provide location coordinates.

Something similar might be done by creating a FeatureCollection using a tool like geojson.io .  How would that work?  I am not sure it could be done but it would be similar to what is explained in #3.

3) An OpenStreetMap can be displayed 'offline' at low tile resolution.  Use the Map component at lower resolution. This is simple to do but difficult to explain.  Run an app that uses the MIT map component once while connected to the Internet.  This will 'capture' low resolution Map tiles and cached them,  (store them within your app) as you display an area of interest while connected to the Internet.  Later, when you are not connected to the Internet, the low resolution tiles are available on subsequent runs of the app.

4) If you have manually downloaded 'offline' Google Maps to your Android sdcard, you might be able to view these using the Google Map api..  https://support.google.com/maps/answer/6291838?co=GENIE.Platform%3DAndroid&hl=en .  Will this work with App Inventor?   I am not sure how this would be done with App Inventor.  With the professional Android Studio compiler, it would be done like this https://stackoverflow.com/questions/16525822/offline-mode-for-android-app-using-the-google-maps-api  See the second link below about cautions when using an offline Google Map.


Which of these do you need help with? What do you expect?

Regards,
Steve


István Pometkó

unread,
Nov 12, 2019, 3:54:42 PM11/12/19
to MIT App Inventor Forum
Hello!
Thanks for the reply. I'll clarify the purpose. I want a GPS on a distance meter with a wifi enabled device. Represented on a map. The map must be embedded in the application. That was the question. It would be a good example to see how it works.
Thank you in advance for your reply!
Best regards,
István
 

SteveJG

unread,
Nov 12, 2019, 4:52:46 PM11/12/19
to MIT App Inventor Forum

OK, you want to use the GPS receiver and use the WIFI to access the actual map from the Internet.

MIT does not have a simple tutorial showing how to make your map.  Here is a simple way to do it using the MIT Map component

MapsObjectSimple.PNG

MapsSimpleLocation.png


I added a few Blocks to the aia (not shown in the image) that force the use of the GPS receiver and display a distance scale at the bottom of the map.   Is this what you want to do?
What have you tried?


Regards,
Steve

István Pometkó

unread,
Nov 13, 2019, 1:09:22 PM11/13/19
to MIT App Inventor Forum
No. I should use it without the Internet. The project includes a GPS receiver with a wifi module. In an area where internet is not available. For use without mobile internet. So there is only wifi connection between the two devices. Therefore, the application must include a map of a specific area. And no roads are not streets. A terrain map would be ideal.

SteveJG

unread,
Nov 13, 2019, 2:20:26 PM11/13/19
to MIT App Inventor Forum
You are not explaining what you want to do in sufficient detail.  When you say" I want a GPS on a distance meter with a wifi enabled device. Represented on a map. The map must be embedded in the application."  It says you will use WIFI (the Internet ).  You have a device that 'broadcasts' a wifi signal that has a map stored in it?   I have no idea what that is Istvan.

Did you read 

2) Use a 'Flat Map'    A flat map is an image of a map posted as the background of a Canvas that can be plotted to using your current position information captured from your device GPS receiver.  It uses the position information to plot your location when  using the LocationSensor.  The LocationSensor works with your GPS receiver without a network or wifi Internet connection to provide location coordinates. 

Download a map terrain map from somewhere as a png or jpg image.
Place the terrain map image into the background of a Canvas object.
'Calibrate' the coordinates of the map image coordinates (identify the coordinates of each corner)
Then do what the Flat Map tutorial says. Use the LocationSensor with your gps to plot coordinates onto your flat map.  The LocationSensor will work with your device GPS receiver without an Internet connection


There is no reason you should require a second device "there is only wifi connection between the two devices" (use two devices) .  The terrain map you get from somewhere can be stored in your Android device's Media files. Your cell phone has a gps receiver built in.  Why use "a GPS receiver with a wifi module."?  



I expect  the #2 advice would work for you. You just have to program the app.


István Pometkó

unread,
Nov 13, 2019, 3:22:37 PM11/13/19
to MIT App Inventor Forum
My english is so poor. This text is from google translater.
Maybe this is the trouble.
One android phone + other device (wifi module + gps module). I want to measure the distance between the two devices and map them on the phone display. The other device sends the coordinates and the phone measures its own position. The distance between the two can be calculated, but I should paint the other device own position on the device actual map.
But i don't know, how to use the flatmap. The other device and the phone connecting on wifi. The internet don't usable.
One example help me, how to use flatmap.

I send to you a picture, maybe help for you to understand.


procejt.jpg

SteveJG

unread,
Nov 13, 2019, 4:43:33 PM11/13/19
to MIT App Inventor Forum
A better description! :)  I understand a little of 7 languages well enough to read a newspaper but I still depend on Google Translate.  When I speak any of these, native speakers smile and start speaking English.

To get this to work as you describe, your transponder (the wifi module+gps) needs to be able to 'talk' to your phone and send it data.  I don't think the transponder can do that or rather, the phone can receive the data that way.

Problems
1)  Do you have a device that works as a WIFI hotspot and is already connected to a GPS?  I am not aware of anything that will do that. Can you tell me about what you have?

2) An Android can pass data between a BlueTooth device  and itself without issues.  I do not think it is possible to communicate between an Android and another device using WIFI.  Someone might correct me. If the phone and the transponder cannot communicate via wifi,  you cannot do what you would like to do with your  wifi module + gps module.   Is this wifi+gps transponder something like an Arduino module?

3) A flat map is imprecise; the maps on the Internet are fairly precise.  A flat map will not be as accurate for plotting gps positions as one on the Web.


What is possible? No Internet is a problem.
1) If your transponder were  Bluetooth+gps, the phone could communicate with it.

2) If two locations are known (your cell phone and your transponder locations) it is easy to calculate the distance between them.  There are several methods.  

3) If both locations are known on the phone, both locations can be drawn on a flat map and the separation calculated. The positions of the two locations are placed very accurately on OpenStreet Map or Google Map tiles when using the Internet.  If you plot the locations on a flat map instead, the location posted on the flat map is only approximate.  The location placement depends on map scaling from World coordinates to your map image coordinates on the Canvas.

"But i don't know, how to use the flat map."   Yes you do know , the information I posted earlier (#2)  might work for you and explains how.  Did you read the link? The coding is very complicated .  It is possible a flat map might not be suitable for what you want to do.  Are you surveying?  The flat map will not help you if there is not a way to get the gps coordinates from the transponder to your phone.

--Steve





István Pometkó

unread,
Nov 14, 2019, 1:18:45 PM11/14/19
to MIT App Inventor Forum
Hello!
The wifi connection is already resolved. Since Wi-Fi will be busy, mobile internet will not work. That's exactly my problem. I'll show you a link where you can see that a phone  and  module is communicating  via wifi. A gps module conected  to wifi module.



SteveJG

unread,
Nov 14, 2019, 4:11:18 PM11/14/19
to MIT App Inventor Forum
The way that works with that device uses this software >  https://play.google.com/store/apps/details?id=com.mightyit.gops.wificontroller&hl=en_US   .
This tutorial seems to show a way to build a similar controller with App Inventor 2    >   https://randomnerdtutorials.com/esp8266-controlled-with-android-app-mit-app-inventor/   There is a video and an aia file you can test

Will this example allow you to connect to your Android and do your Project?   I do not know.   Try the tutorial, if it can build an App Inventor app to control the device and to receive the GPS signals, you might be able to send location information from it to your Android without the Internet. 

István Pometkó

unread,
Nov 14, 2019, 4:16:44 PM11/14/19
to MIT App Inventor Forum
Thanx!

But my problem remains problem. :(
Reply all
Reply to author
Forward
0 new messages