diff --git a/README.md b/README.md index 9f89240..d50bf36 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Autostarter -[ ![Download](https://api.bintray.com/packages/judemanutd/Maven/autostarter/images/download.svg) ](https://bintray.com/judemanutd/Maven/autostarter/_latestVersion) +[![Download](https://api.bintray.com/packages/jude-manutd/maven/autostarter/images/download.svg) ](https://bintray.com/jude-manutd/maven/autostarter/_latestVersion) [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](https://opensource.org/licenses/MIT) [![API](https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=14) - + This library helps bring up the autostart permission manager of a phone to the user so they can add an app to autostart. @@ -29,23 +29,29 @@ of the autostart permissiong manager. Add this to your module's `build.gradle` file: - dependencies { +```groovy +dependencies { // ... other dependencies - implementation 'com.judemanutd:autostarter:1.0.0' - } + implementation 'com.github.judemanutd:autostarter:1.0.1' +} +``` ### Maven - - com.judemanutd - autostarter - 1.0.0 - pom - +```xml + + com.github.judemanutd + autostarter + 1.0.1 + pom + +``` Once you have integrated the library calling the following function will bring up the autostart permission manager of the phone. + ```kotlin AutoStartPermissionHelper.getInstance().getAutoStartPermission(context); +``` In order to keep the library small and simple I have not included any dialogs or pop ups, It is upto you to provide the user with a message if necessary. diff --git a/app/src/main/java/com/judemanutd/autostarterexample/MainActivity.java b/app/src/main/java/com/judemanutd/autostarterexample/MainActivity.java deleted file mode 100644 index 7ce3987..0000000 --- a/app/src/main/java/com/judemanutd/autostarterexample/MainActivity.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.judemanutd.autostarterexample; - -import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.widget.Button; - -import com.judemanutd.autostarter.AutoStartPermissionHelper; - -public class MainActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - Button button = findViewById(R.id.button); - button.setOnClickListener(v -> AutoStartPermissionHelper.getInstance().getAutoStartPermission(MainActivity.this)); - - - } -} diff --git a/app/src/main/java/com/judemanutd/autostarterexample/MainActivity.kt b/app/src/main/java/com/judemanutd/autostarterexample/MainActivity.kt new file mode 100644 index 0000000..c67102c --- /dev/null +++ b/app/src/main/java/com/judemanutd/autostarterexample/MainActivity.kt @@ -0,0 +1,20 @@ +package com.judemanutd.autostarterexample + +import android.os.Bundle +import android.support.v7.app.AppCompatActivity +import android.widget.Button + +import com.judemanutd.autostarter.AutoStartPermissionHelper + +class MainActivity : AppCompatActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + + val button = findViewById