WEB开发网
开发学院手机开发Android 开发 Android 数据库与MapView总结 阅读

Android 数据库与MapView总结

 2010-11-05 00:54:34 来源:WEB开发网   
核心提示:import com.google.android.maps.GeoPoint;import com.google.android.maps.MapActivity;import com.google.android.maps.MapController;import com.google.android.maps.M

import com.google.android.maps.GeoPoint;

import com.google.android.maps.MapActivity;

import com.google.android.maps.MapController;

import com.google.android.maps.MapView;

import com.google.android.maps.Overlay;

public class EX10_06_04 extends MapActivity{

private TextView mTextView01;

/* 独一无二的menu选项identifier,用以识别事件 */

static final private int MENU_ADD = Menu.FIRST;

static final private int MENU_EDIT = Menu.FIRST+1;

static final private int MENU_DRAW = Menu.FIRST+2;

/* Google地图所需成员变量 */

private MapView mMapView01;

private int intZoomLevel=20;

/* 数据库所需成员变量 */

private MySQLiteOpenHelper dbHelper=null;

private int version = 1;

private List allRestaurantID;

private List allRestaurantName;

private List allRestaurantAddress;

private List allRestaurantCal;

/* 数据库数据表 */

private String tables[] = { "t_restaurant" };

/* 数据库字段名称 */

private String fieldNames[][] =

{

{ "f_id", "f_name", "f_address", "f_cal" }

};

/* 数据库字段数据类型 */

private String fieldTypes[][] =

{

{ "INTEGER PRIMARY KEY AUTOINCREMENT", "text" , "text", "text"}

};

protected void onCreate(Bundle savedInstanceState)

{

// TODO Auto-generated method stub

super.onCreate(savedInstanceState);

setContentView(R.layout.layout_draw);

mTextView01 = (TextView)findViewById(R.id.myTextView7);

/* 创建MapView对象 */

mMapView01 = (MapView)findViewById(R.id.myMapView1);

/* 数据库连接 */

dbHelper = new MySQLiteOpenHelper

(this, "mydb", null, version, tables, fieldNames, fieldTypes);

上一页  18 19 20 21 22 23 24 25 26 27 28  下一页

Tags:Android 数据库 MapView

编辑录入:coldstar [复制链接] [打 印]
赞助商链接