It's possible, but I wouldn't do it for your given use case :) (the UI could be done with the Android framework)
You can add what they call "Javascript Interfaces", which are basically links from Javascript to Java code. First, define a class to bind containing the methods you which to call, and add it to your WebView :
class HelloInterface
{
public void test(String name)
{
Log.i(TAG, "Hello " + name);
}
}
webview.addJavascriptInterface(new HelloInterface(), "HELLO");
Then, from your javascript code, you can just call
window.HELLO.test("Webview");