Friday, May 11, 2012

HTML5 Integration in android


HTML5 Integration
1, Open New android project 


2,Add "WebView" web kit in xml file



<WebView  
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:id="@+id/webview"
    />


3, Refer the WebView in Activity file


   Webview webview = (WebView) findViewById(R.id.webview);


4, Add Html file to the assets folder-> Right click the assets folder ->create new folder name www         then Right click www folder and add file with html extention


5,Refer the html with as following
    
    webview.loadUrl("file:///android_asset/www/index.html");



Down load the Example Project



No comments :

Post a Comment