// --- Mock provider support ---
// TODO: It would be fantastic to deprecate mock providers entirely, and replace
// with something closer to LocationProviderBase.java
/**
* Creates a mock location provider and adds it to the set of active providers.
*
* @param name the provider name
*
* @throws SecurityException if {@link android.app.AppOpsManager#OPSTR_MOCK_LOCATION
* mock location app op} is not set to {@link android.app.AppOpsManager#MODE_ALLOWED
* allowed} for your app.
* @throws IllegalArgumentException if a provider with the given name already exists
*/
public void addTestProvider(String name, boolean requiresNetwork, boolean requiresSatellite,
boolean requiresCell, boolean hasMonetaryCost, boolean supportsAltitude,
boolean supportsSpeed, boolean supportsBearing, int powerRequirement, int accuracy) {
ProviderProperties properties = new ProviderProperties(requiresNetwork,
requiresSatellite, requiresCell, hasMonetaryCost, supportsAltitude, supportsSpeed,
supportsBearing, powerRequirement, accuracy);
if (name.matches(LocationProvider.BAD_CHARS_REGEX)) {
throw new IllegalArgumentException("provider name contains illegal character: " + name);
}
try {
mService.addTestProvider(name, properties, mContext.getOpPackageName());
} catch (RemoteException e) {
Log.e(TAG, "RemoteException", e);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
android 模拟位置信息Location使用示例
共35个文件
xml:9个
java:6个
png:5个
3星 · 超过75%的资源 需积分: 31 109 下载量 35 浏览量
2017-05-31
23:17:43
上传
评论 3
收藏 1.05MB RAR 举报
温馨提示
android 模拟位置信息Location使用示例,。我的博客地址:http://blog.csdn.net/qq_16064871。欢迎关注,源码多多的博客。
资源推荐
资源详情
资源评论
收起资源包目录
gpsTestLocationDemo.rar (35个子文件)
gpsTestLocationDemo
gradlew.bat 2KB
gradlew 5KB
gradle.properties 871B
local.properties 428B
gpslocationdemo
pic
截图201705310531.jpg 25KB
新建文本文档.txt 2KB
截图201705310532.jpg 20KB
截图201705310533.jpg 51KB
gpslocationdemo-debug.apk 1.11MB
proguard-rules.pro 662B
gpslocationdemo.iml 9KB
src
test
java
com
example
gpslocationdemo
ExampleUnitTest.java 334B
androidTest
java
com
example
gpslocationdemo
ApplicationTest.java 370B
main
res
mipmap-xxxhdpi
ic_launcher.png 10KB
drawable
mipmap-hdpi
ic_launcher.png 3KB
values
colors.xml 214B
strings.xml 81B
styles.xml 394B
dimens.xml 216B
mipmap-xxhdpi
ic_launcher.png 8KB
mipmap-mdpi
ic_launcher.png 2KB
mipmap-xhdpi
ic_launcher.png 5KB
layout
activity_location_imitate_test.xml 1020B
activity_main.xml 2KB
activity_location_test.xml 865B
values-w820dp
dimens.xml 364B
java
com
example
gpslocationdemo
LocationTestManager.java 4KB
LocationImitateTestActivity.java 1KB
MainActivity.java 1KB
LocationTestActivity.java 4KB
AndroidManifest.xml 1KB
.gitignore 8B
build.gradle 710B
libs
settings.gradle 26B
build.gradle 567B
共 35 条
- 1
mmsx
- 粉丝: 719
- 资源: 92
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页