Skip to content

Instantly share code, notes, and snippets.

View NewtronLabs's full-sized avatar

Newtron Labs NewtronLabs

View GitHub Profile
@NewtronLabs
NewtronLabs / build.gradle
Last active June 28, 2020 21:37
Android Gradle Setup
buildscript {
repositories {
google()
jcenter()
maven { url "http://code.newtronlabs.com:8081/artifactory/libs-release-local" }
}
dependencies {
classpath "com.android.tools.build:gradle:3.5.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.newtronlabs.android:plugin:4.0.1'
@NewtronLabs
NewtronLabs / app.gradle
Last active June 28, 2020 19:36
App Build Gradle
dependencies {
compileOnly 'com.newtronlabs.easypermissions:easypermissions:4.0.1'
}
@NewtronLabs
NewtronLabs / EasyPermissionsExample1.kt
Last active June 28, 2020 21:16
Easy Permissions Example 1 Kotlin
class ExampleService : Service() {
override fun onCreate() {
super.onCreate()
EasyPermissions.getInstance().requestPermissions(context, IPermissionsListener(
onCompleted = {
}
)
}
@NewtronLabs
NewtronLabs / EasyPermissionsExample1.java
Created May 18, 2019 02:55
Easy Permissions Example 1 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 June 28, 2020 19:34
Easy Permissions Example 2 Kotlin
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
Last active June 28, 2020 19:34
Easy Permissions Example 2 Java
EasyPermissions.getInstance().requestPermissions(
this,
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.CAMERA,
Manifest.permission.CALL_PHONE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
);
@NewtronLabs
NewtronLabs / Newtron Labs Library License.md
Last active March 11, 2023 01:12
Newtron Labs Library License

Newtron Labs Library License

This Newtron Labs library, binaries and source code can only be used in accordance with Freeware license. That is, freeware may be used without payment, but may not be modified. The developer of the library retains all rights to change, alter, adapt, and/or distribute the software. Newtron Labs is not liable for any damages and/or losses incurred during the use of one of its libraries.

You may not decompile, reverse engineer, pull apart, or otherwise attempt to dissect the source code, algorithm, technique or other information from the binary code of a Newtron Labs’ library unless it is authorized by existing applicable law and only to the extent authorized by such law. In the event that such a law applies, user may only attempt the foregoing if: (1) user has contacted Newtron Labs to request such information and Newtron Labs has failed to respond in a reasonable time, or (2) reverse engineering is strictly necessary to obtain such information and Newtron Labs has failed to repl

@NewtronLabs
NewtronLabs / EasyPermissionsConclusion
Last active June 28, 2020 20:30
EasyPermissionsConclusion.kt
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
dependencies {
compileOnly 'com.newtronlabs.ipceventbus:ipceventbus:6.0.1'
}
@NewtronLabs
NewtronLabs / IpcEventBus-example1.kt
Created June 28, 2020 21:41
IpcEventBus-example1
class Listener : IIpcEventBusConnectionListener, IIpcEventBusObserver {
init {
val targetApp = "com.packagename"
val connector = ConnectorFactory.getInstance().buildConnector(context, this, targetApp)
connector.startConnection()
}
override fun onConnected(connector: IIpcEventBusConnector) {
connector.registerObserver(this)
}