Android

From Navit's Wiki
Revision as of 21:00, 17 March 2010 by Akashihi (talk | contribs) (Added to ports category)
Jump to: navigation, search

Android Port (no root required)

  • Get the latest apk from http://download.navit-project.org/navit/android/svn/ Andoid.png and install it onto your device.
  • Get a map from http://maps.navit-project.org/download/ and put it on the root of your SD card (not into a subdirectory) as navitmap.bin. If you plan to install for a Samsung I7500 Galaxy, the easiest way to start will be to put the map file on the folder /sdcard (the root of the internal memory, because the memory of the SD card is mounted to /sdcard/sd).
  • If you like to configure the initial view of the map (it automatically centers around your position once there is a fix): extract navit.xml via unzip from the .apk file and copy it to the same directory as navitmap.bin, edit it and change the <navit center=... attribute to your home coordinates. See navit.xml below for possible problems.

If Navit doesn't work please include the output of "adb logcat" (via the sdk) or "logcat" (via terminal on the device) in your bug report.


Compiling it yourself

You need the Android NDK and SDK.

  • Extend PATH with $NDK/build/prebuilt/linux-x86/arm-eabi-4.2.1/bin:

$SDK/tools where $NDK and $SDK refers to the development kits.

  • Check out the newest svn version with svn co https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit
  • Run ./autogen.sh from the navit dir.
  • Run configure as ./configure PKG_CONFIG=arm-eabi-pkgconfig RANLIB=arm-eabi-ranlib AR=arm-eabi-ar CC="arm-eabi-gcc -L$NDK/build/platforms/android-1.5/arch-arm/usr/lib -L. -I$NDK/build/platforms/android-1.5/arch-arm/usr/include" CXX=arm-eabi-g++ --host=arm-eabi-linux_android --enable-avoid-float --enable-avoid-unaligned --enable-cache-size=20971520 --enable-svg2png-scaling=8,16,32,48,64,96 --enable-svg2png-scaling-nav=59 --enable-svg2png-scaling-flag=32 --with-xslts=android (once again replace $NDK with the appropriate path)
  • Run make
  • cd navit
  • Run make apk

The result is in android/bin as Navit-debug.apk

I had some problems with the prebuilded Android packages on the Samsung I7500 Galaxy. Navit crashes when the navigation starts. So i decided to compile it from source and detected some changes in the build process. The configure command was changed to:

./configure PKG_CONFIG=arm-eabi-pkgconfig RANLIB=arm-eabi-ranlib AR=arm-eabi-ar CC="arm-eabi-gcc -L$NDK/build/platforms/android-3/arch-arm/usr/lib -L. -I$NDK/build/platforms/android-3/arch-arm/usr/include" CXX=arm-eabi-g++ --host=arm-eabi-linux_android --enable-avoid-float --enable-avoid-unaligned --enable-cache-size=20971520 --enable-svg2png-scaling=8,16,32,48,64,96 --enable-svg2png-scaling-nav=59 --enable-svg2png-scaling-flag=32 --with-xslts=android --with-saxon=saxon-xslt (replace $NDK with the appropriate path)

You see the differences? The include- and library-path has changed. You must use android-3 instead of android-1.5. I used a Debian system for the build and Debian has the saxon-xslt program instead of saxon, provided by the libsaxon-java package. So you have to add the option --with-saxon=saxon-xslt. Finally you have to modify the file navit/navit/Makefile.am. Remove the saxon option -snone, because it does not exist anymore. After a make, cd navit, make apk and install to the Samsung I7500 Galaxy, i had a running Navit.

navit.xml

navit.xml is extracted from the apk into /data/data/org.navitproject.navit/share/navit.xml if it doesn't exist or is different from the one of the apk. You can copy it to /sdcard/navit.xml which is then used instead of the one from the data directory. Use at your own risk, it might be incompatible with future releases.

Debian on Android Port

Android is a smartphone platform built on the top of the Linux kernel. Current hacks allow gaining root access and installing a full-featured distribution such as Debian, alongside the Android software, running simultaneously on top of the same kernel.

Navit porting

Navit package built on 03/03/09 is available here http://pawlowicz.name/splot/phd/navit_0.1.0%2bsvn-2075_armel.deb

You have to configure gpsd daemon before you start navit:

dpkg-reconfigure gpsd

and provide device /dev/smd27 and enable default start of gpsd daemon.


Do not bother to contact me if you have any useful ideas in connection with navit on Android. --SergiuszPawlowicz 17:20, 16 April 2009 (CEST)

Questions from users

Q: Isn't more easy to port navit on android and not on debian?. --Hire I would agree, in an ideal world, but this is a good start. I'd be more than happy to remove AndNav2 and install an open-source app. Well done SergiuszPawlowicz. --Chris debian 19:56, 27 April 2009 (CEST)

A: If it is easier for you, please provide me a link to your version :-) --SergiuszPawlowicz 17:20, 16 April 2009 (CEST)

A: Is now possible, see above --Cp15 09:50, 20 August 2009 (UTC)