Git Product home page Git Product logo

mapmock's Introduction

功能

集成后会在桌面添加一个 MapMock 的图标,点击后可定位,再进入自己的应用,执行定位后拿到的就是自己点击的位置信息。

集成

  1. build.gradle 引入:
// 根 build.gradle
allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

// app build.gradle
dependencies {
    implementation 'com.github.Gdeeer.MapMock:mapmock:0.1.0'
}
  1. 在高德地图的定位回调里添加拦截:
public void onLocationChanged(AMapLocation aMapLocation) {
    MapMock.handleRealLocation(aMapLocation);
}
  1. 在 AndroidManifest.xml 里写入高德的 key(需要自己去申请):
<meta-data
    android:name="com.amap.api.v2.apikey"
    android:value="xxxx">
</meta-data>
  1. 如果需要在 release 中使用,记得混淆:
-keep class com.amap.api.location.**{*;}
-keep class com.amap.api.fence.**{*;}
-keep class com.autonavi.aps.amapapi.model.**{*;}
  1. 如果只需要在 debug 包里使用 MapMock 的功能,release 不做处理:
// debug 时,执行拦截
debugImplementation 'com.github.Gdeeer.MapMock:mapmock:0.1.0'
// release 时,不执行拦截
releaseImplementation 'com.github.Gdeeer.MapMock:mapmocknoop:0.1.0'

mapmock's People

Contributors

gdeeer avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.