Exemple #1
0
 public void startWifiScan() {
   WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
   // Enable wifi if necessary
   // TODO: Add dialog to confirm
   JavaToJSInterface javaToJSInterface;
   javaToJSInterface = JavaToJSInterface.getInstance(null);
   if (wifiManager.isWifiEnabled()) {
     wifiManager.startScan();
     javaToJSInterface.setStatusMessage(getText(R.string.refresh_requested).toString());
   } else {
     javaToJSInterface.setStatusMessage("WiFi is not enabled!");
   }
 }
Exemple #2
0
 public void setupWebView() {
   webPage = (WebView) findViewById(R.id.webpageContainer);
   webPage.setWebChromeClient(new TaginWebChromeClient());
   webPage.setWebViewClient(new TaginWebViewClient());
   WebSettings webSettings = webPage.getSettings();
   webSettings.setJavaScriptEnabled(true);
   webPage.addJavascriptInterface(new JSToJavaInterface(), "androidInterface");
   JavaToJSInterface.getInstance(webPage);
   System.out.println("WebView has been setup. Loading url: " + taginGUIurl);
   webPage.loadUrl(taginGUIurl);
 }