如何在安卓实现美团地图定位平台上实现定位

1. 在被定位手机安装本软件,记录下软件设置里面提示的手机编号和密码。然后切换到后台运行。
2. 在另一个手机上安装本软件,在设置里面,输入被定位手机的编号和密码,就能随时得到被定位手机的位置和轨迹。
3. 如果你喜欢使用PC机,那么可以直接在本网站输入被定位手机的编号和密码,也能实时看到被定位手机的位置和轨迹。
1.您可以安装在小孩的手机上,当您的小孩外出参加活动,而您又不方便随行,您可以用它知道小孩的位置,以免担忧;
2. 如果您是货车车主,用了本软件,您可以随时知道您的车辆在哪里,并且知道车辆的行驶路径。
3. 如果您想知道您的业务人员外勤人员是不是真的去拜访客户还是回家睡觉去了,那么可以安装本软件。
4. 更多应用场景,你懂的。
5. 本软件完全傻瓜运行,三分钟学会。
&&&&&&&&&&&&软件名称:轨迹多端
&&&&&&&&&&&&运行平台:安卓系统
&&&&&&&&&&&&版本:V1.0.
&&&&&&&&&&&&下载链接
1. 会不会泄露个人隐私?
不会,本软件运行后,需要告知被定位手机的编号和密码,才能获取他的位置和轨迹。被定位手机可以随时修改密码。
2. 轨迹显示多久的?
八小时轨迹,随时更新,实时显示当前位置。
3. 没有GPS信号能定位么?
可以的,没有GPS,系统自动根据WIFI和基站定位。
4. 没有网络能定位么?
不能,没有网络,定位数据无法发送给服务器。建议使用电信3G网络。
5. 软件里的张三李四王五代表什么?
这是我们设计的避免隐私泄露的方法,用张三李四王五代表你所要定位的对方的名字。
6. 看起来只能定位三个手机,是这样的么?
目前设计是定位四个手机,除了张三李四王五之外,还有自己这个手机。如果需要定位更多的手机,欢迎与我们联系,可以定制开发。
7. 我不想让被定位机器知道,应该怎么办?
目前可以设计没有界面的“被定位端”程序,请联系我们吧,要付费的哦。你该不是想干坏事吧,可不能用于干坏事哦。
8. 轨迹可以分享给多少人?
轨迹可以分享给任意多人,只要他知道您手机的编号和密码。
9. 轨迹多端应该是诡计多端?
抱歉借用了诡计多端这个成语,属于乱造成语,这不是小学老师教的,汗一个。本软件能显示多个手机端的轨迹,故而起名叫”轨迹多端“。
10. 我怕用了这个软件引起误会,怎么破?
轨迹多端这个名字太大气了,容易产生遐想;我们考虑到了这一点,特意制作了多个马甲软件,起一些中性的比较温和的,比较容易混淆和不引起注意的名字,你看如何。右边是我们想出来的一些马甲名称,如果您有更好的名字,欢迎提供,我们可以为您定制哦。
这些名字你是不是更喜欢?
商务:QQ:
技术:QQ:
客服:QQ:
工信部备案:在Android里完美实现基站和WIFI定位
-android100学习网
在Android里完美实现基站和WIFI定位
众所周知的,在OPhone和大部分国产的Android定制机里不支持最简单实用的基站和WIFI定位,只能使用速度慢而耗电的GPS定位,但OPhone和华为/中兴生产的一些A
众所周知的,在OPhone和大部分国产的Android定制机里不支持最简单实用的基站和WIFI定位,只能使用速度慢而耗电的GPS定位,但OPhone和华为/中兴生产的一些Android定制机却占据了一定的市场,因此导致了很多使用了定位技术的Andorid应用挺尴尬的。
&&&&&&&& 不过其实只要明白了基站/WIFI定位的原理,自己实现基站/WIFI定位其实不难。基站定位一般有几种,第一种是利用手机附近的三个基站进行三角定位,由于每个基站的位置是固定的,利用电磁波在这三个基站间中转所需要时间来算出手机所在的坐标;第二种则是利用获取最近的基站的信息,其中包括基站id,location area code、mobile country code、mobile network code和信号强度,将这些数据发送到google的定位web服务里,就能拿到当前所在的位置信息,误差一般在几十米到几百米之内。其中信号强度这个数据很重要,网上很多所谓的手动通过基站和WIFI信息定位的方法误差大都是因为没使用信号强度而导致误差过大。高德也自己做了一个基站库,具体可以google搜索一下。
&&&&&&&& 现在在一些大中型城市里,WIFI已经普及,有私人或企业的WIFI,亦有中国电信的WIFI,通过WIFI信息进行定位,并不需要真正连接上指定的WIFI路由器,只需要探测到有WIFI存在即可,因此当手机使用的不是GSM制式(因为google的基站库里并没在保存太多的CDMA基站)的时候,也可以使用WIFI进行定位,原理也和基站定位一样,必须要拿到WIFI路由器的SSID和信号强度。
&&&&&&&& 由于有些用户默认是将WIFI关闭的,通过API开启WIFI硬件并进行搜索附近的WIFI路由器需要一段时间,怎样才能将手机基站定位和WIFI定位完美结合起来呢,Android提供了一种很好的机制,就是Handler和Looper,Handler和Looper一般用于跨线程传递数据,但当在单线程里使用时,就变成了一个先进先出的消息泵。利用这个消息泵进行调度,就可以将基站定位和WIFI定位完美结合。以下是相关的代码:
CellInfoManager
import java.lang.reflect.M
import java.util.I
import java.util.L
import org.json.JSONA
import org.json.JSONE
import org.json.JSONO
import android.content.C
import android.telephony.CellL
import android.telephony.NeighboringCellI
import android.telephony.PhoneStateL
import android.telephony.TelephonyM
import android.telephony.gsm.GsmCellL
import android.util.L
public class CellInfoManager {
&&&&&& private boolean isC
&&&&&& private boolean isG
&&&&&& private final PhoneStateL
&&&&&& private TelephonyM
&&&&&& private C
&&&&&& 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 = paramC
&&&&&& public static int dBm(int i) {
&&&&&&&&&&&&&
&&&&&&&&&&&&& if (i &= 0 && i &= 31)
&&&&&&&&&&&&&&&&&&&& j = i * 2 + -113;
&&&&&&&&&&&&& else
&&&&&&&&&&&&&&&&&&&& j = 0;
&&&&&&&&&&&&&
&&&&&& public int asu() {
&&&&&&&&&&&&& return this.
&&&&&& public int bid() {
&&&&&&&&&&&&& if (!this.valid)
&&&&&&&&&&&&&&&&&&&& update();
&&&&&&&&&&&&& return this.
&&&&&& public JSONObject cdmaInfo() {
&&&&&&&&&&&&& if (!isCdma()) {
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&& }
&&&&&&&&&&&&& 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 =
&&&&&&&&&&&&&&&&&&&& Log.e("CellInfoManager", ex.getMessage());
&&&&&&&&&&&&& }
&&&&&&&&&&&&& return jsonO
&&&&&& public JSONArray cellTowers() {
&&&&&&&&&&&&& JSONArray jsonarray = new JSONArray();
&&&&&&&&&&&&&
&&&&&&&&&&&&&
&&&&&&&&&&&&&
&&&&&&&&&&&&& int aryCell[] = dumpCells();
&&&&&&&&&&&&& lat = lac();
&&&&&&&&&&&&& mcc = mcc();
&&&&&&&&&&&&& mnc = mnc();
&&&&&&&&&&&&& if (aryCell == null || aryCell.length & 2) {
&&&&&&&&&&&&&&&&&&&& aryCell = new int[2];
&&&&&&&&&&&&&&&&&&&& aryCell[0] =
&&&&&&&&&&&&&&&&&&&& aryCell[1] = -60;
&&&&&&&&&&&&& }
&&&&&&&&&&&&& for (int i = 0; i & aryCell. 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();
&&&&&&&&&&&&&
&&&&&& public int cid() {
&&&&&&&&&&&&& if (!this.valid)
&&&&&&&&&&&&&&&&&&&& update();
&&&&&&&&&&&&& return this.
&&&&&& public int[] dumpCells() {
&&&&&&&&&&&&& int[] aryC
&&&&&&&&&&&&& if (cid() == 0) {
&&&&&&&&&&&&&&&&&&&& aryCells = new int[0];
&&&&&&&&&&&&&&&&&&&& return aryC
&&&&&&&&&&&&& }
&&&&&&&&&&&&& List&NeighboringCellInfo& lsCellInfo = this.tel.getNeighboringCellInfo();
&&&&&&&&&&&&& if (lsCellInfo == null || lsCellInfo.size() == 0) {
&&&&&&&&&&&&&&&&&&&& aryCells = new int[1];
&&&&&&&&&&&&&&&&&&&& int i = cid();
&&&&&&&&&&&&&&&&&&&& aryCells[0] =
&&&&&&&&&&&&&&&&&&&& return aryC
&&&&&&&&&&&&& }
&&&&&&&&&&&&& int[] arrayOfInt1 = new int[lsCellInfo.size() * 2 + 2];
&&&&&&&&&&&&& int j = 0 + 1;
&&&&&&&&&&&&& int k = cid();
&&&&&&&&&&&&& arrayOfInt1[0] =
&&&&&&&&&&&&& int m = j + 1;
&&&&&&&&&&&&& int n = asu();
&&&&&&&&&&&&& arrayOfInt1[j] =
&&&&&&&&&&&&& Iterator&NeighboringCellInfo& iter = lsCellInfo.iterator();
&&&&&&&&&&&&& while (true) {
&&&&&&&&&&&&&&&&&&&& if (!iter.hasNext()) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&& NeighboringCellInfo localNeighboringCellInfo = (NeighboringCellInfo) iter.next();
&&&&&&&&&&&&&&&&&&&& int i2 = localNeighboringCellInfo.getCid();
&&&&&&&&&&&&&&&&&&&& if ((i2 &= 0) || (i2 == 65535))
&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&& 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 aryC
&&&&&& public JSONObject gsmInfo() {
&&&&&&&&&&&&& if (!isGsm()) {
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&& }
&&&&&&&&&&&&& JSONObject localObject =
&&&&&&&&&&&&& 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;
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 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 =
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&& }
&&&&&& public boolean isCdma() {
&&&&&&&&&&&&& if (!this.valid)
&&&&&&&&&&&&&&&&&&&& update();
&&&&&&&&&&&&& return this.isC
&&&&&& public boolean isGsm() {
&&&&&&&&&&&&& if (!this.valid)
&&&&&&&&&&&&&&&&&&&& update();
&&&&&&&&&&&&& return this.isG
&&&&&& public int lac() {
&&&&&&&&&&&&& if (!this.valid)
&&&&&&&&&&&&&&&&&&&& update();
&&&&&&&&&&&&& return this.
&&&&&& public int lat() {
&&&&&&&&&&&&& if (!this.valid)
&&&&&&&&&&&&&&&&&&&& update();
&&&&&&&&&&&&& return this.
&&&&&& public int lng() {
&&&&&&&&&&&&& if (!this.valid)
&&&&&&&&&&&&&&&&&&&& update();
&&&&&&&&&&&&& return this.
&&&&&& public int mcc() {
&&&&&&&&&&&&& if (!this.valid)
&&&&&&&&&&&&&&&&&&&& update();
&&&&&&&&&&&&& return this.
&&&&&& public int mnc() {
&&&&&&&&&&&&& if (!this.valid)
&&&&&&&&&&&&&&&&&&&& update();
&&&&&&&&&&&&& return this.
&&&&&& public int nid() {
&&&&&&&&&&&&& if (!this.valid)
&&&&&&&&&&&&&&&&&&&& update();
&&&&&&&&&&&&& return this.
&&&&&& public float score() {
&&&&&&&&&&&&& float f1 = 0f;
&&&&&&&&&&&&& int[] aryCells =
&&&&&&&&&&&&& int i = 0;
&&&&&&&&&&&&& float f2 = 0f;
&&&&&&&&&&&&& if (isCdma()) {
&&&&&&&&&&&&&&&&&&&& f2 = ;
&&&&&&&&&&&&&&&&&&&& return f2;
&&&&&&&&&&&&& }
&&&&&&&&&&&&& if (isGsm()) {
&&&&&&&&&&&&&&&&&&&& f1 = 0.0F;
&&&&&&&&&&&&&&&&&&&& aryCells = dumpCells();
&&&&&&&&&&&&&&&&&&&& int j = aryCells.
&&&&&&&&&&&&&&&&&&&& if (i &= j)
&&&&&&&&&&&&&&&&&&&&&&&&&&& f2 = f1;
&&&&&&&&&&&&& }
&&&&&&&&&&&&& if(i &=0 ) {
&&&&&&&&&&&&&&&&&&&& return ;
&&&&&&&&&&&&& }
&&&&&&&&&&&&& int m = aryCells[i];
&&&&&&&&&&&&& for (i = 0; i & i++) {
&&&&&&&&&&&&&&&&&&&& if ((m & 0) || (m & 31))
&&&&&&&&&&&&&&&&&&&&&&&&&&& f1 += 0.5F;
&&&&&&&&&&&&&&&&&&&& else
&&&&&&&&&&&&&&&&&&&&&&&&&&& f1 += 1.0F;
&&&&&&&&&&&&& }
&&&&&&&&&&&&& f2 = f1;
&&&&&&&&&&&&& return f2;
&&&&&& public int sid() {
&&&&&&&&&&&&& if (!this.valid)
&&&&&&&&&&&&&&&&&&&& update();
&&&&&&&&&&&&& return this.
&&&&&& public void update() {
&&&&&&&&&&&&& this.isGsm =
&&&&&&&&&&&&& this.isCdma =
&&&&&&&&&&&&& this.cid = 0;
&&&&&&&&&&&&& this.lac = 0;
&&&&&&&&&&&&& this.mcc = 0;
&&&&&&&&&&&&& this.mnc = 0;
&&&&&&&&&&&&& CellLocation cellLocation = this.tel.getCellLocation();
&&&&&&&&&&&&& int nPhoneType = this.tel.getPhoneType();
&&&&&&&&&&&&& if (nPhoneType == 1 && cellLocation instanceof GsmCellLocation) {
&&&&&&&&&&&&&&&&&&&& this.isGsm =
&&&&&&&&&&&&&&&&&&&& GsmCellLocation gsmCellLocation = (GsmCellLocation) cellL
&&&&&&&&&&&&&&&&&&&& int nGSMCID = gsmCellLocation.getCid();
&&&&&&&&&&&&&&&&&&&& if (nGSMCID & 0) {
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (nGSMCID != 65535) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& this.cid = nGSMCID;
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& this.lac = gsmCellLocation.getLac();
&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&& }
&&&&&&&&&&&&& try {
&&&&&&&&&&&&&&&&&&&& String strNetworkOperator = this.tel.getNetworkOperator();
&&&&&&&&&&&&&&&&&&&& int nNetworkOperatorLength = strNetworkOperator.length();
&&&&&&&&&&&&&&&&&&&& if (nNetworkOperatorLength != 5) {
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (nNetworkOperatorLength != 6)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ;
&&&&&&&&&&&&&&&&&&&& } else {
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.mcc = Integer.parseInt(strNetworkOperator.substring(0, 3));
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.mnc = Integer.parseInt(strNetworkOperator.substring(3, nNetworkOperatorLength));
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&& if (this.tel.getPhoneType() == 2) {
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.valid =
&&&&&&&&&&&&&&&&&&&&&&&&&&& Class&?& clsCellLocation = cellLocation.getClass();
&&&&&&&&&&&&&&&&&&&&&&&&&&& Class&?&[] aryClass = new Class[0];
&&&&&&&&&&&&&&&&&&&&&&&&&&& Method localMethod1 = clsCellLocation.getMethod("getBaseStationId", aryClass);
&&&&&&&&&&&&&&&&&&&&&&&&&&& Method localMethod2 = clsCellLocation.getMethod("getSystemId", aryClass);
&&&&&&&&&&&&&&&&&&&&&&&&&&& Method localMethod3 = clsCellLocation.getMethod("getNetworkId", aryClass);
&&&&&&&&&&&&&&&&&&&&&&&&&&& Object[] aryDummy = new Object[0];&
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.bid = ((Integer) localMethod1.invoke(cellLocation, aryDummy)).intValue();
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.sid = ((Integer) localMethod2.invoke(cellLocation, aryDummy)).intValue();
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.nid = ((Integer) localMethod3.invoke(cellLocation, aryDummy)).intValue();
&&&&&&&&&&&&&&&&&&&&&&&&&&& Method localMethod7 = clsCellLocation.getMethod("getBaseStationLatitude", aryClass);
&&&&&&&&&&&&&&&&&&&&&&&&&&& Method localMethod8 = clsCellLocation.getMethod("getBaseStationLongitude", aryClass);
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.lat = ((Integer) localMethod7.invoke(cellLocation, aryDummy)).intValue();
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.lng = ((Integer) localMethod8.invoke(cellLocation, aryDummy)).intValue();
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.isCdma =
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&& } catch (Exception ex) {
&&&&&&&&&&&&&&&&&&&& Log.e("CellInfoManager", ex.getMessage());
&&&&&&&&&&&&& }
&&&&&& class CellInfoListener extends PhoneStateListener {
&&&&&&&&&&&&& CellInfoListener(CellInfoManager manager) {
&&&&&&&&&&&&& }
&&&&&&&&&&&&& public void onCellLocationChanged(CellLocation paramCellLocation) {
&&&&&&&&&&&&&&&&&&&& CellInfoManager.this.valid =
&&&&&&&&&&&&& }
&&&&&&&&&&&&& public void onSignalStrengthChanged(int paramInt) {
&&&&&&&&&&&&&&&&&&&& CellInfoManager.this.asu = paramI
&&&&&&&&&&&&& }
WifiInfoManager
import java.util.ArrayL
import java.util.I
import java.util.L
import org.json.JSONA
import org.json.JSONO
import android.content.C
import android.net.wifi.ScanR
import android.net.wifi.WifiM
import android.util.L
public class WifiInfoManager {
&&&&&& private WifiManager wifiM
&&&&&& public WifiInfoManager(Context paramContext) {
&&&&&&&&&&&&& this.wifiManager = (WifiManager) paramContext.getSystemService(Context.WIFI_SERVICE);
&&&&&& public List&WifiInfo& dump() {
&&&&&&&&&&&&& if (!this.wifiManager.isWifiEnabled()) {
&&&&&&&&&&&&&&&&&&&& return new ArrayList&WifiInfo&();
&&&&&&&&&&&&& }
&&&&&&&&&&&&& android.net.wifi.WifiInfo wifiConnection = this.wifiManager.getConnectionInfo();
&&&&&&&&&&&&& WifiInfo currentWIFI =
&&&&&&&&&&&&& if (wifiConnection != null) {
&&&&&&&&&&&&&&&&&&&& String s = wifiConnection.getBSSID();
&&&&&&&&&&&&&&&&&&&& int i = wifiConnection.getRssi();
&&&&&&&&&&&&&&&&&&&& String s1 = wifiConnection.getSSID();
&&&&&&&&&&&&&&&&&&&& currentWIFI = new WifiInfo(s, i, s1);
&&&&&&&&&&&&& }
&&&&&&&&&&&&& ArrayList&WifiInfo& lsAllWIFI = new ArrayList&WifiInfo&();
&&&&&&&&&&&&& if (currentWIFI != null) {
&&&&&&&&&&&&&&&&&&&& lsAllWIFI.add(currentWIFI);
&&&&&&&&&&&&& }
&&&&&&&&&&&&& List&ScanResult& lsScanResult = this.wifiManager.getScanResults();
&&&&&&&&&&&&& for (ScanResult result : lsScanResult) {
&&&&&&&&&&&&&&&&&&&& WifiInfo scanWIFI = new WifiInfo(result);
&&&&&&&&&&&&& &&&&&& if (!scanWIFI.equals(currentWIFI))
&&&&&&&&&&&&&&&&&&&&&&&&&&& lsAllWIFI.add(scanWIFI);
&&&&&&&&&&&&& }
&&&&&&&&&&&&& return lsAllWIFI;
&&&&&& public boolean isWifiEnabled() {
&&&&&&&&&&&&& return this.wifiManager.isWifiEnabled();
&&&&&& public JSONArray wifiInfo() {
&&&&&&&&&&&&& JSONArray jsonArray = new JSONArray();
&&&&&&&&&&&&& for (WifiInfo wifi : dump()) {
&&&&&&&&&&&&&&&&&&&& JSONObject localJSONObject = ();
&&&&&&&&&&&&&&&&&&&& jsonArray.put(localJSONObject);
&&&&&&&&&&&&& }
&&&&&&&&&&&&& return jsonA
&&&&&& public WifiManager wifiManager() {
&&&&&&&&&&&&& return this.wifiM
&&&&&& public JSONArray wifiTowers() {
&&&&&&&&&&&&& JSONArray jsonArray = new JSONArray();
&&&&&&&&&&&&& try {
&&&&&&&&&&&&&&&&&&&& Iterator&WifiInfo& localObject = dump().iterator();
&&&&&&&&&&&&&&&&&&&& while (true) {
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (!(localObject).hasNext()) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& return jsonA
&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonArray.put(localObject.next().wifi_tower());
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&& } catch (Exception localException) {
&&&&&&&&&&&&&&&&&&&& Log.e("location", localException.getMessage());
&&&&&&&&&&&&& }
&&&&&&&&&&&&& return jsonA
&&&&&& public class WifiInfo implements Comparable&WifiInfo& {
&&&&&&&&&&&&& public int compareTo(WifiInfo wifiinfo) {
&&&&&&&&&&&&&&&&&&&& int i = wifiinfo.dBm;
&&&&&&&&&&&&&&&&&&&& int j = dBm;
&&&&&&&&&&&&&&&&&&&& return i -
&&&&&&&&&&&&& }
&&&&&&&&&&&&& public boolean equals(Object obj) {
&&&&&&&&&&&&&&&&&&&& boolean flag =
&&&&&&&&&&&&&&&&&&&& if (obj == this) {
&&&&&&&&&&&&&&&&&&&&&&&&&&& flag =
&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&& } else {
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (obj instanceof WifiInfo) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& WifiInfo wifiinfo = (WifiInfo)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& int i = wifiinfo.dBm;
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& int j = dBm;
&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&& if (i == j) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& String s = wifiinfo.
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& String s1 =
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if (s.equals(s1)) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& flag =
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& flag =
&&&&&&&&&&&&&&&&&&&&&&&&&&& } else {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& flag =
&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&& }
&&&&&&&&&&&&& public int hashCode() {
&&&&&&&&&&&&&&&&&&&& int i = dBm;
&&&&&&&&&&&&&&&&&&&& int j = bssid.hashCode();
&&&&&&&&&&&&&&&&&&&& return i ^
&&&&&&&&&&&&& }
&&&&&&&&&&&&& public JSONObject info() {
&&&&&&&&&&&&&&&&&&&& JSONObject jsonobject = new JSONObject();
&&&&&&&&&&&&&&&&&&&& try {
&&&&&&&&&&&&&&&&&&&&&&&&&&& String s =
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonobject.put("mac", s);
&&&&&&&&&&&&&&&&&&&&&&&&&&& String s1 =
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonobject.put("ssid", s1);
&&&&&&&&&&&&&&&&&&&&&&&&&&& int i = dBm;
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonobject.put("dbm", i);
&&&&&&&&&&&&&&&&&&&& } catch (Exception ex) {
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&& }
&&&&&&&&&&&&& public JSONObject wifi_tower() {
&&&&&&&&&&&&&&&&&&&& JSONObject jsonobject = new JSONObject();
&&&&&&&&&&&&&&&&&&&& try {
&&&&&&&&&&&&&&&&&&&&&&&&&&& String s =
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonobject.put("mac_address", s);
&&&&&&&&&&&&&&&&&&&&&&&&&&& int i = dBm;
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonobject.put("signal_strength", i);
&&&&&&&&&&&&&&&&&&&&&&&&&&& String s1 =
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonobject.put("ssid", s1);
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonobject.put("age", 0);
&&&&&&&&&&&&&&&&&&&& } catch (Exception ex) {
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&& }
&&&&&&&&&&&&& public final S
&&&&&&&&&&&&& public final int dBm;
&&&&&&&&&&&&& public final S
&&&&&&&&&&&&& public WifiInfo(ScanResult scanresult) {
&&&&&&&&&&&&&&&&&&&& String s = scanresult.BSSID;
&&&&&&&&&&&&&&&&&&&& bssid =
&&&&&&&&&&&&&&&&&&&& int i = scanresult.
&&&&&&&&&&&&&&&&&&&& dBm =
&&&&&&&&&&&&&&&&&&&& String s1 = scanresult.SSID;
&&&&&&&&&&&&&&&&&&&& ssid = s1;
&&&&&&&&&&&&& }
&&&&&&&&&&&&& public WifiInfo(String s, int i, String s1) {
&&&&&&&&&&&&&&&&&&&& bssid =
&&&&&&&&&&&&&&&&&&&& dBm =
&&&&&&&&&&&&&&&&&&&& ssid = s1;
&&&&&&&&&&&&& }
CellLocationManager
import java.util.ArrayL
import java.util.I
import java.util.L
import org.apache.http.HttpE
import org.apache.http.HttpR
import org.apache.http.client.methods.HttpP
import org.apache.http.entity.StringE
import org.apache.http.impl.client.DefaultHttpC
import org.apache.http.util.EntityU
import org.json.JSONA
import org.json.JSONO
import android.content.BroadcastR
import android.content.C
import android.content.I
import android.content.IntentF
import android.net.ConnectivityM
import android.net.NetworkI
import android.net.wifi.WifiM
import android.os.H
import android.os.M
import android.telephony.CellL
import android.util.L
import android.widget.T
import com.google.android.photostream.UserT
public abstract class CellLocationManager {
&&&&&& public static int CHECK_INTERVAL = 15000;
&&&&&& public static boolean ENABLE_WIFI =
&&&&&& private static boolean IS_DEBUG =
&&&&&& private static final int STATE_COLLECTING = 2;
&&&&&& private static final int STATE_IDLE = 0;
&&&&&& private static final int STATE_READY = 1;
&&&&&& private static final int STATE_SENDING = 3;
&&&&&& private static final int MESSAGE_INITIALIZE = 1;
&&&&&& private static final int MESSAGE_COLLECTING_CELL = 2;
&&&&&& private static final int MESSAGE_COLLECTING_WIFI = 5;
&&&&&& private static final int MESSAGE_BEFORE_FINISH = 10;
&&&&&& private CellInfoManager cellInfoM
&&&&&& private C
&&&&&& private boolean disableWifiAfterS
&&&&&& private int[] aryGsmC
&&&&&& pri
&&&&&& priv
&&&&&& private MyL
&&&&&& private final BroadcastR
&&&&&& private long startScanT
&&&&&& private T
&&&&&& private boolean waiting4WifiE
&&&&&& private WifiInfoManager wifiM
&&&&&& public CellLocationManager(Context context, CellInfoManager cellinfomanager, WifiInfoManager wifiinfomanager) {
&&&&&&&&&&&&& receiver = new CellLocationManagerBroadcastReceiver();
&&&&&&&&&&&&& this.context = context.getApplicationContext();
&&&&&&&&&&&&& cellInfoManager =
&&&&&&&&&&&&& wifiManager =
&&&&&& private void debug(Object paramObject) {
&&&&&&&&&&&&& if (IS_DEBUG) {
&&&&&&&&&&&&&&&&&&&& System.out.println(paramObject);
&&&&&&&&&&&&&&&&&&&& String str = String.valueOf(paramObject);
&&&&&&&&&&&&&&&&&&&& Toast.makeText(this.context, str, Toast.LENGTH_SHORT).show();
&&&&&&&&&&&&& }
&&&&&& public int accuracy() {
&&&&&&&&&&&&& return this.
&&&&&& public double latitude() {
&&&&&&&&&&&&& return this.
&&&&&& public double longitude() {
&&&&&&&&&&&&& return this.
&&&&&& public abstract void onLocationChanged();
&&&&&& public void pause() {
&&&&&&&&&&&&& if (state & 0 && !paused) {
&&&&&&&&&&&&&&&&&&&& looper.removeMessages(MESSAGE_BEFORE_FINISH);
&&&&&&&&&&&&&&&&&&&& paused =
&&&&&&&&&&&&& }
&&&&&& public void requestUpdate() {
&&&&&&&&&&&&& if (state != STATE_READY) {
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&& }
&&&&&&&&&&&&& boolean bStartScanSuccessful =
&&&&&&&&&&&&& CellLocation.requestLocationUpdate();
&&&&&&&&&&&&& state = STATE_COLLECTING;
&&&&&&&&&&&&& looper.sendEmptyMessage(MESSAGE_INITIALIZE);
&&&&&&&&&&&&& if (wifiManager.wifiManager().isWifiEnabled()) {
&&&&&&&&&&&&&&&&&&&& bStartScanSuccessful = wifiManager.wifiManager().startScan();
&&&&&&&&&&&&&&&&&&&& waiting4WifiEnable =
&&&&&&&&&&&&& } else {
&&&&&&&&&&&&&&&&&&&& startScanTimestamp = System.currentTimeMillis();
&&&&&&&&&&&&&&&&&&&& if (!ENABLE_WIFI || !wifiManager.wifiManager().setWifiEnabled(true)) {
&&&&&&&&&&&&&&&&&&&&&&&&&&& int nDelay = 0;
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (!bStartScanSuccessful)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& nDelay = 8000;
&&&&&&&&&&&&&&&&&&&&&&&&&&& looper.sendEmptyMessageDelayed(MESSAGE_COLLECTING_WIFI, nDelay);
&&&&&&&&&&&&&&&&&&&&&&&&&&& debug("CELL UPDATE");
&&&&&&&&&&&&&&&&&&&& } else {
&&&&&&&&&&&&&&&&&&&&&&&&&&& waiting4WifiEnable =
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&& }
&&&&&& public void resume() {
&&&&&&&&&&&&& if (state & 0 && paused) {
&&&&&&&&&&&&&&&&&&&& paused =
&&&&&&&&&&&&&&&&&&&& looper.removeMessages(MESSAGE_BEFORE_FINISH);
&&&&&&&&&&&&&&&&&&&& looper.sendEmptyMessage(MESSAGE_BEFORE_FINISH);
&&&&&&&&&&&&& }
&&&&&& public void start() {
&&&&&&&&&&&&& if (state &= STATE_IDLE) {
&&&&&&&&&&&&&&&&&&&& Log.i("CellLocationManager", "Starting...");
&&&&&&&&&&&&&&&&&&&& context.registerReceiver(receiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
&&&&&&&&&&&&&&&&&&&& context.registerReceiver(receiver, new IntentFilter(WifiManager.WIFI_STATE_CHANGED_ACTION));
&&&&&&&&&&&&&&&&&&&& looper = new MyLooper();
&&&&&&&&&&&&&&&&&&&& state = STATE_READY;
&&&&&&&&&&&&&&&&&&&& paused =
&&&&&&&&&&&&&&&&&&&& waiting4WifiEnable =
&&&&&&&&&&&&&&&&&&&& disableWifiAfterScan =
&&&&&&&&&&&&&&&&&&&& debug("CELL LOCATION START");
&&&&&&&&&&&&&&&&&&&& requestUpdate();
&&&&&&&&&&&&& }
&&&&&& public void stop() {
&&&&&&&&&&&&& if (state & STATE_IDLE) {
&&&&&&&&&&&&&&&&&&&& context.unregisterReceiver(receiver);
&&&&&&&&&&&&&&&&&&&& debug("CELL LOCATION STOP");
&&&&&&&&&&&&&&&&&&&& looper =
&&&&&&&&&&&&&&&&&&&& state = STATE_IDLE;
&&&&&&&&&&&&&&&&&&&& if (disableWifiAfterScan) {
&&&&&&&&&&&&&&&&&&&&&&&&&&& disableWifiAfterScan =
&&&&&&&&&&&&&&&&&&&&&&&&&&& wifiManager.wifiManager().setWifiEnabled(false);
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&& }
&&&&&& public long timestamp() {
&&&&&&&&&&&&& return this.
&&&&&& protected boolean isConnectedWithInternet() {
&&&&&&&&&&&&& ConnectivityManager conManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
&&&&&&&&&&&&& NetworkInfo networkInfo = conManager.getActiveNetworkInfo();
&&&&&&&&&&&&& if (networkInfo != null) {
&&&&&&&&&&&&&&&&&&&& return networkInfo.isAvailable();
&&&&&&&&&&&&& }
&&&&&&&&&&&&&
&&&&&& private class MyLooper extends Handler {
&&&&&&&&&&&&& private float fCellS
&&&&&&&&&&&&& private JSONArray objCellTowersJ
&&&&&&&&&&&&& public void handleMessage(Message paramMessage) {
&&&&&&&&&&&&&&&&&&&& if(CellLocationManager.this.looper != this)
&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&& boolean flag =
&&&&&&&&&&&&&&&&&&&& switch (paramMessage.what) {
&&&&&&&&&&&&&&&&&&&& default:
&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&& case MESSAGE_INITIALIZE:
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.objCellTowersJson =
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.fCellScore = 1.5F;
&&&&&&&&&&&&&&&&&&&& case MESSAGE_COLLECTING_CELL:
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (CellLocationManager.this.state != CellLocationManager.STATE_COLLECTING)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&& JSONArray objCellTowers = CellLocationManager.this.cellInfoManager.cellTowers();
&&&&&&&&&&&&&&&&&&&&&&&&&&& float fCellScore = CellLocationManager.this.cellInfoManager.score();
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (objCellTowers != null) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& float fCurrentCellScore = this.fCellS
&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&& if (fCellScore & fCurrentCellScore) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& this.objCellTowersJson = objCellT
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& this.fCellScore = fCellS
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.sendEmptyMessageDelayed(MESSAGE_COLLECTING_CELL, 600L);
&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&& case MESSAGE_COLLECTING_WIFI:
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (CellLocationManager.this.state != CellLocationManager.STATE_COLLECTING)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.removeMessages(MESSAGE_COLLECTING_CELL);
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.removeMessages(MESSAGE_BEFORE_FINISH);
//&&&&&&&&&&&&&&&&&&&&&&&&& if (CellLocationManager.this.disableWifiAfterScan && CellLocationManager.this.wifiManager.wifiManager().setWifiEnabled(true))
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.disableWifiAfterScan =
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.state = CellLocationManager.STATE_SENDING;
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (CellLocationManager.this.task != null)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.task.cancel(true);
&&&&&&&&&&&&&&&&&&&&&&&&&&& int[] aryCell =
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (CellLocationManager.this.cellInfoManager.isGsm())
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& aryCell = CellLocationManager.this.cellInfoManager.dumpCells();
&&&&&&&&&&&&&&&&&&&&&&&&&&& int nBid = CellLocationManager.this.cellInfoManager.bid();
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.task = new CellLocationManager.Task(aryCell, nBid);
&&&&&&&&&&&&&&&&&&&&&&&&&&& JSONArray[] aryJsonArray = new JSONArray[2];
&&&&&&&&&&&&&&&&&&&&&&&&&&& aryJsonArray[0] = this.objCellTowersJ
&&&&&&&&&&&&&&&&&&&&&&&&&&& aryJsonArray[1] = CellLocationManager.this.wifiManager.wifiTowers();
&&&&&&&&&&&&&&&&&&&&&&&&&&& if(this.objCellTowersJson != null)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& Log.i("CellTownerJSON", this.objCellTowersJson.toString());
&&&&&&&&&&&&&&&&&&&&&&&&&&& if(aryJsonArray[1] != null)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& Log.i("WIFITownerJSON", aryJsonArray[1].toString());
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.debug("Post json");
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.task.execute(aryJsonArray);
&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&& case MESSAGE_BEFORE_FINISH:
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (CellLocationManager.this.state != CellLocationManager.STATE_READY || CellLocationManager.this.paused)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&& // L7
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (CellLocationManager.this.disableWifiAfterScan && CellLocationManager.this.wifiManager.wifiManager().setWifiEnabled(false))
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.disableWifiAfterScan =
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (!CellLocationManager.this.cellInfoManager.isGsm()) {
&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&& // L9
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if (CellLocationManager.this.bid == CellLocationManager.this.cellInfoManager.bid()) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& flag =
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& } else {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& flag =
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // L14
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if (flag) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& requestUpdate();
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& } else {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& this.sendEmptyMessageDelayed(10, CellLocationManager.CHECK_INTERVAL);
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&& } else {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // L8
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if (CellLocationManager.this.aryGsmCells == null || CellLocationManager.this.aryGsmCells.length == 0) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // L10
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& flag =
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& } else {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& int[] aryCells = CellLocationManager.this.cellInfoManager.dumpCells();
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if (aryCells != null && aryCells.length != 0) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // L13
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& int nFirstCellId = CellLocationManager.this.aryGsmCells[0];
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if (nFirstCellId == aryCells[0]) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // L16
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& int cellLength = CellLocationManager.this.aryGsmCells.length / 2;
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& List&Integer& arraylist = new ArrayList&Integer&(cellLength);
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& List&Integer& arraylist1 = new ArrayList&Integer&(aryCells.length / 2);
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& int nIndex = 0;
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& int nGSMCellLength = CellLocationManager.this.aryGsmCells.
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& while (nIndex & nGSMCellLength) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // goto L18
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& arraylist.add(CellLocationManager.this.aryGsmCells[nIndex]);
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& nIndex += 2;
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // goto L17
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&& nIndex = 0;
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& while (nIndex & aryCells.length) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // goto L20
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& arraylist1.add(aryCells[nIndex]);
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& nIndex += 2;
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // goto L19
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& int nCounter = 0;
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& for(Iterator&Integer& iterator = arraylist.iterator(); iterator.hasNext();) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // goto L22
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if (arraylist1.contains(iterator.next()))
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& nCounter++;
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // goto L21
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& int k4 = arraylist.size() - nC
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& int l4 = arraylist1.size() - nC
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if (k4 + l4 & nCounter)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& flag =
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& else
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& flag =
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if (flag) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& StringBuilder stringbuilder = new StringBuilder(k4).append(" + ");
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& stringbuilder.append(l4).append(" & ");
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& stringbuilder.append(nCounter);
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.debug(stringbuilder.toString());
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& } else {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // L15
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& flag =
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.debug("PRIMARY CELL CHANGED");
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // goto L14
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&& if (flag) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& requestUpdate();
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& } else {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& this.sendEmptyMessageDelayed(MESSAGE_BEFORE_FINISH, CellLocationManager.CHECK_INTERVAL);
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& } else {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // L12
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& flag =
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // goto L14
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if (flag) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& requestUpdate();
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& } else {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&& this.sendEmptyMessageDelayed(MESSAGE_BEFORE_FINISH,CellLocationManager.CHECK_INTERVAL);
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&& }
&&&&&& class Task extends UserTask&JSONArray, Void, Void& {
&&&&&&&&&&&&&
&&&&&&&&&&&&&
&&&&&&&&&&&&& int[]
&&&&&&&&&&&&&
&&&&&&&&&&&&&
&&&&&&&&&&&&&
&&&&&&&&&&&&& public Task(int[] aryCell, int bid) {
&&&&&&&&&&&&&&&&&&&& this.time = System.currentTimeMillis();
&&&&&&&&&&&&&&&&&&&& this.cells = aryC
&&&&&&&&&&&&&&&&&&&& this.bid =
&&&&&&&&&&&&& }
&&&&&&&&&&&&& public Void doInBackground(JSONArray[] paramArrayOfJSONArray) {
&&&&&&&&&&&&&&&&&&&& try {
&&&&&&&&&&&&&&&&&&&&&&&&&&& JSONObject jsonObject = new JSONObject();
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonObject.put("version", "1.1.0");
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonObject.put("host", "");
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonObject.put("address_language", "zh_CN");
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonObject.put("request_address", true);
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonObject.put("radio_type", "gsm");
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonObject.put("carrier", "HTC");
&&&&&&&&&&&&&&&&&&&&&&&&&&& JSONArray cellJson = paramArrayOfJSONArray[0];
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonObject.put("cell_towers", cellJson);
&&&&&&&&&&&&&&&&&&&&&&&&&&& JSONArray wifiJson = paramArrayOfJSONArray[1];
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonObject.put("wifi_towers", wifiJson);
&&&&&&&&&&&&&&&&&&&&&&&&&&& DefaultHttpClient localDefaultHttpClient = new DefaultHttpClient();
&&&&&&&&&&&&&&&&&&&&&&&&&&& HttpPost localHttpPost = new HttpPost("/loc/json");
&&&&&&&&&&&&&&&&&&&&&&&&&&& String strJson = jsonObject.toString();
&&&&&&&&&&&&&&&&&&&& &&&&&& StringEntity objJsonEntity = new StringEntity(strJson);
&&&&&&&&&&&&&&&&&&&&&&&&&&& localHttpPost.setEntity(objJsonEntity);
&&&&&&&&&&&&&&&&&&&&&&&&&&& HttpResponse objResponse = localDefaultHttpClient.execute(localHttpPost);
&&&&&&&&&&&&&&&&&&&&&&&&&&& int nStateCode = objResponse.getStatusLine().getStatusCode();
&&&&&&&&&&&&&&&&&&&&&&&&&&& HttpEntity httpEntity = objResponse.getEntity();
&&&&&&&&&&&&&&&&&&&&&&&&&&& byte[] arrayOfByte =
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (nStateCode / 100 == 2)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& arrayOfByte = EntityUtils.toByteArray(httpEntity);
&&&&&&&&&&&&&&&&&&&&&&&&&&& httpEntity.consumeContent();
&&&&&&&&&&&&&&&&&&&&&&&&&&& String strResponse = new String(arrayOfByte, "UTF-8");
&&&&&&&&&&&&&&&&&&&&&&&&&&& jsonObject = new JSONObject(strResponse);
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.lat = jsonObject.getJSONObject("location").getDouble("latitude");
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.lng = jsonObject.getJSONObject("location").getDouble("longitude");
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.accuracy = jsonObject.getJSONObject("location").getInt("accuracy");;
&&&&&&&&&&&&&&&&&&&& } catch (Exception localException) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&& }
&&&&&&&&&&&&& public void onPostExecute(Void paramVoid) {
&&&&&&&&&&&&&&&&&&&& if (CellLocationManager.this.state != CellLocationManager.STATE_SENDING || CellLocationManager.this.task != this)
&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&& if ((this.lat != 0.0D) && (this.lng != 0.0D)) {
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.timestamp = this.
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.latitude = this.
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.longitude = this.
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.accuracy = this.
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.aryGsmCells = this.
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.bid = this.
&&&&&&&&&&&&&&&&&&&&&&&&&&& StringBuilder sb = new StringBuilder("CELL LOCATION DONE: (");
&&&&&&&&&&&&&&&&&&&&&&&&&&& sb.append(this.lat).append(",").append(this.lng).append(")");
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.debug(sb.toString());
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.state = STATE_READY;
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.looper.sendEmptyMessageDelayed(MESSAGE_BEFORE_FINISH, CellLocationManager.CHECK_INTERVAL);
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.onLocationChanged();
&&&&&&&&&&&&&&&&&&&& } else {
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.task =
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.state = CellLocationManager.STATE_READY;
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.looper.sendEmptyMessageDelayed(MESSAGE_BEFORE_FINISH, 5000L);
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&& }
&&&&&& private class CellLocationManagerBroadcastReceiver extends BroadcastReceiver {
&&&&&&&&&&&&& @Override
&&&&&&&&&&&&& public void onReceive(Context arg0, Intent intent) {
&&&&&&&&&&&&&&&&&&&& // access$0 state
&&&&&&&&&&&&&&&&&&&& // 1 debug
&&&&&&&&&&&&&&&&&&&& // access$2 loop
&&&&&&&&&&&&&&&&&&&& // 3 startScanTimestamp
&&&&&&&&&&&&&&&&&&&& // 4 disableWifiAfterScan
&&&&&&&&&&&&&&&&&&&& // 5 wifimanager
&&&&&&&&&&&&&&&&&&&& if (CellLocationManager.this.state != CellLocationManager.STATE_COLLECTING)
&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&& String s = intent.getAction();
&&&&&&&&&&&&&&&&&&&& if (WifiManager.SCAN_RESULTS_AVAILABLE_ACTION.equals(s)) { // goto _L4; else goto _L3
&&&&&&&&&&&&&&&&&&&& // _L3:
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.debug("WIFI SCAN COMPLETE");
&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.looper.removeMessages(MESSAGE_COLLECTING_WIFI);
&&&&&&&&&&&&&&&&&&&&&&&&&&& long lInterval = System.currentTimeMillis() - CellLocationManager.this.startScanT
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (lInterval & 4000L)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.looper.sendEmptyMessageDelayed(MESSAGE_COLLECTING_WIFI, 4000L);
&&&&&&&&&&&&&&&&&&&&&&&&&&& else
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.looper.sendEmptyMessage(MESSAGE_COLLECTING_WIFI);
&&&&&&&&&&&&&&&&&&&& } else {
&&&&&&&&&&&&&&&&&&&&&&&&&&& // _L4:
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (!CellLocationManager.this.waiting4WifiEnable)
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&& String s1 = intent.getAction();
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (!WifiManager.WIFI_STATE_CHANGED_ACTION.equals(s1))
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&& int wifiState = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, 4);
&&&&&&&&&&&&&&&&&&&&&&&&&&& // _L5:
&&&&&&&&&&&&&&&&&&&&&&&&&&& if (wifiState == WifiManager.WIFI_STATE_ENABLING) {
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& boolean flag2 = CellLocationManager.this.wifiManager.wifiManager().startScan();
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // _L8:
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.disableWifiAfterScan =
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.paused =
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& int i = flag2 ? 1 : 0;
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& int nDelay = i != 0 ? 8000 : 0;
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& CellLocationManager.this.looper.sendEmptyMessageDelayed(MESSAGE_COLLECTING_WIFI, nDelay);
&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&& CellLocationManager.this.debug("WIFI ENABLED");
&&&&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&& }
调用方法:
&&&&&& CellInfoManager cellManager = new CellInfoManager(this);
&&&&&&&&&&&&& WifiInfoManager wifiManager = new WifiInfoManager(this);
&&&&&&&&&&&&& CellLocationManager locationManager = new CellLocationManager(this, cellManager, wifiManager) {
&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&& @Override
&&&&&&&&&&&&&&&&&&&& public void onLocationChanged() {
&&&&&&&&&&&&&&&&&&&&&&&&&&& txtAutoNaviInfo.setText(this.latitude() + "-" + this.longitude());
&&&&&&&&&&&&&&&&&&&&&&&&&&& this.stop();
&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&& };
&&&&&&&&&&&&& locationManager.start();
如果还想同时使用GPS定位,其实也很简单,可以和FourSquare提供的BestLocationListener结合起来,将上面那段代码添加到BestLocationListener的register方法里:
&public void register(LocationManager locationManager, boolean gps, Context context) {
&&&&&&& if (DEBUG) Log.d(TAG, "Registering this location listener: " + this.toString());
&&&&&&& long updateMinTime = SLOW_LOCATION_UPDATE_MIN_TIME;
&&&&&&& long updateMinDistance = SLOW_LOCATION_UPDATE_MIN_DISTANCE;
&&&&&&& if (gps) {
&&&&&&&&&&& updateMinTime = LOCATION_UPDATE_MIN_TIME;
&&&&&&&&&&& updateMinDistance = LOCATION_UPDATE_MIN_DISTANCE;
&&&&&&& List&String& providers = locationManager.getProviders(true);
&&&&&&& int providersCount = providers.size();
&&&&&&& if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) && !locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)){
&&&&&&& &&&&&& setChanged();
&&&&&&& &&&&&& notifyObservers(null);
&&&&&&& for (int i = 0; i & providersC i++) {
&&&&&&&&&&& String providerName = providers.get(i);
&&&&&&&&&&& if (locationManager.isProviderEnabled(providerName)) {
&&&&&&&&&&&&&&& updateLocation(locationManager.getLastKnownLocation(providerName));
&&&&&&&&&&& }
&&&&&&&&&&& // Only register with GPS if we've explicitly allowed it.
&&&&&&&&&&& if (gps || !LocationManager.GPS_PROVIDER.equals(providerName)) {
&&&&&&&&&&&&&&& locationManager.requestLocationUpdates(providerName, updateMinTime,
&&&&&&&&&&&&&&&&&&&&&&& updateMinDistance, this);
&&&&&&&&&&& }
&&&&&&&&&&&
&&&&&&& if(cellLocationManager == null) {
&&&&&&& &&&&&& CellInfoManager cellManager = new CellInfoManager(context);
&&&& &&&&&&&&&&& WifiInfoManager wifiManager = new WifiInfoManager(context);
&&&& &&&&&&&&&&& cellLocationManager = new CellLocationManager(context, cellManager, wifiManager) {
&&&& &&&&&&&&&&&&&&&&&& @Override
&&&& &&&&&&&&&&&&&&&&&& public void onLocationChanged() {
&&&& &&&&&&&&&&&&&&&&&&&&&&&&& if ((latitude() == 0.0D) || (longitude() == 0.0D))
&&&& &&&&&&&&&&&&&&&&&&&&&&&&& Location result = new Location("CellLocationManager");
&&&& &&&&&&&&&&&&&&&&&&&&&&&&& result.setLatitude(latitude());
&&&& &&&&&&&&&&&&&&&&&&&&&&&&& result.setLongitude(longitude());
&&&& &&&&&&&&&&&&&&&&&&&&&&&&& result.setAccuracy(accuracy());
&&&& &&&&&&&&&&&&&&&&&&&&&&&&& onBestLocationChanged(result);
&&&& &&&&&&&&&&&&&&&&&&&&&&&&& this.stop();
&&&& &&&&&&&&&&&&&&&&&& }
&&&& &&&&&&&&&&& };
&&&&&&& //cellLocationManager.stop();
&&&&&&& cellLocationManager.start();
//&&&&&&& LocationController controller = LocationController.requestLocationUpdates("", updateMinTime,updateMinDistance, this, context);
//&&&&&&& controller.requestCurrentLocation();
有疑问的请发邮件到里讨论一下。

我要回帖

更多关于 安卓实现自动定位城市 的文章

 

随机推荐