Skip to content

Instantly share code, notes, and snippets.

View sebastianknopf's full-sized avatar

Sebastian Knopf sebastianknopf

View GitHub Profile
@sebastianknopf
sebastianknopf / OsmSample.java
Created October 29, 2018 19:05
using osmdroid without external storage permission
// activity code goes here
// ...
/*
* To avoid the normally required permission ACCESS_EXTERNAL_STORAGE the osmdroid library
* offers a way to change the base path and the caching path to any other directory.
* We change these directories before initializing our MapView object, so osmdroid
* will NOT need the permission called above.
*
* Note that directories are also objects of type File in Java!
@sebastianknopf
sebastianknopf / PermissionsActivity.java
Last active October 29, 2018 10:31
simple practice for requesting dangerous permissions at runtime in android app
// package ... ;
// import ... ;
/*
* Since Android M has been introduced, apps have the possibility to request critical
* permissions at runtime - the Android Support Library provides several
* methods to achieve this.
* This gist is a simple example activitiy to show how to request the critical
* location permission from a simple android app at runtime.
*/