Skip to content

Android定位,基于百度基础定位sdk封装。可直接使用。

License

Notifications You must be signed in to change notification settings

yangjiantao/AndroidLocationLib

Repository files navigation

AndroidLocationLib

Android定位,基于百度基础定位sdk封装。可直接使用。

Demo Screen Capture

Useage

1. build.gradle 文件中替换你的appkey

manifestPlaceholders = [BAIDU_LBS_API_KEY:"D6xB5kxgyxBIQa2tkxmyGvYO"]//your debug app key

2. 业务定位

        //初始化
        locateHelper = new LocationHelper.Builder(getApplicationContext())
                .setScanSpan(0)
                .setIsNeedLocationDescribe(true).build();

        //设置回调监听
        locateHelper.registerLocationListener(mLocationListener);
        RxPermissions rxPermissions = new RxPermissions(this);
        rxPermissions.request(Manifest.permission.ACCESS_FINE_LOCATION)
                .subscribe(new Action1<Boolean>() {
                    @Override
                    public void call(Boolean aBoolean) {
                        if(aBoolean){
                            //开始定位
                            locateHelper.start();
                        }else{
                            Log.e("MainActivity", "watchLocation request locate permission denied ");
                        }
                    }
                });
                

About

Android定位,基于百度基础定位sdk封装。可直接使用。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages