‘壹’ android 如何去获取手机Gps的信号强度
首先,进入设置选项,在主屏界面中按下Android手机Menu键,在弹出的进阶菜单中选择最后一项“Settings”;
将滑动条拖动至最下方,点击“About Phone”分类;
选择第二项“Status”分类;
这时,就能够看到“Signal Strength”选项,前面的-xx(这是一个负数数字)dBm则是手机信号强度。一般“0”—“-50”之间都是一个非常不错的信号强度,而数值越小则代表着信号越差。
‘贰’ 怎样在android手机中开启GPS功能
1、解锁手机进入主界面,选择“设置”
2、进入设置界面,选择“定位服务”
3、进入定位设置界面后,将“定位服务”右侧滑块开启。
4、开启后即可打开GPS功能,在下方可以选择不同的“定位模式”
5、在主界面下拉屏幕呼出菜单栏,点击“位置信息”可以快速开启GPS功能。
‘叁’ 现时android平台上实现gps获取经纬度有什么好方法
GPS获取经纬度可以参考以下方法:
manifest中添加权限:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
2. 实例化一个locationmanager:
LocationManger
locationmanager=(LocationManager)this.getSystemService(Context.LOCATION_SERVICE);
3. 判断GPS是否打开,未打开提示打开GPS:
if (!locationmanager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
Toast.makeText(this, "请开启GPS导航...", Toast.LENGTH_SHORT).show();
return;
}
4. 监听位置信息变化:
private LocationListener locationListener=new LocationListener() {
/**
* 位置信息变化时触发
*/
public void onLocationChanged(Location location) {
updateView(location);
Log.i(TAG, "时间:"+location.getTime());
Log.i(TAG, "经度:"+location.getLongitude());
Log.i(TAG, "纬度:"+location.getLatitude());
Log.i(TAG, "海拔:"+location.getAltitude());
}
5. 加载监听器:
locationmanager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 1,
locationListener);
‘肆’ Android开发,手机获取 GPS位置信息,求助手机睡眠以后获取GPS位置信息
一直搜索gps是因为无法定位。一般国产手机的gps芯片型号不行(用的芯片是集成在手机主芯片上的),搜星速度慢,无法定位。我用三星的手机不用开a-gps都能一分钟搜到信号定位成功。但用中兴的手机就不行,用a-gps经常是5分钟以上才能定位。另外高速移动也影响定位计算。还有手机会保存上次定位的一些信息,这样在下次开gps时定位更快,你在高速上开gps,换了新地方计算定位花的时间会更长。建议你改改手机里的设置,换一个a-gps的定位网络服务器地址。
‘伍’ Android 怎样稳定的获取原生GPS数据
LocationManager类的对象获取由系统提供
为一个LocationManager对象建立一个对象引用
‘陆’ 如何在Android中编程获得当前的GPS定位
您好,很高兴为您解答。
一、准备工作需要如下三种软件:1. Eclipse2. Android SDK3. 开发Android程序的Eclipse 插件
为了开始我们的工作,首先要安装Eclipse,然后从Google的网站获得Android SDK,并且安装Eclipse插件。
二、Activity类每一种移动开发环境都有自己的基类。如J2ME应用程序的基类是midlets,BREW的基类是applets,而Android程序的基类是 Activity。这个activity为我们提供了对移动操作系统的基本功能和事件的访问。这个类包含了基本的构造方法,键盘处理,挂起来恢复功能,以 及其他底层的手持设备的访问。实质上,我们的应用程序将是一个Activity类的扩展。在本文中读者将会通过例子学习到如何使用Activity类来编 写Android程序。
‘柒’ android 怎么获取gps信息
可以做到直接call到GPS模块,读取当前的经纬度。
但经纬度->实际地址的转换,google提供了api供程序调用,需要去申请一个google maps api的key,然后发送经纬度,会返回实际地址。
‘捌’ android怎样获得gps信息
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
private void getLocation()
{
// 获取位置管理服务
LocationManager locationManager;
String serviceName = Context.LOCATION_SERVICE;
locationManager = (LocationManager) this.getSystemService(serviceName);
// 查找到服务信息
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE); // 高精度
criteria.setAltitudeRequired(false);
criteria.setBearingRequired(false);
criteria.setCostAllowed(true);
criteria.setPowerRequirement(Criteria.POWER_LOW); // 低功耗
String provider = locationManager.getBestProvider(criteria, true); // 获取GPS信息
Location location = locationManager.getLastKnownLocation(provider); // 通过GPS获取位置
updateToNewLocation(location);
// 设置监听器,自动更新的最小时间为间隔N秒(1秒为1*1000,这样写主要为了方便)或最小位移变化超过N米
locationManager.requestLocationUpdates(provider, 100 * 1000, 500,
locationListener); }
private void updateToNewLocation(Location location) {
TextView tv1;
tv1 = (TextView) this.findViewById(R.id.tv1);
if (location != null) {
double latitude = location.getLatitude();
double longitude= location.getLongitude();
tv1.setText("维度:" + latitude+ "\n经度" + longitude);
} else {
tv1.setText("无法获取地理信息");
}
}
网络地图API调用地址:http://api.map..com/geocoder?output=json&location=纬度,经度&key=APP_KEY
谷歌地图服务API调用地址:http://maps.google.com/maps/api/geocode/json?latlng= 纬度,经度 &language=zh-CN&sensor=true
可以设置返回数据格式,JSON或者XML。
‘玖’ Android 怎样稳定的获取原生GPS数据
定位了就有经纬度,没定位,则一直闪的;
一般是4个星的时候 会定位。
所以可以根据是否获取有效的经纬度信息来判断是否定位。
卫星的个数 sv_status也是可以通过API获取的。LOCATION类
给你一段我的代码,看看就知道了。
locationManager.addGpsStatusListener(statusListener);//侦听GPS状态
private GpsStatus.Listener statusListener = new GpsStatus.Listener()
{
public void onGpsStatusChanged(int event)
{
// TODO Auto-generated method stub
GpsStatus gpsStatus= locationManager.getGpsStatus(null);
Log.v(TAG,"GPS status listener ");
//Utils.DisplayToastShort(GPSService.this, "GPS status listener ");
switch(event)
{
case GpsStatus.GPS_EVENT_FIRST_FIX:{
//第一次定位时间UTC gps可用
//Log.v(TAG,"GPS is usable");
int i=gpsStatus.getTimeToFirstFix();
Utils.DisplayToastShort(GPSService.this, "GPS 第一次可用 "+i);
Utils.setGPSStatus(Utils.GPS_STATUS.START);
break;
}
case GpsStatus.GPS_EVENT_SATELLITE_STATUS:{//周期的报告卫星状态
//得到所有收到的卫星的信息,包括 卫星的高度角、方位角、信噪比、和伪随机号(及卫星编号)
Iterable<GpsSatellite> allSatellites;
allSatellites = gpsStatus.getSatellites();
Iterator<GpsSatellite>iterator = allSatellites.iterator();
int numOfSatellites = 0;
int maxSatellites=gpsStatus.getMaxSatellites();
while(iterator.hasNext() && numOfSatellites<maxSatellites){
numOfSatellites++;
iterator.next();
}
Log.v(TAG,"GPS is **unusable** "+ numOfSatellites +" "+ maxSatellites);
if( numOfSatellites < 3){
// Utils.DisplayToastShort(GPSService.this, "***卫星少于3颗***");
Utils.setGPSStatus(Utils.GPS_STATUS.STOP);
} else if(numOfSatellites > 7){
Utils.setGPSStatus(Utils.GPS_STATUS.START);
}
break;
}
case GpsStatus.GPS_EVENT_STARTED:{
//Utils.DisplayToastShort(GPSService.this, "GPS start Event");
break;
}
case GpsStatus.GPS_EVENT_STOPPED:{
//Utils.DisplayToastShort(GPSService.this, "GPS **stop*** Event");
Utils.setGPSStatus(Utils.GPS_STATUS.STOP);
break;
}
default :
break;
}
}
};