Posted By

arpit on 11/10/11


Tagged

android


Versions (?)

JavaScript / Native app inter communication in Android


 / Published in: Java
 

URL: http://www.slideshare.net/mobile/michael.galpin/android-lessons-you-wont-learn-in-school

  1. WebViewwebView=(WebView)findViewById(R.id.web_view);
  2.  
  3. WebSettingssettings=webView.getSettings();
  4.  
  5. settings.setJavaScriptEnabled(true);
  6.  
  7. settings.setDomStorageEnabled(true);
  8.  
  9. settings.setDatabasePath("/data/data/my.package/folder");
  10.  
  11. webView.setWebChromeClient(newWebChromeClient()
  12.  
  13. {@OverridepublicbooleanonConsoleMessage(ConsoleMessagemsg){
  14. //pipethistoLogCat
  15. }});
  16.  
  17. webView.addJavascriptInterface(newMyInterface(),"zorro");
  18.  
  19. webView.loadUrl("javascript:tarzan.start()");

Report this snippet  

You need to login to post a comment.