Code example for WebView

Methods: addJavascriptInterface

0
    }  
     
    private void bindBrowser(WebView appView)
    { 
    	gap = new PhoneGap(this, appView);
    	geo = new GeoBroker(appView, this);
    	accel = new AccelListener(this, appView);
    	launcher = new CameraLauncher(appView, this);
    	fs = new FileUtils(appView);
    	 
    	// This creates the new javascript interfaces for PhoneGap 
    	appView.addJavascriptInterface(gap, "DroidGap");
    	appView.addJavascriptInterface(geo, "Geo");
    	appView.addJavascriptInterface(accel, "Accel");
    	appView.addJavascriptInterface(launcher, "GapCam");
    	appView.addJavascriptInterface(fs, "FileUtil");
    } 
         
    /** 
     * Provides a hook for calling "alert" from javascript. Useful for 
     * debugging your javascript.