iam a newbie for this kind of development. im trying to create an android application which involves GPS tracking. i am using Nutiteq because i have to use openstreetmap as the default map. please help me.
What do you mean by GPS tracking? If it is showing GPS location on map, then Nutiteq sample project (https://github.com/nutiteq/hellomap3d/) has several samples:
a) Simpler HelloMap3D demo has line-based animated GPS display, this is easier to use
b) AnimatedLocationActivity in AdvancedMap3D shows OpenGL-based animation for more advanced requirements
If you want to save locations and show tracks as lines or points, then you need a bit extra work. I would save data to Spatialite database. Same hellomap3d project has Spatialite layer for viewing, but there is also SpatialLiteDbHelper.java which has method insertSpatiaLiteGeom() which enables to save data persistently to the database, this is something you need to implement in your app. For viewing lines and points there is existing sample code: see VectorFileMapActivity.java.
GPS tracks tend to become long and slow to render. For this there is special method to simplify data: use something like in VectorFileMapActivity:
dataSource.setAutoSimplify(2, metrics.widthPixels);
This tells that line data (it does not apply to points) will be simplified based on map zoom, while after zoom in you will see full data (for smaller map area). This will enable to show GPS trakcs if you have many of them visible with thousands of points.
The Open GPS Tracker project uses open street map. Have a glance on their sources.
Related
I would like to map a building (one from my University) and navigate through it using just the phone.
No wifi/gps/bluetooth. I will give the coordinates of my starting position by taping the screen or something similar (I can also use the user feedback for detecting the floor).
What should I use to create the actual map of the building (floor map)?
Could you give me some starting points/resources or describe how you would accomplish this task?
I've got suggestions that I should use openGL https://www3.ntu.edu.sg/home/ehchua/programming/android/Android_3D.html Or maybe JOSM but I don't know if it can be ported to Android and used for mobile navigation afterwards.
Is there a simpler way? What should I use instead?
What would be the next steps after creating the map? Should I consider developing the code for navigation by myself? Any starting points here as well or similar projects?
What should I use to create the actual map of the building (floor map)?
Does the map need to be dynamic? If not, you could simply draw the floor map and display on the screen the image with your position on top.
Is there a simpler way? What should I use instead?
Following your description I think the best solution would be using magnetic localization.
Basically you would read Earth's magnetic field with the corresponding sensor and navigate the place with said data.
There are third party services that provide this kind of computation, like IndoorAtlas. You can use their android SDK and set up the navigation system by uploading a map of the building and running an initial mapping of the magnetic readings with your phone.
I am trying to use Mapbox mobile SDK to shows my information.
I just confused for How to select a POI on map,
Here is my problem:
I am using my style map, which had been combined my data inside. I wish to show the detail of the POI point by touch the point.
I have implemented this feature on my website version.
Now, I want to apply this feature on my mobile version.
and I have no idea that how to select a POI point from the map....
anyone can help me to workout It, please???
Also, my POI points are over 600000+. It is not possible to query a GEOJSON from a server. Especially, I have got so many points, and the GEOJSON file is extremely large than any other project (800MB). I can not make the POI like a simple "Annotation".
You should be able to use query feature at to get the selected GeoJSON marker and add additional information. Check out this indoor map example that i'm currently working on. I add a GeoJSON source to the map and have an onMapClickListener. Inside of it I query the GeoJSON layer to determine which room the user selected. You should be able to do the same with a circle layer.
This features coming in both the next Android 4.2.0 and iOS releases (you can use the Android beta.3 for now). For more examples check out the Demo app. Let me know if I need to clarify anything.
Alongside with my friends I am about to develop an android application. The application will use maps a lot, finding routes, placing markers, drawing predefined routes, stuff like that.
There is this Google Maps APIv2. So I tried it, write some code and looks good. I am able to place markers and draw polylines, however my application will have some predefined routes. One route is set of LatLng points. So I just add these points to PolylineOptions and add it to map. Great, it works.
But these predefined routes will be created in web-based application also using Google Maps APIv2 or similar api/library. Some streets are not straight they are curved so you need to create a lot of LatLng points to get it look nice which is very important. I can do this but I want to put only two LatLng points - at the beginning of the street and at the end.
Here is the image:
On the left, route has only two LatLng points (red dots) and that is desired shape of line. On the right same route with 2 LatLng points gives me route coloured in light blue, and this is what actually happens if I just add polyline to GoogleMap object. In order to create same effect as in left image, I need to create many LatLng (red dots) points which is not appropriate for those who will create these routes. So this leads us to routing problem which can be solved by using Google Directions API. Which solves the problem of drawing routes with less markers. Basically what I understood, this API for directions actually creates a lot of these LatLng points that I draw using for-each loop as seen on right part of picture above. And I need to contact Google Web Service for this so I need to have Internet connection - and this is the problem.
Sometimes internet will not be available hence I need some alternative solution. I've heard of Open Street Maps, but I am not sure how to use it and does it needs internet connection for creating these routes.
Is there any free library that offers offline routing and showing maps offline? Basically all map interactions must be done without use of internet.
But it is understandable if internet connection is needed only for the first run of application as it is needed for Google Maps APIv2, well application crashes until I turn on internet, after which any next run I do not need internet..
A web based application will be made for creating these routes and routes will be created by users for whom we develop this application. And as users can be very annoying they will demand some user-friendly and easy interface for creating routes. Telling them that they need to create 100 to 500 points for each route, and if there is 60-70 routes they will gladly say NO to our application.
Any advice? If it is possible, I can write my own routing algorithm for Google Maps to work offline, I am very skilful at "Algorithms and Data Structures" - any guides/tutorials for this? But I guess this map is just set of tiles, and does not have necessary information for finding route.... So please correct If I am mistaken for anything.
You can use the Scout SDK (provides a free usage quota) as it offers full offline maps, routing & navigation.
Have a look into the open source projects GraphHopper, Mapsforge and OpenScience-VTM which can do routing and/or maps offline. And all use OpenStreetMap data. Other projects exists of course, have a look here and here.
Also have a look into the GraphHopper map matching component which could be interesting for your specific use case and can work offline too.
(Note I'm the author of GraphHopper)
If it is possible, I can write my own routing algorithm for Google Maps to work offline
No you can't, the data is not open nor you can buy the data to my knowledge.
Another option is OsmAnd. The OSM wiki also has some information about OsmAnd and even more information about OSM on Android in general as well as pages about rendering and routing.
As far as I understood, Vuforia is a good starting point for developing AR-Applications on the Android Plattform.
The Docs for Simple Virtual Buttons are quite good, but how would one combine this with location based data?
For Example:
On the application level, both markers and location based data should be used; so one would need f.e. Vuforia and another component for integrating location based data.
To get a deeper insight of what should be possible, here is an example:
You go through a landscape were the phone can
1.) recognize its position and view location based points on the screen and
2.) recognize objects in your view and perform actions upon "touching" those (virtual buttons, I learned..)
So my final question is:
Do you know examples of frameworks or demo-apps, where such a task is being accomplished by tying Vuforia together with location based AR Product/Framework XYZ?
Please excuse me, If I am not as precise as needed-I searched SO, but (as far as I saw) there are no such questions already.
for location based AR like wikitude Layar etc who draw poi based on location on camera view you have to get poi from different Api like openstreet ,twitter,etc after parsing and put these data on cameraview. sensor values and gps values are used.
to start with you can go through Mixare code which is open source .
you can implement this code with Vuforia cameraview.
follow my ans here for details. Gud luck
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.