码迷,mamicode.com
首页 > 移动开发 > 详细

"Hello osmdroid World"手机GPS轨迹数据

时间:2021-07-01 16:54:55      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:class   manifest   clu   cti   android   git   int   time   miss   

osmdroid‘s MapView is basically a replacement for Google‘s MapView class. First of all, create your Android project, and follow HowToMaven if you‘re using Maven, or follow HowToGradle if you‘re using Gradle/Android Studio. This will help you get the binaries for osmdroid included in your project.

Manifest

In most cases, you will have to set the following authorizations in your AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"  />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

If you are only using parts of the library, you can adjust the permissions accordingly.

Online tile provider

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"  />

Offline tile provider and storing tiles

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Location provider

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

Android 6.0+ devices require you have to check for "dangerous" permissions at runtime.
osmdroid requires the following dangerous permissions:
WRITE_EXTERNAL_STORAGE and ACCESS_COARSE_LOCATION/ACCESS_FINE_LOCATION.
See OpenStreetMapViewer‘s implementation or Google Documentation on Permissions

 

"Hello osmdroid World"手机GPS轨迹数据

标签:class   manifest   clu   cti   android   git   int   time   miss   

原文地址:https://www.cnblogs.com/2008nmj/p/14957283.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!