Thank you all for the responses, especially
@aeric.
Here is the use case.
I have an app with webview allowing javascript interface CallSub. The app has many variables for different purposes. I want to allow the webpage (somewhere in internet) loaded inside the webview ( webview.loadurl() ) to callback via javascript interface to get the variable value then submit webpage hence to webserver.
If we write one function for a variable that will mean many callback functions that increases apk size a lot. Or I could use one callback function with many Select Case to return variable values by something like case "gs_appver" return gs_appver. But it is inflexible and every time when we need one more variable, both app and webpage need to update program.
or, considering the app as a client browser, the online webpage as the url somewhere in internet. The idea is to allow webpage get value of any variables stored inside the app. The app is not going to change for next one to two years but our webpage could change at any minutes to get what we want.