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 = 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[];
更多精彩
赞助商链接