Code example for LinearLayout

Methods: addViewsetOrientation, setBackgroundColor, setLayoutParams

0
        /* This changes the setWebChromeClient to log alerts to LogCat!  Important for Javascript Debugging */        
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ECLAIR)
        	appView.setWebChromeClient(new EclairClient(this));        	
        else 
        	appView.setWebChromeClient(new GapClient(this));
         
        appView.setInitialScale(100);
        appView.setVerticalScrollBarEnabled(false);
         
        WebSettings settings = appView.getSettings();
        settings.setJavaScriptEnabled(true);
        settings.setJavaScriptCanOpenWindowsAutomatically(true);
        settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);
         
 
    	Package pack = this.getClass().getPackage();
    	String appPackage = pack.getName();
    	 
        WebViewReflect.setStorage(settings, true, "/data/data/" + appPackage + "/app_database/");
         
        /* Bind the appView object to the gap class methods */ 
        bindBrowser(appView);
         
        root.addView(appView);                   
        setContentView(root);                        
    } 
	 
	@Override 
    public void onConfigurationChanged(Configuration newConfig) {
      //don't reload the current page when the orientation is changed 
      super.onConfigurationChanged(newConfig);
    }  
     
    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);
    	mContacts = new ContactManager(this, appView);
    	fs = new FileUtils(appView);
    	netMan = new NetworkManager(this, appView);
    	mCompass = new CompassListener(this, 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(mContacts, "ContactHook");