Skip to content

Instantly share code, notes, and snippets.

Newtron Labs NewtronLabs

Block or report user

Report or block NewtronLabs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@NewtronLabs
NewtronLabs / build.gradle
Created May 18, 2019
Android Gradle Setup
View build.gradle
buildscript {
repositories {
jcenter()
maven { url "http://code.newtronlabs.com:8081/artifactory/libs-release-local" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.newtronlabs.android:plugin:2.0.4-alpha'
}
}
View app.gradle
dependencies {
compileOnly 'com.newtronlabs.easypermissions:easypermissions:2.8.2'
}
@NewtronLabs
NewtronLabs / EasyPermissionsExample1.kt
Last active May 18, 2019
Easy Permissions Example 1 Kotlin
View EasyPermissionsExample1.kt
class ExampleService : Service(), IPermissionsListener {
override fun onCreate() {
super.onCreate()
// Will request all permissions from the Manifest automatically.
EasyPermissions.getInstance().requestPermissions(this)
}
override fun onCompleted(grantedPermissions: Set<String>, deniedPermissions: Set<String>) {}
@NewtronLabs
NewtronLabs / EasyPermissionsExample1.java
Created May 18, 2019
Easy Permissions Example 1 Java
View EasyPermissionsExample1.java
public class ExampleService extends Service implements IPermissionsListener {
@Override
public void onCreate() {
super.onCreate();
// Will request all permissions from the Manifest automatically.
EasyPermissions.getInstance().requestPermissions(this);
}
@Override
@NewtronLabs
NewtronLabs / EasyPermissionsExample2.kt
Last active May 18, 2019
Easy Permissions Example 2 Kotlin
View EasyPermissionsExample2.kt
EasyPermissions.getInstance().requestPermissions(this,
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.CAMERA,
Manifest.permission.CALL_PHONE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
)
@NewtronLabs
NewtronLabs / EasyPermissionsExample2.java
Created May 18, 2019
Easy Permissions Example 2 Java
View EasyPermissionsExample2.java
EasyPermissions.getInstance().requestPermissions(this,
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.CAMERA,
Manifest.permission.CALL_PHONE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
);
You can’t perform that action at this time.