open a google map with local database in my android application - android

i am creating an application in which i need to open the google map to show some nearby locations, the addresses are stored in my local DB.
can anybody suggest me what is the best way, or it will be very helpful if u share some demo code.

You might want to marshall your DB contents into a kml file and have the map view show that. This guy shows how to to do it in a previous post Adding a KML layer to an Android maps application

Related

How to connect Kml layer + Autocomplete in Kotlin Android?

I have a question about SDK Google maps in Android
I have a Autocomplete Place that works perfectly. When i write some text in the input, google show me locations, and when i click on any print coordinates.
Question:
Is there any way to know if those coordinates are in a polygon of a Google my maps kml file?
I tried:
KmlLayer(map,id for local file, context)
Documentation: https://developers.google.com/maps/documentation/android-sdk/utility/kml
The problem is that i need the local kml file on my local repository. I need to get KML file from URL with a map id (https://www.google.com/maps/d/u/0/viewer?mid=XXXXrsxRFHqpMEmYXXXXX)
That "mid", can change, since sometimes I will need to use another kml file with a different url.
Also, Autocomplete documentation: https://developers.google.com/maps/documentation/places/android-sdk/autocomplete
Thank you everyone.
Any help would be greatly appreciated! Thanks

How to access Offline Maps in Android

I was given a task where i need to build an offline map i have shape file and a kml file..
I found something about kml where i need to parse the data and overlay the data on the maps.but it should be done from scratch.If there any tutorial Please do help me for kml.
or
IS there any easy way to store the maps offline and use it in android. i see lot of things like tpk,.map etc
please do help i am struck with this from abt a week and dint find any clue how to do it..
tpk is basically doing the map with tile packages concept, whereas the other option involves using sqlite format compact cache. for more details, you can consult arcgis library at
http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#/Welcome_to_the_ArcGIS_Server_10_Help/009300000004000000/
and also this is for OSMdroid library
http://www.haakseth.com/?p=30. hope it will help you

how to make android app that has offline maps

i want to make a android app that already has the map tiles of a particular area in its apk and when the user installs the app he can see the map without having an internet connection in his phone. he should be able to see the map of that particular area offline. i have heard i could do this by osmdroid. but can i store actual Googlemaps (satellite view) with it.
Or is it possible to first store the png images of the map tiles of that particular area in your asset folder and then use it. if this is possible can you please tell me how to do this(i mean how to put tiles in asset folder and then display it using inputstream ). i am new to android. any help where to start from?
but can i store actual Googlemaps (satellite view) with it.
OSMDroid does not use Google Maps. There is no API in Maps V2 to cache tiles for offline use, at least not at the present time.
Or is it possible to first store the png images of the map tiles of that particular area in your asset folder and then use it.
You do not have Google Maps' map tiles as PNG images.
i am new to android. any help where to start from?
Use OSMDroid. Or, find some commercial mapping library that offers offline maps.

getting multiple marker coordinates in google map android

Hi to all the members of this great community!
This is my first question so forgive me for possible mistakes. I hope that from this day on i can be helpful for some of you as hopefully you will be for me.Getting to the question:
I am building an android app whose purpose is to search for nearest fuel-points and nearest care-repair-centers. I am very new to android and thx to the numerous posts about android in here I have managed to reach the point where i have build the map and animate it to my current location while updating my location.
Now i have to add the markers of the points of interest. Since they are at least 10 (I will add them only for demonstration purposes) i think it's not wise to add them through 10+ repetitive calls to itemizedOverlay.addOverlayItem(). My idea was to save them in a file in the format ( " latitude " , "longitude" , simple_description_title , other info ) and than in some way import the first 2 fields for the geopoint and the 3rd for the title.
I will use than the 4th later for some type of tooltip text (for example tel_number).
Do you think this is a good approach? And how can I implement the file reading(if) in the code that extends ItemizeOverlay().
I didn't post the code until this point since it's irrelevant.
Welcome to SO, let's jump right into your problem/question.
1.) Since you are only adding 10 points of interest it won't matter if you just call itemizedOverlay.addOverlayItem() for all 10 because the trick is to call itemizedOverlay.populate() only after you have added all the overlayItems using itemizedOverlay.addOverlayItem(), this way you don't compromise on performance.
2.) Now, once again, since you are only doing a demonstration I would advise you to simply hard-code all the 10 overlays with their respective geolocations into the Android code itself. This way you WON'T have to worry about reading data. Also, using a txt file to store data isn't the best option both performance and convenience wise. This is what databases exist for.
3.) If, and when you do this in the future, you do need to use some dynamic data to populate your markers with, then I'd STRONGLY advise you to use either
SQLite: The embedded database that Android offers, it's great for storing small bits of information that's required for your application such as description title, other info, the latitude, longitude, however, if you have some sort of a connection based application where you need to update globally accessible data every once in a while I'd advise you to use the next option,
MySQL: This is an online database that you have to interface with using a server and PHP. The advantage of using an online database is that you can now share information between different users (friends, contacts, followers etc.) by reading and writing to and from the database.

How to route on googlemap from csv file?

I want to development an application like this:
There is a csv file containing the coordinates as follow.
30.6674,36.8925
30.6651,36.8926
30.6649,36.8923
...
I want to route the way on google maps api by getting the coordinate information from csv file.
How do I do this, can you give sample link or any suggestion.
Thanks.
loading csv file content in an array:
http://www.webdeveloper.com/forum/showthread.php?t=225845
passing an array of addresses (or coordinates) to the API:
how to use the google maps api with greasemonkey to read a table of addresses and trace the route?
--- EDITED [28/10/2011] ---
here: Loading an array from a .txt file? (Android)
and here: https://stackoverflow.com/questions/5668507/trying-to-load-a-list-of-overlay-positions-from-file

Categories

Resources