手机java功能与“谷歌电子地图”“GPS导航”是何种关系?
楼主的问题很无厘头 我来说一下
手机有很多功能 譬如红外 java 蓝牙等等 java功能只是支持用Java语言编译的程序比如现在的非智能手机都是用java游戏java程序的软件
谷歌电子地图为了非智能手机也能用上电子地图 所以研发了谷歌电子地图java版
GPS导航指的是用微型芯片接受卫星信号 实现定位 导航 引路等,GPS导航除了要用到微型芯片以外,必须还要装上电子地图
所以;
手机Java功能包括电子地图功能(都是后装的软件,只能看看道路啊POI啊,一般不能实现导航的,因为导航必须用到卫星芯片)
电子地图种类很多,网上发布的都是方便大家出行的电子地图,能看看道路啊POI啊,有些网站也能规划出一些路径给我们参考。谷歌电子地图就是众多品牌其中之一
GPS导航必须用到导航电子地图,导航电子地图是电子地图众多类型其中之一
java如何实现电子地图的定位
CellInfoManager
import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Context;
import android.telephony.CellLocation;
import android.telephony.NeighboringCellInfo;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.telephony.gsm.GsmCellLocation;
import android.util.Log;
public class CellInfoManager {
private int asu;
private int bid;
private int cid;
private boolean isCdma;
private boolean isGsm;
private int lac;
private int lat;
private final PhoneStateListener listener;
private int lng;
private int mcc;
private int mnc;
private int nid;
private int sid;
private TelephonyManager tel;
private boolean valid;
private Context context;
public CellInfoManager(Context paramContext) {
this.listener = new CellInfoListener(this);
tel = (TelephonyManager) paramContext.getSystemService(Context.TELEPHONY_SERVICE);
this.tel.listen(this.listener, PhoneStateListener.LISTEN_CELL_LOCATION | PhoneStateListener.LISTEN_SIGNAL_STRENGTH);
context = paramContext;
}
public static int dBm(int i) {
int j;
if (i = 0 i = 31)
j = i * 2 + -113;
else
j = 0;
return j;
}
public int asu() {
return this.asu;
}
public int bid() {
if (!this.valid)
update();
return this.bid;
}
public JSONObject cdmaInfo() {
if (!isCdma()) {
return null;
}
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put(“bid”, bid());
jsonObject.put(“sid”, sid());
jsonObject.put(“nid”, nid());
jsonObject.put(“lat”, lat());
jsonObject.put(“lng”, lng());
} catch (JSONException ex) {
jsonObject = null;
Log.e(“CellInfoManager”, ex.getMessage());
}
return jsonObject;
}
public JSONArray cellTowers() {
JSONArray jsonarray = new JSONArray();
int lat;
int mcc;
int mnc;
int aryCell[] = dumpCells();
lat = lac();
mcc = mcc();
mnc = mnc();
if (aryCell == null || aryCell.length 2) {
aryCell = new int[2];
aryCell[0] = cid;
aryCell[1] = -60;
}
for (int i = 0; i aryCell.length; i += 2) {
try {
int j2 = dBm(i + 1);
JSONObject jsonobject = new JSONObject();
jsonobject.put(“cell_id”, aryCell[i]);
jsonobject.put(“location_area_code”, lat);
jsonobject.put(“mobile_country_code”, mcc);
jsonobject.put(“mobile_network_code”, mnc);
jsonobject.put(“signal_strength”, j2);
jsonobject.put(“age”, 0);
jsonarray.put(jsonobject);
} catch (Exception ex) {
ex.printStackTrace();
Log.e(“CellInfoManager”, ex.getMessage());
}
}
if (isCdma())
jsonarray = new JSONArray();
return jsonarray;
}
public int cid() {
if (!this.valid)
update();
return this.cid;
}
public int[] dumpCells() {
int[] aryCells;
if (cid() == 0) {
aryCells = new int[0];
return aryCells;
}
ListNeighboringCellInfo lsCellInfo = this.tel.getNeighboringCellInfo();
if (lsCellInfo == null || lsCellInfo.size() == 0) {
aryCells = new int[1];
int i = cid();
aryCells[0] = i;
检举补充回答:
return aryCells;
}
int[] arrayOfInt1 = new int[lsCellInfo.size() * 2 + 2];
int j = 0 + 1;
int k = cid();
arrayOfInt1[0] = k;
int m = j + 1;
int n = asu();
arrayOfInt1[j] = n;
IteratorNeighboringCellInfo iter = lsCellInfo.iterator();
while (true) {
if (!iter.hasNext()) {
break;
}
NeighboringCellInfo localNeighboringCellInfo = (NeighboringCellInfo) iter.next();
int i2 = localNeighboringCellInfo.getCid();
if ((i2 = 0) || (i2 == 65535))
continue;
int i3 = m + 1;
arrayOfInt1[m] = i2;
m = i3 + 1;
int i4 = localNeighboringCellInfo.getRssi();
arrayOfInt1[i3] = i4;
}
int[] arrayOfInt2 = new int[m];
System.arraycopy(arrayOfInt1, 0, arrayOfInt2, 0, m);
aryCells = arrayOfInt2;
return aryCells;
}
public JSONObject gsmInfo() {
if (!isGsm()) {
return null;
}
JSONObject localObject = null;
while (true) {
try {
检举补充回答: JSONObject localJSONObject1 = new JSONObject();
String str1 = this.tel.getNetworkOperatorName();
localJSONObject1.put(“operator”, str1);
String str2 = this.tel.getNetworkOperator();
if ((str2.length() == 5) || (str2.length() == 6)) {
String str3 = str2.substring(0, 3);
String str4 = str2.substring(3, str2.length());
localJSONObject1.put(“mcc”, str3);
localJSONObject1.put(“mnc”, str4);
}
localJSONObject1.put(“lac”, lac());
int[] arrayOfInt = dumpCells();
JSONArray localJSONArray1 = new JSONArray();
int k = 0;
int m = arrayOfInt.length / 2;
while (true) {
if (k = m) {
localJSONObject1.put(“cells”, localJSONArray1);
localObject = localJSONObject1;
break;
}
int n = k * 2;
int i1 = arrayOfInt[n];
int i2 = k * 2 + 1;
int i3 = arrayOfInt[i2];
JSONObject localJSONObject7 = new JSONObject();
localJSONObject7.put(“cid”, i1);
localJSONObject7.put(“asu”, i3);
localJSONArray1.put(localJSONObject7);
k += 1;
}
} catch (JSONException localJSONException) {
localObject = null;
}
}
}
public boolean isCdma() {
if (!this.valid)
update();
java使用百度地图,进行点定位,点位置不正确
根据经纬度定位是不太准,各个地图的经纬度定位的地方也不准,只能说在一定范围内允许这个误差的存在
java版手机地图(带定位)软件哪几个最好用?
建议使用天下行,这个软件确实不错,我正在用,可以通过卫星定位,查找周边建筑设施等等,功能确实够强大的,个人感觉可以和导航仪相媲美
java怎么调用地图获取地理位置信息
通过浏览器来获取用户当前位置。基于此特性可以开发基于位置的服务应用。在获取地理位置信息前,首先浏览器都会向用户询问是否愿意共享其位置信息,待用户同意后才能使用。
Html5获取地理位置信息是通过Geolocation API提供,使用其getCurrentPosition方法,此方法中有三个参数,分别是成功获取到地理位置信息时所执行的回调函数,失败时所执行的回调函数和可选属性配置项。