Since Android uses Java to write apps, see if you can find an open source implementation in Java and port that to Android. If it works, it's much easier than writing it all from scratch yourself.