forum for navit navigation tool
It is currently 30 Nov 2021, 12:14
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  [ 2 posts ] 
Author Message
 Post subject: Eclipse
PostPosted: 14 Nov 2015, 19:51 

Joined: 27 Sep 2014, 23:41
Posts: 17
I've managed to import Navit into Eclipse by executing the steps at This works well for C code – I can use Eclipse features such as jumping to the declaration of a variable or function, or display the call hierarchy. I can also build native versions of Navit from Eclipse and run them.

However, none of this works for the Android Java code. Not only do I have to go without features such as finding declarations, showing call hierarchies or basic syntax check – coding becomes a pain because every time I type a dot, I get an error message because the file is not on the build path of a Java project.

Anyone have an idea what I can do to get the usual Eclipse Java features for the Java portion of the code? Preferably in a way that doesn't pollute the source tree? Being able to build the APK from Eclipse isn't necessarily a requirement.

 Post subject: Re: Eclipse
PostPosted: 14 Nov 2015, 23:57 

Joined: 27 Sep 2014, 23:41
Posts: 17
I think I've found a way:

In the workspace which already has your project, add a new Android application project.

Choose "Navit" as the app name, give it a project name of your choice (I went for navit-android, as the other project is called navit-linux) and enter "org.navitproject.navit" as the package name. Choose the SDK versions (currently Navit requires at least SDK 7 and targets SDK 19. Build with an SDK of your choice. The theme is "Holo Dark".

On the next page, uncheck the options to create a custom launcher icon and activity. Make sure the project is going to be created in the workspace. Then click Finish. It may take a while for your project to be created.

Now go to your new project and delete its src folder.

Then add a new folder: Select your new project's root folder as its parent folder. Name the new folder src. Click Advanced and choose Linked Folder. Browse to the navit/android/src folder in your source directory.

Et voilà! Be sure to open Java files from your Android project (not the Linux one), and all those nifty syntax features will work again. Note, though, that you'll still have to resort to the good ol' command line to build for Android.

Potential further enhancements to this setup (untested so far) would be to ditch the libs and res folders which Eclipse has created for you and link to the source tree instead, as we did for src. Furthermore, we might replace AndroidManifest.xml with a link to its counterpart in your Android cmake build dir.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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:  
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