简体   繁体   中英

I want to make an Android app with a map that provides directions, but not Google Maps

I want to make an Android App that loads a map that I have created of the inside of a building. I want it to provide directions between one room to another. And between floors if possible.

I would like the map to be zoomable, and clickable too. ie you can click where you are, and where you want to go, and the app will provide the directions. OR you enter into text boxes what room you are at, and where you want to go, and again, directions are provided.

I did stumble across something that allowed you to use an open source map and add your own nodes to each corner, or place of reference. But I can not find the site any more, after an hour of Google searching.

Does anyone have any idea how I could do this?

This is one of them instances where the idea sounds simple but really is not. There are many tasks you need to resolve, some already talked about.

1) How to model the office. This needs to be done so that it is easy for you to model but the file is small. It has to be in a format that your path finding algorithm can understand. This means as you develop the path finding you will be making changes to the data.

2) Location finding / input. Done by hardware (gps will not cut it) or user says where they are. Could be done with NFC and tags placed around in the office, not an ideal solution, the tags have to be visible. The user could input their location but they may be lost and not know where they are.

3) How to present the data, you could write a magical 3D app showing a mission impossible building layout. That will be six months work in it self! Remember, your map is in 3D, road maps tend to be 2D. (with some fly overs...)

4) Progress tracking. The app really needs to know how you are doing so if you go off the route it'll tell you to go back. This again will be hard to achieve indoors. Progress tracking is one area that PND (Personal Navigation Device) manufactures spend time on as it really effects user confidence in the software.

Having worked at TomTom all I can say you could be at this for years.

As this is a collage project could I suggest a simpler project?

Do it with 2D map, simple grid based map a bit like the classic mouse in a maze problem. Implement A* for the path finding. Once done you could then if you have time extend it for your original plan.

A book I have found very good in the past is "Programming Game AI by example". ISBN 1-55622-078-2. Chapter 8 is all about path finding and has a very nice part on A*.

Good luck. :)

While this may not be the answer you are looking for:

You could always write an app that does this. If you are already willing to position the nodes on the map, you could hypothetically write a program that uses a (primarily used) game pathing algorithm, such as A*, and figure out a route from there. It would be tricky, but I would think that by placing Nodes and vector-mapping them with a cost associated with the vectors (maybe measured in feet/meters or something like that), you might be able to set that up with A*...

Hard to say. I tried a quick Google and came up empty as well.

You can create a MapActivity which can then house a MapView ( MapView can not be embedded in any other Activity ), which is an honest to goodness interactive map, but it's not exactly full featured.

MapView is mainly meant to display a map of a specific area with custom overlays on it. You can set the focus of the map, the zoom level, if it displays traffic data, and a few other minor options. But beyond that, you'd have to construct the overlay of the route your self. And there's no sort of turn by turn direction functionality or anything. They are just "dumb" overlays.

Google DID however recently update the Google Maps app to include indoor maps & navigation. They provide a site that you can go to and submit a floor plan of your building, so it can be added to the official app.

Once your floor plan is officially added, you could just launch the official app to do your navigation for you using an Intent like this:

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
Uri.parse("http://maps.google.com/maps?saddr=20.344,34.34&daddr=20.5666,45.345"));
startActivity(intent);

I had exactly faced the same sort of issue during my Masters project. However, my solution isn't really complete but this is how I planned it. I anyhow couldn't implement it fully due to various restrictions. This might sound complex but I'm not really sure how to put it across.

  1. Store maps statically and not dynamically - what I mean is, pictures/photos popping up when someone wants to go from one room to another or one floor to another. Dynamic routing is a bit difficult. Have pictures stored before hand so that they pop up.

  2. Devise shortest path algorithm something like Dijkstra's algorithm. You'll get ready-made java programs for the execution of this algorithm. Using this, you can obtain routes. Once the map is available, making it clickable and adding zooming options shouldn't be much of a problem.

Combine both steps somehow (sorry, no code here 'cuz I myself couldn't come up with one). As Richard says above, I had NFC in my mind to implement it (my entire project was based on this). NFC is basically an RFID technology and hence wireless. You can use 802.11 b/g/n for implementing the network side of it. If you need some more help, please let me know. Will help how much ever I can.

All the best.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM