Difference between revisions of "Eclipse"

From Navit's Wiki
Jump to: navigation, search
(Doing Navit/Android development with Eclipse INCOMPLETE)
Line 41: Line 41:
  
 
== Doing Navit/Android development with Eclipse '''INCOMPLETE''' ==
 
== Doing Navit/Android development with Eclipse '''INCOMPLETE''' ==
 +
This guide assumes you already have the source downloaded locally, and have already [[Navit_SVN_installation_on_Linux#CMake|built a package for Android using CMake]].
 +
* Download Eclipse
 +
** http://www.eclipse.org/downloads/
 +
** Eclipse Classic is fine
  
You'll need an Eclipse installation with JDT plug-in. Plug-in itself can be downloaded from the Help->Install new software. Use the Programming Languages subcategory of the Indigo repository. Please be patient if you see a "Pending" message instead of available packages list.
+
* Install Eclipse
 +
** Unzip to directory of your choice
 +
** Start Eclipse by going into your ''eclipse'' folder, and running '''eclipse'''
 +
** Setup a new workspace when prompted
  
Then install ADT plug-in as described at http://developer.android.com/sdk/eclipse-adt.html.
+
* Setup JDT plug-in
 +
** ''Help -> Install new software''
 +
** ''Work with'': from the dropdown box, select ''Indigo - http://download.eclipse.org/releases/indigo''
 +
** Wait!
 +
** Select ''Eclipse Java Development Tools''
 +
** ''Next''
 +
** ''Finish''
 +
** ''Restart''
  
Now start a new Android project/Create project from existing source, browse to location of AndroidManifest.xml in navit/android/ folder of your CMAKE build directory tree.
+
* Install ADT plugin
 +
** Use Google's instructions at http://developer.android.com/sdk/eclipse-adt.html#downloading
 +
** Then follow the instructions at http://developer.android.com/sdk/eclipse-adt.html#configuring
  
Use build target Android 2.2. You'll get a warning about minSDKVersion being 3, ignore it. If you specify lower target version, you'll get a error on android:installLocation.
+
* Import Navit
 
+
** ''File -> New -> Project...''
In Project Properties, on Libraries tab of 'Java build path' subpage, click "Add JARs" and select TTS_library_stub.jar from libs subfolder of the project. Java Compiler subpage of Project properties, select Compiler compliance level of 1.6 (default 1.5 is too low because of @Override changes for generics adopted in 1.6).
+
** ''Android -> Android Project''
 +
** ''Next''
 +
** ''Project Name:'' -> ''NavitProject''
 +
** ''Create project from existing source''
 +
** ''Location:'' browse to the directory ''navit/android/'' '''within''' your [[Navit_SVN_installation_on_Linux#CMake|cmake build directory]].
 +
** ''Next''
 +
** ''Build Target'' -> check ''Android 2.2''
 +
** ''Next''
 +
** ''Finish''
 +
** ''Project -> Properties''
 +
** ''Java Build Path'' from left hand window
 +
** ''Libraries'' tab
 +
** ''Add JARs''
 +
** ''NavitProject -> libs -> TTS_library_stub.jar''. ''OK''
 +
** ''Java Compiler'' from left hand window
 +
** ''Apply'' on message window
 +
** ''Compiler compliance level:'' -> '''1.6'''
 +
** ''OK''
 +
** ''Yes''
  
 
And then the project should be clean of errors besides the only one stating that android_layout_default.xml is not well-formed. That's sad true. That file is indeed not an xml document but a fragment of one. ''Do we have some setting to switch this check off? Should we rename that file?''
 
And then the project should be clean of errors besides the only one stating that android_layout_default.xml is not well-formed. That's sad true. That file is indeed not an xml document but a fragment of one. ''Do we have some setting to switch this check off? Should we rename that file?''

Revision as of 23:52, 7 March 2012

Install latest eclipse version with at least cdt-c/c++ support 6.0.1/2

[1]

After first start choose your workspace


And and install the svn-plugin

german howto [2]

english howto [3]


Add and install the autotools-plugin

[4]

With eclipse 3.7(helios) linuxtools and autotools support can be install either from market menu or the software install menu.


Import existing and new svn co (unfornatly the svn wizard has some problems with the navit repo so we are doing in with file import)

checkout the project via commandline into your workspace folder

svn co https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit

make a new Project with File/New/Project

choose in the wizard c/c++ c-project

choose now GNU Autotools(if there is nothing under toolchains install autotools(autoconf,automake/gettext) via your os packagemanager) for Projektname choose the dir were you checked out the navit source eclipse will give a warning that the projectfolder exist ignore it and hit finish

eclipse will run the autogen.sh script and when its finished it should show Binaries and Archives, where you can run the navit exe


Doing Navit/Android development with Eclipse INCOMPLETE

This guide assumes you already have the source downloaded locally, and have already built a package for Android using CMake.

  • Install Eclipse
    • Unzip to directory of your choice
    • Start Eclipse by going into your eclipse folder, and running eclipse
    • Setup a new workspace when prompted
  • Import Navit
    • File -> New -> Project...
    • Android -> Android Project
    • Next
    • Project Name: -> NavitProject
    • Create project from existing source
    • Location: browse to the directory navit/android/ within your cmake build directory.
    • Next
    • Build Target -> check Android 2.2
    • Next
    • Finish
    • Project -> Properties
    • Java Build Path from left hand window
    • Libraries tab
    • Add JARs
    • NavitProject -> libs -> TTS_library_stub.jar. OK
    • Java Compiler from left hand window
    • Apply on message window
    • Compiler compliance level: -> 1.6
    • OK
    • Yes

And then the project should be clean of errors besides the only one stating that android_layout_default.xml is not well-formed. That's sad true. That file is indeed not an xml document but a fragment of one. Do we have some setting to switch this check off? Should we rename that file?