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

Android 数据库与MapView总结

 2010-11-05 00:54:34 来源:WEB开发网   
核心提示:this.geoLongitude = this.mLocation.getLongitude()*1E6;}public GeoPointImageOverlay(Double geoLatitude, Double geoLongitude, int drawableID){this.geoLatitude = g

this.geoLongitude = this.mLocation.getLongitude()*1E6;

}

public GeoPointImageOverlay

(Double geoLatitude, Double geoLongitude, int drawableID)

{

this.geoLatitude = geoLatitude*1E6;

this.geoLongitude = geoLongitude*1E6;

this.drawableID = drawableID;

}

public GeoPointImageOverlay(GeoPoint gp, int drawableID)

{

this.geoLatitude = gp.getLatitudeE6();

this.geoLongitude = gp.getLongitudeE6();

this.drawableID = drawableID;

}

public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when){

Projection projection=mapView.getProjection();

if(shadow==false){

GeoPoint gp=new GeoPoint((int)this.geoLatitude, (int)this.geoLongitude);

Point point=new Point();

projection.toPixels(gp, point);

Paint paint=new Paint();

paint.setAntiAlias(true);

Bitmap bm=BitmapFactory.decodeResource(mapView.getResources(), this.drawableID);

canvas.drawBitmap(bm, point.x, point.y, paint);

}

return super.draw(canvas, mapView, shadow, when);

}

public void updateLocation(Location location)

{

this.mLocation = location;

}

public Location getLocation()

{

return mLocation;

}

}

6。数据库

Java代码

package irdc.ex10_06;

import android.content.ContentValues;

import android.content.Context;

import android.database.Cursor;

import android.database.sqlite.SQLiteDatabase;

import android.database.sqlite.SQLiteOpenHelper;

import android.database.sqlite.SQLiteDatabase.CursorFactory;

public class MySQLiteOpenHelper extends SQLiteOpenHelper {

public String TableNames[];

上一页  23 24 25 26 27 28 29 30 31  下一页

Tags:Android 数据库 MapView

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