GPS经纬度转换为百度坐标
摘要:android客户端:Importimport com.baidu.mapapi.CoordinateConvert;import com.baidu.mapapi.GeoPoint;CodeGeoPoint p = new GeoPoint(x, y);GeoPoint p2 = CoordinateConvert.bundleDecode(CoordinateConvert.fromWgs84ToBaidu(p));其变量p为从GPS直接读到的点,p2为在在地图上显示的点;PHP 网页:<?phpfunction getgps($lats,$lngs, $gps=false, $go
阅读全文
获取android 刚发出去的短信
摘要:import android.content.Context;import android.database.ContentObserver;import android.database.Cursor;import android.net.Uri;import android.os.Handler;import android.util.Log; public class ObserveSMSSend extends ContentObserver{ private final String SMSSEND_TYPE="smsInfo"; private final St
阅读全文
Android 使用LocationLstenser获取位置信息
摘要:第一步: 注册一个LocationLstenser:this.locationManager=(LocationManager)this.getSystemService(Context.LOCATION_SERVICE); this.locationProvider=this.locationManager.getProvider(LocationManager.GPS_PROVIDER); if(locationManager!=null) { this.locationManager.requestLocationUpdates(locationProvider.getName(),30
阅读全文
android 添加图片时错误:android libpng error: Not a PNG file
摘要:android 在向 drawable 中添加PNG格式的图片会出现如下错误:android libpng error: Not a PNG file解决办法:将原来的图片在windows的画图工具另存为.png,即可,问题虽小,但很害人
阅读全文
android 通过字符串来获取R下面资源的ID 值
摘要:方法一:try{ Field field=R.drawable.class.getField("icon"); int i= field.getInt(new R.drawable()); Log.d("icon",i+"");}catch(Exception e){ Log.e("icon",e.toString());}方法二: Resources res=getResources(); int i=res.getIdentifier("icon","drawable",
阅读全文