How to create html editor in Android
HTML Viewer Example
1
2
3
4
5
6
7
|
</pre>
<div id="Help" class="Help" style="z-index: 1000; left: 5%; overflow: visible; width: 90%; position: absolute; top: 20px; height: 500px;">
<h3>HTMLViewerExample:</h3>
You can place your information in this HTML document.
</div>
<pre>
|
3.) Run for output.
Steps:
1.) Create a project named HTMLViewerExample and set the information as stated in the image.
Build Target: Android 2.2
Application Name: HTMLViewerExample
Package Name: com.org.HTMLViewerExample
Activity Name: HTMLViewerExampleActivity
Min SDK Version: 8
Application Name: HTMLViewerExample
Package Name: com.org.HTMLViewerExample
Activity Name: HTMLViewerExampleActivity
Min SDK Version: 8
2.) Open HTMLViewerExampleActivity.java file and write following code there:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
package com.example.HTMLViewerExample;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class HTMLViewerExampleActivity extends Activity {
/** Called when the activity is first created. */
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
WebView wb = new WebView(this);
wb.loadUrl("file:///android_asset/example.htm");
setContentView(wb);
}
}
|
4.) Compile and build the project.
Comments
Post a Comment