当前位置: 代码迷 >> Android >> 开发手机定位App,该如何解决
  详细解决方案

开发手机定位App,该如何解决

热度:3   发布时间:2016-04-28 06:58:41.0
开发手机定位App
最近想开发一个手机定位功能,在网上搜了一下,一般都是收费的。
请问各位有没有什么好的意见,或者好的可以参考的网站。
谢谢!!!

------解决方案--------------------
可以调用Google的定位服务
------解决方案--------------------
楼主有好方法艾特我下
------解决方案--------------------
http://www.slmsn.com

仅供参考
------解决方案--------------------
这个网站的原理不就是通过GPS或者基站来定位吗 这个很简单啊
------解决方案--------------------
引用:
可以调用Google的定位服务
你记得下载Google的API 
------解决方案--------------------
这有什么难的啊,你是自己测试还是商用?
定位的,不管是google官方调gps api,还是百度地图,都是有偏差的。
如果仅仅是测试,就用google官方的就好了,如果是商用,你需要去购买一份LBS纠偏数据,不然偏差不是一般的大。
------解决方案--------------------
import java.util.Map;
import org.json.JSONObject;
import android.app.Activity;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import com.baidu.location.BDLocation;
import com.baidu.location.BDLocationListener;
import com.baidu.location.LocationClient;
import com.baidu.location.LocationClientOption;
import com.baidu.platform.comapi.basestruct.GeoPoint;
import com.taocaiku.gaea.common.TckApp;
import com.taocaiku.gaea.domain.Domain;
import com.taocaiku.gaea.domain.Json;
import com.taocaiku.gaea.domain.Region;
import com.taocaiku.gaea.domain.context.Container;
import com.taocaiku.gaea.domain.context.OtherUrls;
import com.taocaiku.gaea.domain.context.TckUrls;
import com.taocaiku.gaea.service.BackupService;
import com.taocaiku.gaea.service.SellerMarketService;

/**
 * 手机坐标定位的工具类
 * @author TCK-001
 * @version 1.0
 */
public final class PointUtil {

private PointUtil() {}
private static PointUtil bean = new PointUtil();
private double[] myPoint = new double[3];

/** 天安门的坐标 */
public static final GeoPoint CENTER_POINT = new GeoPoint((int) (39.945d * 1E6), (int) (116.404d * 1E6));

/**
 * 单例模式获得bean
 * @return FileUtil
 */
public static PointUtil get() {
return bean;
}

private LocationListener listener = new LocationListener() {

public void onStatusChanged(String provider, int status, Bundle extras) {
}

public void onProviderEnabled(String provider) {
}

public void onProviderDisabled(String provider) {
}

public void onLocationChanged(Location location) {
if (location != null) {
double[] old = myPoint;
myPoint = new double[] { location.getLongitude(), location.getLatitude(), location.getAltitude() };
if (old[0] != myPoint[0] 
------解决方案--------------------
 old[1] != myPoint[1]) {
if (MapUtil.get().getDistance(old, myPoint) > 100d) {
editMemberPoint();
}
if (MapUtil.get().getDistance(old, myPoint) > 1000d) {
SellerMarketService.get().editDistance();
}
if (MapUtil.get().getDistance(old, myPoint) > 10000d 
------解决方案--------------------
 ToolUtil.get().isBlank(Container.city)) {
getCity();
}
doCallback();
}
}
}

};

private BDLocationListener baiduListener = new BDLocationListener() {

public void onReceivePoi(BDLocation location) {
if (null == location) {return;}
}

public void onReceiveLocation(BDLocation location) {
if (location != null) {
double[] old = myPoint;
myPoint = new double[] { location.getLongitude(), location.getLatitude(), location.getAltitude() };
if (old[0] != myPoint[0] 
  相关解决方案