BRouter - Beta Version 0.9.1 - Using the service interface
==========================================================

BRouter 0.9.1 contains an experimental service interface.

Technically, it's an internal HTTP-Server running on the
device serving the same protocol as an online service.

This server serves requests of the form:

http://localhost:17777/brouter?format=kml&flat=49.565883&flon=8.799297&tlat=49.563606&tlon=8.811764&v=bicycle&fast=0&layer=mapnik HTTP/1.1

and responds with a track in KML format. This protocol is similar to that
spoken between OsmAnd and YourNavigation.

Consequently, it is not required anymore to have from/to
waypoints, if not present, BRouter simply starts it's
service and does no route calculation.

The server is running within an Android service that is started
from the BRouter APP when pressing the "Server-Mode" Button as
a last step. It uses the configuration (profile + nogo-areas)
configured in the app. If the service is already running, it
keeps running and just the configuration is updated when
pressing the "Server-Mode" Button.

That way it is possible to habe fully integrated navigation
in OsmAnd with the BRouter routing as an offline service,
fully configurable via the profile selection and nogo-areas.

In this setup, all configuration within OsmAnd (motocar/bicycle/foot,
fastest/shortest, exclusions) is ignored.

This internal HTTP interface is a preliminary solution, therefore
there is nithing happening to get the necceray patch in the
OsmAnd release process (You need to patch it yourself, either
by building from source, or patching on binary level using apktool,
or tempering with /etc/hosts might also work if you have rooted
your phone).

The problem in this setup is that there's no guarantee from
the android system to keep this service alive, it might, at any
time, shut it down to reclaim the memory. So the "final" solution
for an offline routing interface will probably have to use
the android service architecture "as intended" without going
through an http-interface.

However, in my tests, it works fine, and service shutdowns
are no problem on my Android 2.3.6 phone and somewhat more
frequent on my 4.0.1.

Perfomance is o.k. for intermediamte distances (<20 km air distance),
for larger distances you will have to use the "traditional" BRouter
file interface for the first run, and then put waypoints along that
track.
