If you research 'routing engines' you'll find that this is quite an advanced subject.
Your code needs access to spatial data that defines paths that can be taken and then needs to choose the best path.
The only possible solution i can think of involves using the android
GraphHopper library.
GraphHopper requires open street map data for the area which routes are to be provided for.
You can download osm data for any area, convert the osm data to the format required by GraphHopper and now in your android code you can get routes within the area covered by the osm data.
I've wrapped an older version of GraphHopper into a b4a library and it works pretty well.
Though as with all routing engines there is a disclaimer not to blindly follow suggested routes as there may be errors which could be dangerous if followed.
Now imagine replacing ther osm road data with river and canal data.
Feed your river and canal data into GraphHopper and (hopefully) GraphHopper will tell you the best route to take.
Fisrt thing you'd need to do is understand how open street map data is structured.
There's loads of into to be found on Google, a starting point could be:
http://wiki.openstreetmap.org/wiki/OSM_XML.
Also go to
OpenStreetMap, select a small area on the map and then choose to
Export the osm data for this area.
It'll let you download an
.osm file which if you open in a text editor you will see is just an XML document.
Look at the XML - you'll see how various different geographical features are defined.
So can you learn how osm data is structured and then see how to manually create your own 'rivers and canals' data?
You'd probably have to give your rivers and canals tag values in your XML defining them as roads and streets so GraphHopper sees them as possible routes to take.
Once you have your osm formatted rivers and canals data it can be converted from osm format to a binary format used by GraphHopper and you can use my b4a library to test it, see if it can give your routes using your rivers and canals.
Do some research and if you feel like you want to give it a try let me know.
Martin.