develop "custom maps" offine no roaming charge - android

Firstly I am new to the site and new to android development
I want to design a tour of a local town that would run on android mobile phone. Its a historical tour so I want to to use my own custom map to represent the period and use GPS to figure out where the person is.
As it is for tourists who more than likely are roaming I do not want to connect to the internet. I have figured out that this rules Google maps and overlaying a customer map on it.
I'd be very grateful if someone could direct me to an alternative solution. A few pointers to put me on the right path would be great

You may want to check out Osmdroid which is a map library for OpenStreetMap data. if you really want your own custom map then it is possible with osmdroid but I have no experiance of it. A simpler solution would be to use the OSM data and contribute any updated you need to the map of your area to get it good enough for you. You do have the option of having static map data with Osmdroid so you can use it ofline.
There are a number of other libraries but Osmdroid is the one I use and am farmiliar with.

When using Eclipse, in the DDMS perspective, make sure the correct device (propably emulator-any ) is selected and highlighted. Only then will you get the logcat output in the logcat view.
Also, the Android plugin is a bit quircky, and sometimes only shows the last line in the logcat view. If this happens, try to clear the log. After that, you should get all the log entries again

Related

Create a custom map using an image with pins that can be filtered. Xamarin Android

I am wanting to add a map to an app I have created that has pin overlays that can be filtered using checkboxes and a search option that can be used to search for a specific location on the map.
I will not be using google maps for this.
For example, a custom image of a map (say for a campus or a shopping mall etc) that is laid out into a grid (A-Z for lat + 1-26 for lon). I want to have a few different pins laid out around the map and be able to filter them on or off using check boxes. I also want to have a few locations that can be searched for on the map. There is not necessarily going to be any need for the user to be able to add a custom pin onto the map on their device at this point.
I honestly have no idea where to start here as I have not been able to find any real documentation that seems relevant to what I am trying to achieve here. I am fairly new to apps, and my current app that I want to add this into has been made with Xamarin Android for Visual Studio 2017.
I have been reading about imageMap but it seems that it needs to load information from an external source, but I am unsure. I need the app/map to run properly offline so I want to have the image packaged in with the resources so it can be installed to the device with the app.
I would greatly appreciate any tips or idea's that any of you more experienced and skilled app dev guru's may have for me.

MapBox Find terrain class by coordinates in Android

I spent several hours looking for simple solution and still haven't found one.
MapBox style editor uses this simple feature. That you can hover and click over map, and it shows small popup stating all terrain classes you enabled in your map.
Question, how to do it in Android version of MapBox given I have installed my style. Now I want click on any place in the map and get the same popup stating, for example, that this is building, woods, background here. Or other place would satte, that this is major road.
This IS doable as MapBox studio itself shows. i can't believe it uses some API not available for anyone, as this is one API no map provider gives, while still able correctly draw terrain. What so complex to add this API?
And NO I am not interested in address. I am interested exactly on terrain, for simple task - distinguiosh water from non-water, road from non-road, building, from non-building, don't care where it is by address, so reverse geolocation does not work. Or simpler - I need SIMPLER geolocation, than address.
Your questions kind of confusing but I'll try and help. If I'm reading correctly, you are trying to create an Android app that uses an API similar to Mapbox Studio that allows the user to select/distinguish the difference between objects on the map such as buildings, water, forest, etc.
If this is the case, then first you must understand that Mapbox Studio is using OpenStreetMap data to distinguish between objects. These objects are stored in a database with tags. It's tough to explain so i'll just leave a brief reading wiki page that might help.
To my knowledge, there isn't any API's specific to Android that will give you the kind of information you're looking for. However, if I was in your dilemma I'd take a look at the Overpass API as it's a complex query tool that allows you to send coordinates to it and it will return all the tags (such as building or water) at that location within a JSON object. From there you can parse and use the data in your app. It is very powerful so I suggest reading up on how to use it and test using a website called Overpass Turbo, that's if you decide to use it.
Nevertheless, I hope this helps and I understood your question correctly.

Alternative(To Google Maps) Open Source Map API that provides a database of nodes and Arcs on roads

I need a Map API for Android that can provide me with indexed nodes and indices that make up the road network. The main idea is to determine if two GPS devices are on the same road. Thank you in advance
A Map API by itself will not have that information. Anyway, you can get it from OpenStreetMap freely. You can download it from here.
I don't understand from your question if you intend on displaying the results on a map. If so, and you want a nice and free map API, I would suggest Leaflet. It's not as mature as the likes of OpenLayers but, as you've tagged this post with "android", Leaflet just kicks ass in the mobile department.
OpenStreetMap is definitely a good source of data for this kind of project. Unlike google maps, it gives developers access to the underlying vector data of a map (fully open). This allows interesting new use cases which simply are not possible with google maps, and something involving geometric calculations like this would definitely fit into that category. You either need OpenStreetMap or some other source of "vector" map data, and beyond OpenStreetMap this can be expensive.
Unfortunately that's not the full answer to your question. You still have a lot of work to do to use the data in the way you intend. You need to calculate the proximity of two points (GPS readings from two devices?) to nearby roads, and figure out which road the point lies closest to. It's the kind of powerful geo calculation you might do using a GIS package such as QGIS or a functions of a geo-aware database system PostGIS.
But that's not the answer to your question, because you need to do these calculations on device. I'm not aware of an off-the-shelf library to do this on android. I think you would have to roll your own.
But another challenge is to get the vector data onto the device in a suitable format in the first place, and this is the first thing to solve. You'd want the vector data either as a large download for a whole country, or perhaps a smaller area, perhaps with an on-the-fly download feature within this app. Whole countries are not infeasible when working with maps in vector form (ever tried the awesome MayDroyd app?), but require some compact formatting. Happily some of these problems are starting to be solved in open source off-the-shelf libraries. You could try to build on top of MapsForge for example.
So then you're back to the challenge of writing on-device code to poke around in this data and do the calculations you want to do. I suppose it could be rather good if projects like MapsForge included generic PostGIS style geo-functions to make this easier. Something to ask the mapsforge developers about perhaps.

How to let Android users search for closest points of interest created by me on Google Maps?

I want to mark historical 'points of interest' across the globe on a mapping solution such as Google Maps (or something else).
I'll be getting an Android app created in which I want to be able to provide the users the ability to search for and locate the nearest such 'point of interests' around their current location.
Should I be using Google Maps or something else like OSM?
How should I be marking them on Google or elsewhere?
(a) I want to be able to mark these places with pictures as well and
(b) I want to store them at my end in a generic format as well, just in case!
How should the Android app search for the closest such points?
As I understand, Google Maps can show its own map overlaid with my data when I provide a KML file (http://code.google.com/apis/kml/documentation/kmlSearch.html). Can that be shown "within an Android app"? (ie, I know it can be shown on a webpage, but can it be shown in a native app?)
I will suggest google maps. Reason is google maps is updated often and part
of the maps from osm is not as latest.
Probably store this marking in your own datastore called point_of_interest.
The info window is also a special kind of overlay for displaying content
(usually text or images) within a popup balloon on top of a map at a given
location. read here for more information.
your android app should detect current user location and send the information
such as latitude and longitude to your server. Hence the query to search
for point of interest is done by the server and process the data and send
back to user android app. For example, the query would be something like
select * from point_of_interest where distance < 10km limit 5;
yes, read this link
Ok, for an app I built for a customer, we had a similar requirement. Basically, I needed to display the locations of interest withing 200miles of my current location. The way this worked for me was that I took my current location and made a Web Services call to their servers where they did the Geographic calculation and returned a list of results to me.
I would have the Android app just use the MapView and then user Overlays to display icons on the map. The problem with displaying the items using kml is that they will not be clickable by the user so their will be no interactivity. If you do choose to do it with kml, there is some example code located in this project: https://github.com/sunlightlabs/congress
I prefer google maps. Google maps SDK looks good and the sdk performs well. I don't know a SDK that has something like a OSMMapView that offers the same performance and features like google maps does (please correct me). But OSM can be as visual appealing as google maps. Cloudmade has tons of different styles for OSM data.
If you want to display maps by google, you have to use the Maps Library that ships with the Android SDK.
You can display any Views on top of the google maps. I.e. use mapviewballoons on github.
If you have lots of POIs that you want to display you should definitely persist you data with a spatial index. So that nearest neighbour searches are fast. One solution would be to use sqlite R*Trees. I did not use them on android and they work not out of the box you have to build sqlite-android yourself (see this question). Or use Perst, or ...
If you have few data, that fits into the phone memory you can use a Quadtree. This would be even faster than the db when searching it. You will find lots of examples when you google it. You could store the data as xml, json or even serialize the whole quadtree with the java Serializable interface.
There are tons of possibillities this question is way too broad. Some random ideas:
Create a server that responds to bounding box searches over HTTP and store the POIs in a Quadtree.
Deliver all your POIs with the app. As database, xml, json or a serialized Quadtree.
I don't have experience with kml on Android.

Android Google Maps Maritime charts layers

I'm looking at displaying a map within my Android app that presents maritime charts, and also needs to work offline as there will be no network connectivity of any type available. I suspect that I will get my maritime charts supplied as a series of bitmap files with LAT/LON references of the area clipped.
My question is this - how do I go about implementing this ? I guess I have to add them as a layer somehow, can someone show me how to do this ?
Also, as the device will be offline, will there be a problem trying to use Google maps even if all the content is held locally, will the API just "not work" until it has connectivity ?
Thanks in advance.
As this just earned Tumbleweed, I thought I should update it.
I tried really hard to use the Maps API offline, with my bitmap as a layer - it didn't work out. The API is too reliant on the interweb and just seems to timeout when trying just about anything.
Simple solution, I have just extended the ImageView class to display my bitmap chart & overlays.

Categories

Resources