我想制作一个可以以表格格式显示我的 sqlite 数据库元素的动态网页。如何在android中创建动态网页?我制作了一个静态 HTML 页面并放入了 assest 文件夹。它可以工作,但现在我想要一个动态网页。请帮忙:
package com.Htmlview;
import java.io.IOException;
import java.io.InputStream;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
public class Htmlview extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.main);
WebView webview = new WebView(this);
setContentView(webview);
try {
InputStream fin = getAssets().open("index3.html");
byte[] buffer = new byte[fin.available()];
fin.read(buffer);
fin.close();
webview.loadData(new String(buffer), "text/html", "UTF-8");
} catch (IOException e) {
e.printStackTrace();
}
}
}
此页面有效...帮助通过代码使其动态化。
古拉夫古普塔