Android: How to pass data from android native code to jquerymobile
My android app is getting session id as part of login service response, for the subsequent requests i have to pass this sess id. Now I'm using jquery开发者_JAVA技巧mobile pages as webview content. I have to call some services from jquerymobile page using ajax.
Can I pass sessid from android native code to jquerymobile for this.
Thanks in advance.
Thanks, Venkat Papana
(It's quite the same question I answered here.)
So this answer describes how to communicate with your webview with a javascript bridge.
I think that's what your looking for...
If I understand well, you're using ajax, meaning the webview content is served by a remote site.
Assuming you have access to the site javascript, simply define a callback, say sessidFromAndroid(sessid)
then get it called by java :
mWebview.loadUrl("javascript:sessidFromAndroid("+mSession+")");
精彩评论