Navit/Android

From OpenStreetMap Wiki
Jump to navigation Jump to search

Navit is a free and powerful GPS navigator that works perfectly on an Android phone.

Navit on a motorcycle
Navit on a motorcycle

Presentation

Some advantages of Navit:

  • Completely offline (map and routing);
  • Calculation of smart and fast route;
  • OpenStreetMap based card so vibrant and free ;
  • Fully customizable (via a single configuration file) ...

New versions come out almost every day. The recommendations on this page are useful if you want to use this very powerful software. They are made for you if:

  • You do not have an Internet connection via the telephone;
  • You want to activate the warning radars or danger areas;
  • You want a GPS navigator as you imagine.

Install

Install Navit

Install Navit from the Google Play Store

Use this method if your device (phone or tablet) Android has an Internet connection via Wi-Fi or mobile network.

You can download Navit directly from Google's Play Store (previously named Android Market), or get the bleeding edge version from the beta channel.

Install Navit manually (from SourceForge web site)

Use this method if your device (phone or tablet) Android has NOT an Internet connection via Wi-Fi or mobile network. The following explains how to install Navit manually if you don't want to use Google Play.

With a file navigator :

  1. Download the apk file for the latest stable release from (navit-0.5.0-unsigned.apk of 31/12/2015) : https://sourceforge.net/projects/navit/files/v0.5.0/ or at https://github.com/navit-gps/navit/releases?after=R6508
  2. copy the file on your device (phone or tablet);
  3. open the file with your device's file navigator for installing.

With adb tool in the Android SDK (https://developer.android.com/studio/index.html )

  1. Download the apk file for the latest stable release from (navit-0.5.0-unsigned.apk of 31/12/2015) : https://sourceforge.net/projects/navit/files/v0.5.0/
  2. Launch the command line tool : adb install navit-0.5.0-unsigned.apk (syntax : http://adbshell.com/commands/adb-install )

Create the Navit directory

We must first create a directory to host the different data: map, configuration file, ... This directory is intended to be on the SD Card on your device (Phone or tablet):

  1. Create a directory named exactly "navit" on the real (card in the microSD port) or simulated (internal storage space that you can see as USB key by your computer) SD Card on your device (/sdcard/navit)

Note : the folder can also have the name /storage/emulated/0 or /storage/MicroSD folder or un other name instead /sdcard/navit.

Get a map

The maps are generated from OpenStreetMap.

  1. download the bin-file for one map according to your needs maps9.navit-project.org (Multipolyon-Landuses are not visible ?); To download the bin file for your country : click on "Predefined Area" on the main page, select your Continent, next select your country, then click on it and you can see now that the area for your country is highlight on the map, click on the button "Get the map".

Other sources for the bin map files are listed on this page.

  1. Copy bin-file somewhere on from your computer to the Navit maps directory on the sd-card (/sdcard/navit/maps/??.bin). (p.e. I've created for the maps the folder /sdcard/navit/maps.

Note that the download may take a few hours. The maps are quite large about 3Go (2016) for France extended. You can also do it directly via the phone but from the point of view this is less convenient.

Alternativ you can also use an osm-file from Geofabrik. But these Files must be converted manually to the bin-format.

Select the directory for the map(s)

  1. Start Navit then go up and to the right on the menu.
  2. Select entry "select the path of the map"
  3. With the browser, move to go to the directory where is your bin file.
  4. Click the "Select" button at the top right (even if it shows you as "Directory is empty")
  5. You have the following message quickly "Restart to apply the changes Navit"
  6. Restart Navit

First tests

  1. Start Navit
  2. Click in the lower left corner of the screen to bring up the Navit main menu
  3. Then go to:
  Configuration -> Maps

The downloaded map must be recognized. Ie you need to have a checked line like "binfile: /mnt/sdcard/navit/maps/osm_bbox_france.bin and the "Road" checked too.

  1. Then return to the menu start menu (main menu) and do:
  Actions -> City

Search a random city. Example: Paris. If it's good Navit is operational. Otherwise see Chapter Problem.

  1. You can also try several zoom in (button +) and then next zoom out (button -) to try to see the world map.

Possible configuration by the GUI

Navit allows a limited number of settings by the GUI which will be shown below

Themes

  1. Start Navit
  2. Click in the lower left corner of the screen to bring up the main menu Navit
  3. Then go to:
 Setup -> Display -> Theme

You then have 7 themes for you:

  • Car :
  • Car-Dark: display mode map contrasted with dark colors mode for night driving
  • Car-Android: map display in lightweight mode
  • Car-simple map display in lightweight and contrasting fashion
  • Bike: fashion map display suitable for a bike
  • T@H
  • Route

Window or full screen mode

  1. Start Navit
  2. Click in the lower left corner of the screen to bring up the main menu Navit
  3. Then go to:
 Configuration -> Display

You can choose when to switch to "full screen" mode, or "windowed mode" With the "Full Screen" mode, the top of the map menu bar disappears and the map takes the entire screen

2D Mode (plan) or 3D (aerial view)

  1. Start Navit
  2. Click in the lower left corner of the screen to bring up the main menu Navit
  3. Then go to:
 Configuration -> Display

You can choose when to enter the "3D" or "2D" 2D mode gives you a flat view of the map as paper maps and 3D mode shows you the map as if you were in the sky and looking at the ground a given location.

Select the maps and associated options

  1. Start Navit
  2. Click in the lower left corner of the screen to bring up the main menu Navit
  3. Then go to:
 Configuration -> Maps

In this window, you can select the lines with binfile that load the maps you want to use. There are also various options for additional parameters:

  • "Route":
  • "Route Graph"?
  • "Navigation"?
  • "Tracking":

Choose the profile of means of transport for your travel

  1. Start Navit
  2. Click in the lower left corner of the screen to bring up the main menu Navit
  3. Then go to:
 Configuration -> Vehicle

You then 8 profiles depending on the type of transportation available:

  • car
  • car the shortest
  • Car without toll
  • car detailed
  • bike
  • pedestrian
  • horse
  • truck

Applying rules to map and vehicle

  1. Start Navit
  2. Click in the lower left corner of the screen to bring up the main menu Navit
  3. Then go to:
 Configuration -> Rules

You then have four rules of behavior that applies on the map and vehicle

  • Adhere to the road
  • Orientation always north
  • The map follows the vehicle
  • Set with waypoints

Basic improvements

Get the "configuration file"

We must first retrieve a sample configuration file. With Navit it does not change the global configuration file of the software but a "personal" file. It is thus possible to give their heart without the risk of jeopardizing the application itself. This file must be "created" on your computer, and then be copied to your connected device as a USB key to your computer (or on an SD or microSD card),to be placed in the /sdcard/navit folder under the exact name "navit.xml"

  1. Back on the computer;
  2. download the file https://github.com/navit-gps/navit/releases/download/v0.5.0/navit-0.5.0-unsigned.apk if you have not already done
  3. Unzip the navit-0.5.0-unsigned.apk file that was used to install with 7zip under MS Windows or unzip for GNU/Linux. it is a single zip archive;
  4. Move in the decompressed archive, in subdirectories "res/raw". Here you will find files that match different densities of pixels per area. They are named:
  • Navitldpi.xml (LDPI (low) ~ 120dpi)
  • Navitmdpi.xml (mdpi (medium) ~ 160dpi)
  • Navithdpi.xml (hdpi (high) ~ 240dpi)
  • Navitxhdpi.xml (xhdpi (extra-high) ~ 320dpi)
  • Navitxxhdpi.xml (xxhdpi (extra-extra-high) ~ 480dpi)
  • Navitxxxhdpi.xml (xxxhdpi (extra-extra-extra-high) ~ 640dpi)

These six files are very similar. They represent an optimized configuration for different screen resolutions.

  • Navitldpi.xml for a minimum size of QVGA (240 × 320) - Low
  • Navitmdpi.xml for a minimum size of HVGA (320 × 480) - average
  • Navithdpi.xml for a minimum screen size (480 × 640) - High
  • Navitxhdpi.xml for a minimum screen size (640 × 960) - very high
  • Navitxxhdpi.xml for a minimum screen size?
  • Navitxxxhdpi.xml for a minimum screen size?

Sources: Android - Supporting Multiple Screens and / What are the common Android screen resolutions? + The android screen sizes + list of screen resolutions

When in doubt take a scheduled file for Low resolution or Average to a phone.

  1. For example copy navitmdpi.xml file in the Navit folder;
  2. Rename this file "navit.xml".

This is this file /sdcard/navit/navit.xml that will be called here "configuration file". Navit will consider at startup.

Copy navit.xml file on your device for the more experienced

The simplest way to configure Navit is to edit a file from your computer and copy it via "abd" (included in the Android SDK tools) or an equivalent utility. This avoids enable/disable many times the phone memory via the USB cable.

 adb push navit.xml /sdcard/navit/navit.xml

Navit with maps from OSM on a Smartphone with Android 1.6 / 2.x

Here is a HowTo, how you can use Navit with maps from OSM on a Smartphone with Android:


tested Smartphones: HTC Desire Z (aka USA G2) (Android 2.2), Samsung I9000 Galaxy (Android 2.2), SE Xperia X10 (Android 1.6 and Android 2.1), HTC tattoo (Android 1.6, Android 2.2 and Android 2.3)



0. If you won't edit the navit.xml yourself, you can download a preconfigured xml-file from here with a small readme in German. With this xml-file, navit looks like this:

Navit android.png


2. open the apk with a zip-program (7z, archivmanager) and extract navit.xml from /res/raw/

  • There is no navit.xml instead use one of the following navitldpi.xml, navitmdpi.xml, navithdpi.xml for low, medium or high resolution.



3. copy the apk on the sd-card of the cellphone



5. download the map from the Navit Planet Extractor (Multipolyon-Landuses are not visible). For Germany, Switzerland, Austria, Liechtenstein, DACH, Benelux and the British Isles you can get a map from here (the Multipolygon-Landuses are visible on these maps).

Alternativ you can also use an osm-file from Geofabrik. But these Files must be converted manually to the bin-format.



6. save the bin-file somewhere on the sd-card from the cell. (p.e. I've created for the maps the folder /navit/maps.



7. open the file navit.xml (which we have extracted at point 2) with a texteditor like notepad.



8. in navit.xml: customize the coordinates and zoomlevel (approx line 37) (navit center="4808 N 1134 E" zoom="256" tracking="1" orientation="-1" recent_dest="10")



9. in navit.xml: search the line "Mapset template for openstreetmaps" (approx line 500).



10. in navit.xml: change mapset enabled to "yes" and adjust the path to the bin-datei - which we've saved on point 6. at my example it looks like:

		<!-- Mapset template for openstreetmaps -->
		<mapset enabled="yes">
			<map type="binfile" enabled="yes" active="yes" data="/sdcard/navit/maps/osm_ch.bin"/>
		</mapset>



11. just above these lines the Sample-Map is defined. This Sample-Map must be deactiveted with enabled="no":

		<!-- If you dont want to use the sample map, either set enabled="no" in the next line or remove the xml file from the maps directory -->
		<mapset enabled="no">
			<map type="binfile" enabled="no" data="/sdcard/navitmap.bin"/>
		</mapset>



12. in navit.xml: almost on the top of this file, search the OSD-settings



13. Customise the layout: to add GPS speed and maxspeed, add the following lines in navit.xml: below osd enabled="no" type="navigation_next_turn":

		<osd enabled="yes" type="text" label="${vehicle.position_speed}" x="-80" y="53" font_size="250" w="350" h="50" align="4" font_color="#808080"/>
		<osd enabled="yes" type="text" label="M:${tracking.item.route_speed}" x="-80" y="103" font_size="250" w="350" h="50" align="4" font_color="#808080"/>

There are also custom layouts that can be found on the navit wiki [1]. The layouts are cross-platform but they depend on the screen size.



14. Navit uses the system language, if you want to change it, search following line (approx line 9):

<config xmlns:xi="http://www.w3.org/2001/XInclude">

change this line to your language. p.e.:

<config xmlns:xi="http://www.w3.org/2001/XInclude" language="de_DE">

(or for Switzerland: language="de_CH", for Austria it is language="de_AT")



15. save the file navit.xml to the sd-card from the cell. Attention: don't save this file to a subfolder. Save it direct to the root from the sd-card.