navit-project.org

forum for navit navigation tool
It is currently 24 Jun 2017, 19:09
View unanswered posts | View active topics


All times are UTC


Forum rules


Feel free to ask anything here related to the development process - coding, creating new features, fixing bugs and custom changes of Navit.

Note: For reporting bugs, use the bug tracker.



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Using Navit in a Windows 8 application
PostPosted: 04 Nov 2013, 14:53 
Offline

Joined: 04 Nov 2013, 14:41
Posts: 3
Hello everyone,

I am new here and I have a few questions about how Navit can be used as part of an application.
I have created Windows 8 applications (specific to Windows 8, the ones you can find in the new Windows Store) in JavaScript, including one called Maps Pro that allow you to display a map, choose a basemap, display POIs, routing, GPS tracking and stuff like that. More information can be found here:
http://apps.microsoft.com/windows/en-GB ... c9a858a072

Many users asked me for more, basically a complete navigation software for their tablets, because there is no application which currently do that. Features would include:
  • Map display (including day / night styles and bird's view)
  • Routing both online and offline
  • Re-routing
  • Turn-by-turn instructions with text-to-speech if possible
  • ... and the basic features offered by navigation systems (speed, distance remaining, ...)

On Windows 8, you can develop with 2 stacks:
  • C/C++/C# and XAML for the interface
  • JavaScript and HTML / CSS for interface

So what I think would be best in my mind would be if I could use Navit as some kind of "code library", meaning that Navit is not the core of the app, just a part of it that i can query and use. Like i would need Navit to render the current map to an image I would display. Or instead of Navit trying to grab the GPS position, I could provide it because Windows 8 provides the API to grab the GPS position without having to decode NMEA. Or have "hooks" within Navit so that i can grab the curren route informations and display it in my application, instead of letting Navit handle it.

So, I have a few questions from here:
  • Has something similar already be done by the community (same usage, doesn't have to be the same context)?
  • Would it be hard or impossible to do? or require a very advanced knowledge of the Navit internals
  • Where should i begin ? :)

Update: Got a hint from "kamikaaze" on the IRC chat who told me to have a look at the Android port of Navit which does just that. From what I understood from the code, there is a wrapper around Navit, with a "bridge" that is called via JNI in Java Code.
There is a similar technique for Windows 8 apps that is called "Windows Runtime Component" that in theory would allow me to package some C code with a "bridge" (a public API) in C# or something that I could call from my application. More information on that in this tutorial for instance:
http://kishore1021.wordpress.com/2012/0 ... 8-c-metro/

I have to say that I am really new to C development, i know a lot more about ActionScript / JavaScript / Java but I am ready to learn.

I checked out the sources, including the Android bridge and I cannot figure out what Navit sources are compiled and when (using CMake?). Which source files do I need to compile for my usage? How do you do that exactly, is there a compilation step I need to take or can I just import what I need into Visual Studio that will understand the dependencies between the files? I believe i would need the same set of files that is used on Android but i haven't been able to understand how the Android part was compiled.

Thanks a lot for any help you can give me !
Fabien


Last edited by usul on 04 Nov 2013, 18:50, edited 1 time in total.
soft formating


 Profile  
 
 Post subject: Re: Using Navit in a Windows 8 application
PostPosted: 04 Nov 2013, 19:18 
Offline
User avatar

Joined: 07 Jun 2013, 09:32
Posts: 200
Location: Rostock, North Germany
Hi Fabien,
thanks for considering Navit as navigation engine and welcome to our community :)

As I'm no more up to date with the windows / win mobile / windows phone development, it's hard for me to say if it's possible to port Navit to this platform.
Usually as we mostly rely on pure C code, this seems to be possible, but maybe you have to define a new CMake target. I'm not the compiling expert here, but I guess this needs further investigations:
http://stackoverflow.com/questions/1749 ... figuration

The hint with Android is good, as it uses Navit also just as engine but implements an own UI and several other aspects around the binary:
https://wiki.navit-project.org/index.ph ... evelopment

I know that there had been some discussions about Windows8 and Windows Phone App Port before. We also recognized, that there will be legal problems to publish GPL apps at the Windows store:
http://osswatch.jiscinvolve.org/wp/2012 ... ows-store/
http://developers.slashdot.org/story/13 ... developers
Sadly I'm not a lawyer and I just know that even the VideoLan project has managed it in some way. IMHO it's worth to contact our maintainer user:cp15 via his offical business channel: www.it-schaller.de (but we had no contact for several months)

I'm not sure, but other Libs maybe in Java aren't an option, are they?
http://wiki.openstreetmap.org/wiki/Frameworks
http://wiki.openstreetmap.org/wiki/Rout ... ment-Tools


 Profile  
 
 Post subject: Re: Using Navit in a Windows 8 application
PostPosted: 04 Nov 2013, 20:18 
Offline

Joined: 04 Nov 2013, 14:41
Posts: 3
Thanks for your quick answer!

The links will help me thanks. Unfortunately, Java is out of the picture on Windows 8, too bad. I'm going to try and make progress on the compiling side


 Profile  
 
 Post subject: Re: Using Navit in a Windows 8 application
PostPosted: 06 Nov 2013, 16:16 
Offline

Joined: 23 Jun 2013, 20:15
Posts: 65
Location: Essen, Germany
A note on the legal side:

As Navit is licensed under GPL2, if you decide to use Navit's code, your app will have to be licensed under GPL2 as well.

From the link to apps.microsoft.com you posted, it does not look like your app is currently under GPL2. So you'll first have to decide whether you can/want to change your license (and provide the source code to your app).


 Profile  
 
 Post subject: Re: Using Navit in a Windows 8 application
PostPosted: 06 Nov 2013, 16:47 
Offline

Joined: 04 Nov 2013, 14:41
Posts: 3
Thanks,

Actually, I probably won't be using Navit. After a few nights trying to read the source code and trying to understand it, i realized i'm not good enough for this C stuff :).

Also, there is a lot of conditionnal code because of supporting many devices / OS and it makes the code very hard to read when you haven't been coding for Navit in the first place.
After trying the Android version and reading the forum posts / issues, it looks like Navit would have been only useful to me for rendering and offline access, which i believe I can trick with a lot less work or even require the user to be online at all time.

Anyway, good luck for this project :)

Fabien


 Profile  
 
 Post subject: Re: Using Navit in a Windows 8 application
PostPosted: 06 Nov 2013, 18:15 
Offline
User avatar

Joined: 07 Jun 2013, 09:32
Posts: 200
Location: Rostock, North Germany
Not a problem ;)

What you say is IMHO mostly true, as Navits design goal is cross plattform and is highly modular. And because Navit is pretty old and the dev team very small, there is a lot of work that needs to be done to compete with usability etc. with other commercial apps.

Anyway, hope you will find your way trough the OSM universe :)


 Profile  
 
 Post subject: Re: Using Navit in a Windows 8 application
PostPosted: 07 Nov 2013, 10:40 
Offline

Joined: 26 Sep 2013, 10:59
Posts: 50
I think, what's also impoprtant, that there are much more comments in the code. variables-names, not only 1 character long.My impress is, that thereare more longer variables-names now in the code. A good trend.


 Profile  
 
 Post subject: Re: Using Navit in a Windows 8 application
PostPosted: 08 Nov 2013, 11:34 
Offline

Joined: 23 Jun 2013, 20:15
Posts: 65
Location: Essen, Germany
Mapmapper wrote:
I think, what's also impoprtant, that there are much more comments in the code. variables-names, not only 1 character long.My impress is, that thereare more longer variables-names now in the code. A good trend.


Yes, there are some problems with maintainability. In addition to the points you mention, we also have many long methods and large code files :-).

I believe we are working on this. I have already renamed variables and split up long methods.

I only disagree a bit about the comments. We don't need more comments, we need code that is easy to understand. Ideally it should be understandably without comments. Of course if that is not possible, comments should be added, but sparingly.

Anyway, good luck with your project. And BTW, if you're looking for information on how to use OpenStreetMap maps, there's loads on info on http://wiki.openstreetmap.org/ , and you can ask questions on https://help.openstreetmap.org/ .


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Silver Orange 2.0.6 for IPB Designed by Skins and Hosting
Converted for phpBB3, based on Royal Blue template by BigB © 2007 2008 AEON KINGS