Complete javascript code and android code