diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..6a4ba42
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,42 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 29
+ buildToolsVersion "29.0.2"
+
+ defaultConfig {
+ applicationId "espero.jiofibatterynotifier"
+ minSdkVersion 17
+ targetSdkVersion 29
+ versionCode 4
+ versionName "1.3"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled true
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'androidx.appcompat:appcompat:1.1.0'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ implementation 'com.google.code.gson:gson:2.8.6'
+ implementation 'com.android.volley:volley:1.1.1'
+ implementation 'androidx.browser:browser:1.2.0'
+
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json
new file mode 100644
index 0000000..3896383
--- /dev/null
+++ b/app/release/output-metadata.json
@@ -0,0 +1,20 @@
+{
+ "version": 1,
+ "artifactType": {
+ "type": "APK",
+ "kind": "Directory"
+ },
+ "applicationId": "espero.jiofibatterynotifier",
+ "variantName": "release",
+ "elements": [
+ {
+ "type": "SINGLE",
+ "filters": [],
+ "properties": [],
+ "versionCode": 4,
+ "versionName": "1.3",
+ "enabled": true,
+ "outputFile": "app-release.apk"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/app/src/androidTest/java/espero/jiofibatterynotifier/ExampleInstrumentedTest.java b/app/src/androidTest/java/espero/jiofibatterynotifier/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..8b17f28
--- /dev/null
+++ b/app/src/androidTest/java/espero/jiofibatterynotifier/ExampleInstrumentedTest.java
@@ -0,0 +1,27 @@
+package espero.jiofibatterynotifier;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+ assertEquals("espero.jiofibatterynotifier", appContext.getPackageName());
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..d44802e
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/ic_launcher-playstore.png b/app/src/main/ic_launcher-playstore.png
new file mode 100644
index 0000000..fbd5fc2
Binary files /dev/null and b/app/src/main/ic_launcher-playstore.png differ
diff --git a/app/src/main/java/espero/jiofibatterynotifier/Activites/MainActivity.java b/app/src/main/java/espero/jiofibatterynotifier/Activites/MainActivity.java
new file mode 100644
index 0000000..f31ef91
--- /dev/null
+++ b/app/src/main/java/espero/jiofibatterynotifier/Activites/MainActivity.java
@@ -0,0 +1,404 @@
+package espero.jiofibatterynotifier.Activites;
+
+import androidx.annotation.RequiresApi;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.browser.customtabs.CustomTabsIntent;
+import androidx.core.content.ContextCompat;
+
+import android.app.ActivityManager;
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.SharedPreferences;
+import android.graphics.drawable.AnimationDrawable;
+import android.media.MediaPlayer;
+import android.media.Ringtone;
+import android.media.RingtoneManager;
+import android.net.Uri;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.WifiManager;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.os.PowerManager;
+import android.os.Vibrator;
+import android.provider.Settings;
+import android.util.Log;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.android.volley.Request;
+import com.android.volley.RequestQueue;
+import com.android.volley.Response;
+import com.android.volley.VolleyError;
+import com.android.volley.toolbox.StringRequest;
+import com.android.volley.toolbox.Volley;
+
+import espero.jiofibatterynotifier.Classes.SharedPrefMain;
+import espero.jiofibatterynotifier.Classes.StartUpBootReceiver;
+import espero.jiofibatterynotifier.R;
+import espero.jiofibatterynotifier.Services.JioFiService;
+
+public class MainActivity extends AppCompatActivity {
+
+ private TextView mainText;
+ private Spinner level, interval, alerts, sound, vibrate;
+ private Button button;
+ private SharedPrefMain sharedPrefMain;
+ private String TAG = "mainActivity";
+ private Thread thread;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ Bundle extras = getIntent().getExtras();
+
+ sharedPrefMain = new SharedPrefMain(this);
+ if (extras != null) {
+ mp = MediaPlayer.create(this, R.raw.low);
+ mp.setLooping(false);
+ mp.setVolume(0.5f, 0.5f);
+ boolean dialog = extras.getBoolean("dialog");
+ String msg = extras.getString("msg");
+
+ if (dialog) {
+ showAlert(msg);
+ }
+ }
+ mainText = findViewById(R.id.main_text);
+ button = findViewById(R.id.button);
+ level = findViewById(R.id.level_spinner);
+ interval = findViewById(R.id.interval_spinner);
+ alerts = findViewById(R.id.alerts_spinner);
+ sound = findViewById(R.id.sound_spinner);
+ vibrate = findViewById(R.id.vibrate_spinner);
+
+
+
+ if (sharedPrefMain.getBoolean("firstTime")) {
+ sharedPrefMain.setBoolean("firstTime", false);
+ sharedPrefMain.setString("interval", "5 Sec");
+ sharedPrefMain.setString("low", "30 %");
+ sharedPrefMain.setString("msg", "Stopped");
+ sharedPrefMain.setInt("low_msg", 100);
+ sharedPrefMain.setInt("high_msg", 0);
+ sharedPrefMain.setBoolean("start", false);
+ }
+ createLayout();
+
+ try {
+ mainText.setBackgroundResource(R.drawable.rectangle_animation);
+ AnimationDrawable frameAnimation2 = (AnimationDrawable) mainText.getBackground();
+ frameAnimation2.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ interval.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id) {
+ String item = parent.getAdapter().getItem(position).toString();
+ Log.d(TAG, item);
+ sharedPrefMain.setString("interval", item);
+// Toast.makeText(MainActivity.this, "Updated", Toast.LENGTH_SHORT).show();
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+
+ }
+ });
+
+ level.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id) {
+ String item = parent.getAdapter().getItem(position).toString();
+ Log.d(TAG, item);
+ sharedPrefMain.setString("low", item);
+// Toast.makeText(MainActivity.this, "Updated", Toast.LENGTH_SHORT).show();
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+
+ }
+ });
+
+ alerts.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id) {
+ if (position == 0) {
+ sharedPrefMain.setBoolean("alerts", true);
+ } else {
+ sharedPrefMain.setBoolean("alerts", false);
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+
+ }
+ });
+
+ sound.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id) {
+ if (position == 0) {
+ sharedPrefMain.setBoolean("sound", true);
+ } else {
+ sharedPrefMain.setBoolean("sound", false);
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+
+ }
+ });
+ vibrate.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int position, long id) {
+ if (position == 0) {
+ sharedPrefMain.setBoolean("vibrate", true);
+ } else {
+ sharedPrefMain.setBoolean("vibrate", false);
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+
+ }
+ });
+
+
+ button.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (button.getText().equals("Stop")) {
+ button.setText("Start");
+ stopService();
+ } else {
+ button.setText("Stop");
+ startService();
+ }
+ }
+ });
+
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+
+ while (true) {
+ if (myHandler != null)
+ myHandler.sendEmptyMessage(0);
+
+ try {
+ Thread.sleep(1500);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ };
+
+ thread = new Thread(runnable);
+ thread.start();
+
+ try {
+ IntentFilter intentFilter = new IntentFilter();
+ intentFilter.addAction(Intent.ACTION_BOOT_COMPLETED);
+ StartUpBootReceiver broadcastReceiver = new StartUpBootReceiver();
+ registerReceiver(broadcastReceiver, intentFilter);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+
+ private void showAlert(String msg) {
+ alert();
+ String title = "JioFi Battery Low";
+ if (msg.contains("100")) {
+ title = "JioFi Battery Full";
+ }
+ new AlertDialog.Builder(this)
+ .setTitle(title)
+ .setMessage(msg)
+ .setPositiveButton("Ok", null)
+ .setCancelable(false)
+ .setOnDismissListener(new DialogInterface.OnDismissListener() {
+ @Override
+ public void onDismiss(DialogInterface dialog) {
+ finish();
+ }
+ })
+ .setIcon(android.R.drawable.ic_dialog_alert).create().show();
+ }
+
+ private MediaPlayer mp;
+
+ private void alert() {
+ if (sharedPrefMain.getBoolean("vibrate")) {
+ Vibrator vibrator;
+ vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
+ vibrator.vibrate(500);
+ }
+ if (sharedPrefMain.getBoolean("sound")) {
+ try {
+ if (mp != null) {
+ mp.start();
+ }
+ } catch (Exception e) {
+ Log.d(TAG, "Error:" + e.getMessage());
+ }
+ }
+ }
+
+ private final Handler myHandler = new Handler() {
+ public void handleMessage(Message msg) {
+ if (mainText != null) {
+ mainText.setText(sharedPrefMain.getString("msg"));
+ }
+ }
+ };
+
+ private void createLayout() {
+ if (isMyServiceRunning(JioFiService.class)) {
+ button.setText("Stop");
+ } else {
+
+ sharedPrefMain.setString("msg", "Stopped");
+ button.setText("Start");
+ if (sharedPrefMain.getBoolean("start")) {
+ startService();
+ button.setText("Stop");
+ }
+ }
+ interval.setSelection(((ArrayAdapter) interval.getAdapter()).getPosition(sharedPrefMain.getString("interval")));
+ level.setSelection(((ArrayAdapter) level.getAdapter()).getPosition(sharedPrefMain.getString("low")));
+ if (sharedPrefMain.getBoolean("alerts")) {
+ alerts.setSelection(0);
+ } else {
+ alerts.setSelection(1);
+ }
+ if (sharedPrefMain.getBoolean("sound")) {
+ sound.setSelection(0);
+ } else {
+ sound.setSelection(1);
+ }
+ if (sharedPrefMain.getBoolean("vibrate")) {
+ vibrate.setSelection(0);
+ } else {
+ vibrate.setSelection(1);
+ }
+ }
+
+ private void startService() {
+ requestWhitelist();
+ sharedPrefMain.setBoolean("start", true);
+ Intent intent = new Intent(MainActivity.this, JioFiService.class);
+ intent.setAction(JioFiService.ACTION_START_FOREGROUND_SERVICE);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ startForegroundService(intent);
+ } else {
+ startService(intent);
+ }
+ }
+
+ private void stopService() {
+ sharedPrefMain.setBoolean("start", false);
+ sharedPrefMain.setString("msg", "Stopped");
+ Intent intent = new Intent(MainActivity.this, JioFiService.class);
+ intent.setAction(JioFiService.ACTION_STOP_FOREGROUND_SERVICE);
+ startService(intent);
+ }
+
+ private boolean isMyServiceRunning(Class> serviceClass) {
+ ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
+ for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
+ if (serviceClass.getName().equals(service.service.getClassName())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ public void openJioFiPanel(View view) {
+ Log.d(TAG, "Clicked");
+ String gateway = sharedPrefMain.getString("gateway");
+ if (gateway.isEmpty()) {
+ gateway = "http://192.168.225.1";
+ } else {
+ gateway = "http://" + gateway;
+ }
+
+ CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder();
+ intentBuilder.setToolbarColor(ContextCompat.getColor(this, R.color.colorPrimary));
+ intentBuilder.setSecondaryToolbarColor(ContextCompat.getColor(this, R.color.colorPrimaryDark));
+
+ try {
+ CustomTabsIntent customTabsIntent = intentBuilder.build();
+ customTabsIntent.intent.setPackage("com.android.chrome");
+ customTabsIntent.launchUrl(this, Uri.parse(gateway));
+ } catch (Exception e) {
+ try {
+ CustomTabsIntent customTabsIntent = intentBuilder.build();
+ customTabsIntent.launchUrl(this, Uri.parse(gateway));
+ } catch (Exception e1) {
+ Log.d(TAG, "Error:" + e1.getMessage());
+ }
+ }
+
+ }
+
+ public void openPlayStore(View view) {
+ startActivityForResult(new Intent(Intent.ACTION_VIEW,
+ Uri.parse("https://www.buymeacoffee.com/parveshmonu")), 1);
+ }
+
+ private void requestWhitelist() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ Intent intent = new Intent();
+ String packageName = getPackageName();
+ PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE);
+ if (!pm.isIgnoringBatteryOptimizations(packageName)) {
+ intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
+ intent.setData(Uri.parse("package:" + packageName));
+ startActivity(intent);
+ }
+ }
+ }
+
+ @Override
+ protected void onStop() {
+
+ try {
+ if (mp != null) {
+ mp.stop();
+ mp = null;
+ }
+ if (thread != null) {
+ thread.interrupt();
+ thread = null;
+ }
+ } catch (Exception e) {
+
+ }
+
+ super.onStop();
+ }
+}
diff --git a/app/src/main/java/espero/jiofibatterynotifier/Classes/SharedPrefMain.java b/app/src/main/java/espero/jiofibatterynotifier/Classes/SharedPrefMain.java
new file mode 100755
index 0000000..266bbcf
--- /dev/null
+++ b/app/src/main/java/espero/jiofibatterynotifier/Classes/SharedPrefMain.java
@@ -0,0 +1,102 @@
+package espero.jiofibatterynotifier.Classes;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.util.Log;
+
+import com.google.gson.Gson;
+
+
+/**
+ * Created by parvesh_dhull on 9/2/17.
+ */
+
+public class SharedPrefMain {
+
+ private static String engwingoSharedPrefMain = "esperoJioFiSharedPref";
+ private static String uid ;
+ Context context;
+ SharedPreferences sharedpreferences;
+ SharedPreferences.Editor editor;
+ Gson gson;
+
+
+ public SharedPrefMain(Context context) {
+
+
+ try {
+ this.context = context;
+ sharedpreferences = context.getSharedPreferences(engwingoSharedPrefMain, Context.MODE_PRIVATE);
+ editor = sharedpreferences.edit();
+ gson = new Gson();
+ uid = sharedpreferences.getString("uid", "");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+ public void setBoolean(String name,Boolean value){
+ try {
+ editor.putBoolean("myBooleanNew"+ name, value);
+ editor.commit();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ public boolean getBoolean(String name){
+ try {
+ return sharedpreferences.getBoolean("myBooleanNew"+ name , true);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return true;
+ }
+ }
+ public void setString(String name,String value){
+ try {
+ editor.putString("myStringNew"+ name, value);
+ editor.commit();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ public String getString(String name) {
+ try {
+ return sharedpreferences.getString("myStringNew"+ name , "");
+ } catch (Exception e) {
+ e.printStackTrace();
+ return "";
+ }
+ }
+ public void setInt(String name,int value){
+ try {
+ editor.putInt("myIntNew"+ name, value);
+ editor.commit();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ public int getInt(String name) {
+ try {
+ return sharedpreferences.getInt("myIntNew"+ name , 0);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return 0;
+ }
+ }
+ public void setLong(String name,Long value){
+ try {
+ editor.putLong("myLongNew"+ name, value);
+ editor.commit();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ public long getLong(String name) {
+ try {
+ return sharedpreferences.getLong("myLongNew"+ name , 0L);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return 0L;
+ }
+ }
+}
diff --git a/app/src/main/java/espero/jiofibatterynotifier/Classes/StartUpBootReceiver.java b/app/src/main/java/espero/jiofibatterynotifier/Classes/StartUpBootReceiver.java
new file mode 100644
index 0000000..82aa0e5
--- /dev/null
+++ b/app/src/main/java/espero/jiofibatterynotifier/Classes/StartUpBootReceiver.java
@@ -0,0 +1,40 @@
+package espero.jiofibatterynotifier.Classes;
+
+import android.app.ActivityManager;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Build;
+import espero.jiofibatterynotifier.Services.JioFiService;
+
+public class StartUpBootReceiver extends BroadcastReceiver {
+ private SharedPrefMain sharedPrefMain;
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+
+ sharedPrefMain = new SharedPrefMain(context);
+ if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
+ if(!isMyServiceRunning(JioFiService.class, context) && sharedPrefMain.getBoolean("start")){
+ Intent intent2 = new Intent(context, JioFiService.class);
+ intent2.setAction(JioFiService.ACTION_START_FOREGROUND_SERVICE);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ context.startForegroundService(intent2);
+ } else {
+ context.startService(intent2);
+ }
+ }
+ }
+ }
+
+ private boolean isMyServiceRunning(Class> serviceClass, Context context) {
+ ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
+ for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
+ if (serviceClass.getName().equals(service.service.getClassName())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/espero/jiofibatterynotifier/Services/JioFiService.java b/app/src/main/java/espero/jiofibatterynotifier/Services/JioFiService.java
new file mode 100644
index 0000000..b8406a9
--- /dev/null
+++ b/app/src/main/java/espero/jiofibatterynotifier/Services/JioFiService.java
@@ -0,0 +1,432 @@
+package espero.jiofibatterynotifier.Services;
+
+import android.app.Notification;
+import android.app.NotificationChannel;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.app.Service;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.media.RingtoneManager;
+import android.net.Uri;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.WifiManager;
+import android.os.Build;
+import android.os.IBinder;
+import android.util.Log;
+import android.widget.Toast;
+
+import androidx.core.app.NotificationCompat;
+
+import com.android.volley.Request;
+import com.android.volley.RequestQueue;
+import com.android.volley.toolbox.StringRequest;
+import com.android.volley.toolbox.Volley;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import espero.jiofibatterynotifier.Activites.MainActivity;
+import espero.jiofibatterynotifier.Classes.SharedPrefMain;
+import espero.jiofibatterynotifier.R;
+
+public class JioFiService extends Service {
+
+ private static final String TAG_FOREGROUND_SERVICE = "mainActivity";
+
+ public static final String ACTION_START_FOREGROUND_SERVICE = "ACTION_START_FOREGROUND_SERVICE";
+
+ public static final String ACTION_STOP_FOREGROUND_SERVICE = "ACTION_STOP_FOREGROUND_SERVICE";
+
+
+ public JioFiService() {
+ }
+
+ private Thread thread;
+ private SharedPrefMain sharedPrefMain;
+ private RequestQueue queue;
+ private String pattern_string = "(id=\"batterylevel\" value=\")(\\d*)(%\")";
+ private Pattern pattern;
+
+ @Override
+ public void onDestroy() {
+ try {
+ if(thread != null && thread.isAlive()){
+ thread.interrupt();
+ thread = null;
+ }
+ if(queue != null){
+ queue.cancelAll(TAG_FOREGROUND_SERVICE);
+ queue.stop();
+ queue = null;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ super.onDestroy();
+ }
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ // TODO: Return the communication channel to the service.
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ sharedPrefMain = new SharedPrefMain(this);
+ Log.d(TAG_FOREGROUND_SERVICE, "My foreground service onCreate().");
+ IntentFilter intentFilter = new IntentFilter();
+ intentFilter.addAction(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION);
+ WifiReceiver broadcastReceiver = new WifiReceiver();
+ registerReceiver(broadcastReceiver, intentFilter);
+ queue = Volley.newRequestQueue(this);
+ pattern = Pattern.compile(pattern_string);
+ thread = new Thread(runnable);
+ thread.start();
+ }
+
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId) {
+ if (intent != null) {
+ String action = intent.getAction();
+ if (action != null)
+ switch (action) {
+ case ACTION_START_FOREGROUND_SERVICE:
+ startForegroundService();
+ if (checkWifiOnAndConnected()) {
+ wifiChanged(true);
+ }
+ Toast.makeText(getApplicationContext(), "JioFi Battery Notifier Started.", Toast.LENGTH_LONG).show();
+ break;
+ case ACTION_STOP_FOREGROUND_SERVICE:
+ stopForegroundService();
+ Toast.makeText(getApplicationContext(), "JioFi Battery Notifier Stopped.", Toast.LENGTH_LONG).show();
+ break;
+ }
+ }
+ return super.onStartCommand(intent, flags, startId);
+ }
+
+ String channelId = "JioFi Battery Notifier";
+ /* Used to build and start foreground service. */
+ private void startForegroundService() {
+
+ NotificationManager notificationManager =
+ (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+
+ // Since android Oreo notification channel is needed.
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ NotificationChannel channel = new NotificationChannel(channelId,
+ "JioFI Battery Notifier",
+ NotificationManager.IMPORTANCE_HIGH);
+ if (notificationManager != null) {
+ notificationManager.createNotificationChannel(channel);
+ }
+ Notification notification = getNotification("JioFi Battery Notifier Running", R.drawable.icon, false);
+ notificationManager.notify(236, notification);
+ startForeground(236, notification);
+ } else {
+ Notification notification = getNotification("JioFi Battery Notifier Running", R.drawable.icon, false);
+ startForeground(236, notification);
+ }
+ }
+
+
+ private void stopForegroundService() {
+ Log.d(TAG_FOREGROUND_SERVICE, "Stop foreground service.");
+ stopForeground(true);
+ stopSelf();
+ }
+
+ private boolean checkWifiOnAndConnected() {
+ WifiManager wifiMgr = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);
+
+ if (wifiMgr.isWifiEnabled()) { // Wi-Fi adapter is ON
+
+ WifiInfo wifiInfo = wifiMgr.getConnectionInfo();
+
+ if (wifiInfo.getNetworkId() == -1) {
+ return false; // Not connected to an access point
+ }
+ return true; // Connected to an access point
+ } else {
+ return false; // Wi-Fi adapter is OFF
+ }
+ }
+
+ Runnable runnable = new Runnable() {
+ @Override
+ public void run() {
+ while (thread != null) {
+ if (thread.isInterrupted()) {
+ thread = null;
+ break;
+ } else {
+
+ int interval = getInterval();
+
+ if(queue != null){
+ sendRequest();
+ }
+
+ try {
+ Thread.sleep(interval);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+ };
+
+
+ private void sendRequest(){
+ String url = "http://" + sharedPrefMain.getString("gateway");
+
+ StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
+ response -> {
+ Matcher m = pattern.matcher(response);
+ String percentage = "50";
+ boolean charging = true;
+ if (m.find( )) {
+ percentage = m.group(2);
+ }
+ if(response.toLowerCase().contains("discharging")){
+ charging = false;
+ }
+ updateBatteryData(percentage, charging);
+ }, error -> {
+ updateNotification("JioFi Not Connected", R.drawable.icon, false);
+// Log.d(TAG_FOREGROUND_SERVICE, "URL" + url);
+// Log.d(TAG_FOREGROUND_SERVICE, "Error Service:" + error.getMessage());
+ });
+
+ stringRequest.setTag(TAG_FOREGROUND_SERVICE);
+
+ queue.add(stringRequest);
+ }
+
+ int icons[] = {R.drawable.b0,R.drawable.b1,R.drawable.b2,R.drawable.b3,R.drawable.b4,R.drawable.b5,R.drawable.b6,R.drawable.b7,R.drawable.b8,R.drawable.b9,R.drawable.b10,R.drawable.b11,R.drawable.b12,R.drawable.b13,R.drawable.b14,R.drawable.b15,R.drawable.b16,R.drawable.b17,R.drawable.b18,R.drawable.b19,R.drawable.b20,R.drawable.b21,R.drawable.b22,R.drawable.b23,R.drawable.b24,R.drawable.b25,R.drawable.b26,R.drawable.b27,R.drawable.b28,R.drawable.b29,R.drawable.b30,R.drawable.b31,R.drawable.b32,R.drawable.b33,R.drawable.b34,R.drawable.b35,R.drawable.b36,R.drawable.b37,R.drawable.b38,R.drawable.b39,R.drawable.b40,R.drawable.b41,R.drawable.b42,R.drawable.b43,R.drawable.b44,R.drawable.b45,R.drawable.b46,R.drawable.b47,R.drawable.b48,R.drawable.b49,R.drawable.b50,R.drawable.b51,R.drawable.b52,R.drawable.b53,R.drawable.b54,R.drawable.b55,R.drawable.b56,R.drawable.b57,R.drawable.b58,R.drawable.b59,R.drawable.b60,R.drawable.b61,R.drawable.b62,R.drawable.b63,R.drawable.b64,R.drawable.b65,R.drawable.b66,R.drawable.b67,R.drawable.b68,R.drawable.b69,R.drawable.b70,R.drawable.b71,R.drawable.b72,R.drawable.b73,R.drawable.b74,R.drawable.b75,R.drawable.b76,R.drawable.b77,R.drawable.b78,R.drawable.b79,R.drawable.b80,R.drawable.b81,R.drawable.b82,R.drawable.b83,R.drawable.b84,R.drawable.b85,R.drawable.b86,R.drawable.b87,R.drawable.b88,R.drawable.b89,R.drawable.b90,R.drawable.b91,R.drawable.b92,R.drawable.b93,R.drawable.b94,R.drawable.b95,R.drawable.b96,R.drawable.b97,R.drawable.b98,R.drawable.b99,R.drawable.b100};
+ private void updateBatteryData(String percentage, boolean charging){
+
+ int level = getLevel();
+ int percentage_int = 0;
+
+ try {
+ percentage_int = Integer.parseInt(percentage);
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ }
+
+ if(percentage_int < 0){
+ percentage_int = 0;
+ }else if(percentage_int > 100){
+ percentage_int = 100;
+ }
+ boolean playSound = false;
+ int icon = icons[percentage_int];
+
+ String msg = "";
+ if(charging){
+ msg = "Charging - " + percentage + "%";
+ }else{
+ msg = "Discharging - " + percentage + "%";
+ }
+ if(charging){
+ sharedPrefMain.setInt("low_msg", 100);
+ int high_msg = sharedPrefMain.getInt("high_msg");
+ if(percentage_int == 100 && percentage_int >= high_msg){
+ playSound = true;
+ sharedPrefMain.setInt("high_msg", 200);
+ }
+ }else{
+ sharedPrefMain.setInt("high_msg", 0);
+ int low_msg = sharedPrefMain.getInt("low_msg");
+ if(percentage_int <= level && percentage_int <= low_msg){
+ playSound = true;
+ sharedPrefMain.setInt("low_msg", percentage_int/2);
+ }
+ }
+ updateNotification(msg, icon, playSound);
+
+ }
+ private int getLevel(){
+ int level = 0;
+ switch (sharedPrefMain.getString("low")){
+ case "10 %":
+ level = 10;
+ break;
+ case "20 %":
+ level = 20;
+ break;
+ case "30 %":
+ level = 30;
+ break;
+ case "40 %":
+ level = 40;
+ break;
+ case "50 %":
+ level = 50;
+ break;
+ case "60 %":
+ level = 60;
+ break;
+ default:
+ level = 30;
+ break;
+ }
+ return level;
+ }
+ private int getInterval(){
+ int interval = 0;
+ switch (sharedPrefMain.getString("interval")){
+ case "5 Sec":
+ interval = 5 * 1000;
+ break;
+ case "10 Sec":
+ interval = 10 * 1000;
+ break;
+ case "30 Sec":
+ interval = 30 * 1000;
+ break;
+ case "60 Sec":
+ interval = 60 * 1000;
+ break;
+ case "2 Min":
+ interval = 120 * 1000;
+ break;
+ case "3 Min":
+ interval = 180 * 1000;
+ break;
+ case "5 Min":
+ interval = 300 * 1000;
+ break;
+ case "10 Min":
+ interval = 600 * 1000;
+ break;
+ default:
+ interval = 60 * 1000;
+ break;
+ }
+ return interval;
+ }
+ private Notification getNotification(String msg, int small_icon, boolean playSound){
+ sharedPrefMain.setString("msg", msg);
+ Intent intent = new Intent(this, MainActivity.class);
+ PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent, 0);
+
+ String channelId = getString(R.string.app_name);
+ Bitmap largeIconBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.icon2);
+ NotificationCompat.Builder notificationBuilder =
+ new NotificationCompat.Builder(this, channelId)
+ .setSmallIcon(small_icon)
+ .setLargeIcon(largeIconBitmap)
+ .setContentTitle(msg)
+ .setColor(getResources().getColor(R.color.colorPrimary))
+ .setContentIntent(pendingIntent).setOnlyAlertOnce(true);
+ if(sharedPrefMain.getBoolean("alerts") && playSound && ((System.currentTimeMillis() - sharedPrefMain.getLong("notif")) > (1000 * 60 * 5))){
+ sharedPrefMain.setLong("notif", System.currentTimeMillis());
+ showAlert(msg);
+ }
+
+
+ return notificationBuilder.build();
+ }
+ private void updateNotification(String msg, int icon, boolean playSOund){
+ if(!checkWifiOnAndConnected()){
+ msg = "JioFi Not Connected";
+ icon = R.drawable.icon;
+ playSOund = false;
+ }
+ Notification notification = getNotification(msg, icon, playSOund);
+ NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ NotificationChannel channel = new NotificationChannel(channelId,
+ "JioFI Battery Notifier",
+ NotificationManager.IMPORTANCE_HIGH);
+ if (mNotificationManager != null) {
+ mNotificationManager.createNotificationChannel(channel);
+ }
+
+ }
+ mNotificationManager.notify(236, notification);
+ }
+
+ private void showAlert(String msg){
+ Intent intent = new Intent(this, MainActivity.class);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.putExtra("dialog", true);
+ intent.putExtra("msg", msg);
+ startActivity(intent);
+ }
+ private String gateway;
+
+ private void updateGateway() {
+ WifiManager wifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);
+ int count = 0;
+ while (true) {
+ count ++;
+ if(count > 30){
+ break;
+ }
+ int gateway_int = wifiManager.getDhcpInfo().gateway;
+ if (gateway_int == 0) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ } else {
+ gateway = String.format("%d.%d.%d.%d", (gateway_int & 0xff), (gateway_int >> 8 & 0xff), (gateway_int >> 16 & 0xff), (gateway_int >> 24 & 0xff));
+ Log.d(TAG_FOREGROUND_SERVICE, "Gateway" + gateway);
+ sharedPrefMain.setString("gateway", gateway);
+ break;
+ }
+ }
+ }
+
+ private void wifiChanged(Boolean connected) {
+ if (connected) {
+ updateNotification("Loading...", R.drawable.icon, false);
+ updateGateway();
+
+// if(thread == null) {
+// thread = new Thread(runnable);
+// thread.start();
+// }
+ }
+ if(queue != null){
+ sendRequest();
+ }
+// else {
+// if (thread != null && thread.isAlive()) {
+// updateNotification("JioFi Not Connected", R.drawable.icon, false);
+// thread.interrupt();
+// thread = null;
+// }
+// }
+ }
+
+ public class WifiReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+
+ final String action = intent.getAction();
+ if (action.equals(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION)) {
+ if (intent.getBooleanExtra(WifiManager.EXTRA_SUPPLICANT_CONNECTED, false)) {
+ wifiChanged(true);
+ } else {
+ wifiChanged(false);
+ }
+ }
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..7aa2a95
--- /dev/null
+++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/b0.png b/app/src/main/res/drawable/b0.png
new file mode 100755
index 0000000..70b7bba
Binary files /dev/null and b/app/src/main/res/drawable/b0.png differ
diff --git a/app/src/main/res/drawable/b1.png b/app/src/main/res/drawable/b1.png
new file mode 100755
index 0000000..345b705
Binary files /dev/null and b/app/src/main/res/drawable/b1.png differ
diff --git a/app/src/main/res/drawable/b10.png b/app/src/main/res/drawable/b10.png
new file mode 100755
index 0000000..899752d
Binary files /dev/null and b/app/src/main/res/drawable/b10.png differ
diff --git a/app/src/main/res/drawable/b100.png b/app/src/main/res/drawable/b100.png
new file mode 100755
index 0000000..5d8b21e
Binary files /dev/null and b/app/src/main/res/drawable/b100.png differ
diff --git a/app/src/main/res/drawable/b11.png b/app/src/main/res/drawable/b11.png
new file mode 100755
index 0000000..5de2d24
Binary files /dev/null and b/app/src/main/res/drawable/b11.png differ
diff --git a/app/src/main/res/drawable/b12.png b/app/src/main/res/drawable/b12.png
new file mode 100755
index 0000000..c114f06
Binary files /dev/null and b/app/src/main/res/drawable/b12.png differ
diff --git a/app/src/main/res/drawable/b13.png b/app/src/main/res/drawable/b13.png
new file mode 100755
index 0000000..9483ee8
Binary files /dev/null and b/app/src/main/res/drawable/b13.png differ
diff --git a/app/src/main/res/drawable/b14.png b/app/src/main/res/drawable/b14.png
new file mode 100755
index 0000000..0a34b7e
Binary files /dev/null and b/app/src/main/res/drawable/b14.png differ
diff --git a/app/src/main/res/drawable/b15.png b/app/src/main/res/drawable/b15.png
new file mode 100755
index 0000000..f0b4c10
Binary files /dev/null and b/app/src/main/res/drawable/b15.png differ
diff --git a/app/src/main/res/drawable/b16.png b/app/src/main/res/drawable/b16.png
new file mode 100755
index 0000000..da57e9f
Binary files /dev/null and b/app/src/main/res/drawable/b16.png differ
diff --git a/app/src/main/res/drawable/b17.png b/app/src/main/res/drawable/b17.png
new file mode 100755
index 0000000..99ed62a
Binary files /dev/null and b/app/src/main/res/drawable/b17.png differ
diff --git a/app/src/main/res/drawable/b18.png b/app/src/main/res/drawable/b18.png
new file mode 100755
index 0000000..9de8f31
Binary files /dev/null and b/app/src/main/res/drawable/b18.png differ
diff --git a/app/src/main/res/drawable/b19.png b/app/src/main/res/drawable/b19.png
new file mode 100755
index 0000000..a5c93fe
Binary files /dev/null and b/app/src/main/res/drawable/b19.png differ
diff --git a/app/src/main/res/drawable/b2.png b/app/src/main/res/drawable/b2.png
new file mode 100755
index 0000000..2f4dc9b
Binary files /dev/null and b/app/src/main/res/drawable/b2.png differ
diff --git a/app/src/main/res/drawable/b20.png b/app/src/main/res/drawable/b20.png
new file mode 100755
index 0000000..de00f99
Binary files /dev/null and b/app/src/main/res/drawable/b20.png differ
diff --git a/app/src/main/res/drawable/b21.png b/app/src/main/res/drawable/b21.png
new file mode 100755
index 0000000..55c1143
Binary files /dev/null and b/app/src/main/res/drawable/b21.png differ
diff --git a/app/src/main/res/drawable/b22.png b/app/src/main/res/drawable/b22.png
new file mode 100755
index 0000000..959e2f4
Binary files /dev/null and b/app/src/main/res/drawable/b22.png differ
diff --git a/app/src/main/res/drawable/b23.png b/app/src/main/res/drawable/b23.png
new file mode 100755
index 0000000..49ff7d7
Binary files /dev/null and b/app/src/main/res/drawable/b23.png differ
diff --git a/app/src/main/res/drawable/b24.png b/app/src/main/res/drawable/b24.png
new file mode 100755
index 0000000..e32f9f0
Binary files /dev/null and b/app/src/main/res/drawable/b24.png differ
diff --git a/app/src/main/res/drawable/b25.png b/app/src/main/res/drawable/b25.png
new file mode 100755
index 0000000..71a9b47
Binary files /dev/null and b/app/src/main/res/drawable/b25.png differ
diff --git a/app/src/main/res/drawable/b26.png b/app/src/main/res/drawable/b26.png
new file mode 100755
index 0000000..41d2c47
Binary files /dev/null and b/app/src/main/res/drawable/b26.png differ
diff --git a/app/src/main/res/drawable/b27.png b/app/src/main/res/drawable/b27.png
new file mode 100755
index 0000000..6de4030
Binary files /dev/null and b/app/src/main/res/drawable/b27.png differ
diff --git a/app/src/main/res/drawable/b28.png b/app/src/main/res/drawable/b28.png
new file mode 100755
index 0000000..c19b8a6
Binary files /dev/null and b/app/src/main/res/drawable/b28.png differ
diff --git a/app/src/main/res/drawable/b29.png b/app/src/main/res/drawable/b29.png
new file mode 100755
index 0000000..ae7091d
Binary files /dev/null and b/app/src/main/res/drawable/b29.png differ
diff --git a/app/src/main/res/drawable/b3.png b/app/src/main/res/drawable/b3.png
new file mode 100755
index 0000000..4fbf3b0
Binary files /dev/null and b/app/src/main/res/drawable/b3.png differ
diff --git a/app/src/main/res/drawable/b30.png b/app/src/main/res/drawable/b30.png
new file mode 100755
index 0000000..ed08d7c
Binary files /dev/null and b/app/src/main/res/drawable/b30.png differ
diff --git a/app/src/main/res/drawable/b31.png b/app/src/main/res/drawable/b31.png
new file mode 100755
index 0000000..be3a7bd
Binary files /dev/null and b/app/src/main/res/drawable/b31.png differ
diff --git a/app/src/main/res/drawable/b32.png b/app/src/main/res/drawable/b32.png
new file mode 100755
index 0000000..fcf9950
Binary files /dev/null and b/app/src/main/res/drawable/b32.png differ
diff --git a/app/src/main/res/drawable/b33.png b/app/src/main/res/drawable/b33.png
new file mode 100755
index 0000000..a08f813
Binary files /dev/null and b/app/src/main/res/drawable/b33.png differ
diff --git a/app/src/main/res/drawable/b34.png b/app/src/main/res/drawable/b34.png
new file mode 100755
index 0000000..fcc23be
Binary files /dev/null and b/app/src/main/res/drawable/b34.png differ
diff --git a/app/src/main/res/drawable/b35.png b/app/src/main/res/drawable/b35.png
new file mode 100755
index 0000000..5b1cb6d
Binary files /dev/null and b/app/src/main/res/drawable/b35.png differ
diff --git a/app/src/main/res/drawable/b36.png b/app/src/main/res/drawable/b36.png
new file mode 100755
index 0000000..5743712
Binary files /dev/null and b/app/src/main/res/drawable/b36.png differ
diff --git a/app/src/main/res/drawable/b37.png b/app/src/main/res/drawable/b37.png
new file mode 100755
index 0000000..5e66dc3
Binary files /dev/null and b/app/src/main/res/drawable/b37.png differ
diff --git a/app/src/main/res/drawable/b38.png b/app/src/main/res/drawable/b38.png
new file mode 100755
index 0000000..4eab6dc
Binary files /dev/null and b/app/src/main/res/drawable/b38.png differ
diff --git a/app/src/main/res/drawable/b39.png b/app/src/main/res/drawable/b39.png
new file mode 100755
index 0000000..33b1a4d
Binary files /dev/null and b/app/src/main/res/drawable/b39.png differ
diff --git a/app/src/main/res/drawable/b4.png b/app/src/main/res/drawable/b4.png
new file mode 100755
index 0000000..4ce71a4
Binary files /dev/null and b/app/src/main/res/drawable/b4.png differ
diff --git a/app/src/main/res/drawable/b40.png b/app/src/main/res/drawable/b40.png
new file mode 100755
index 0000000..31472b3
Binary files /dev/null and b/app/src/main/res/drawable/b40.png differ
diff --git a/app/src/main/res/drawable/b41.png b/app/src/main/res/drawable/b41.png
new file mode 100755
index 0000000..80efc89
Binary files /dev/null and b/app/src/main/res/drawable/b41.png differ
diff --git a/app/src/main/res/drawable/b42.png b/app/src/main/res/drawable/b42.png
new file mode 100755
index 0000000..9849649
Binary files /dev/null and b/app/src/main/res/drawable/b42.png differ
diff --git a/app/src/main/res/drawable/b43.png b/app/src/main/res/drawable/b43.png
new file mode 100755
index 0000000..94f70e8
Binary files /dev/null and b/app/src/main/res/drawable/b43.png differ
diff --git a/app/src/main/res/drawable/b44.png b/app/src/main/res/drawable/b44.png
new file mode 100755
index 0000000..e71bce3
Binary files /dev/null and b/app/src/main/res/drawable/b44.png differ
diff --git a/app/src/main/res/drawable/b45.png b/app/src/main/res/drawable/b45.png
new file mode 100755
index 0000000..53f9af5
Binary files /dev/null and b/app/src/main/res/drawable/b45.png differ
diff --git a/app/src/main/res/drawable/b46.png b/app/src/main/res/drawable/b46.png
new file mode 100755
index 0000000..0c965ea
Binary files /dev/null and b/app/src/main/res/drawable/b46.png differ
diff --git a/app/src/main/res/drawable/b47.png b/app/src/main/res/drawable/b47.png
new file mode 100755
index 0000000..9ae4ec2
Binary files /dev/null and b/app/src/main/res/drawable/b47.png differ
diff --git a/app/src/main/res/drawable/b48.png b/app/src/main/res/drawable/b48.png
new file mode 100755
index 0000000..6a5848b
Binary files /dev/null and b/app/src/main/res/drawable/b48.png differ
diff --git a/app/src/main/res/drawable/b49.png b/app/src/main/res/drawable/b49.png
new file mode 100755
index 0000000..0d86083
Binary files /dev/null and b/app/src/main/res/drawable/b49.png differ
diff --git a/app/src/main/res/drawable/b5.png b/app/src/main/res/drawable/b5.png
new file mode 100755
index 0000000..60ffbaa
Binary files /dev/null and b/app/src/main/res/drawable/b5.png differ
diff --git a/app/src/main/res/drawable/b50.png b/app/src/main/res/drawable/b50.png
new file mode 100755
index 0000000..0d569f2
Binary files /dev/null and b/app/src/main/res/drawable/b50.png differ
diff --git a/app/src/main/res/drawable/b51.png b/app/src/main/res/drawable/b51.png
new file mode 100755
index 0000000..07219ee
Binary files /dev/null and b/app/src/main/res/drawable/b51.png differ
diff --git a/app/src/main/res/drawable/b52.png b/app/src/main/res/drawable/b52.png
new file mode 100755
index 0000000..d37479f
Binary files /dev/null and b/app/src/main/res/drawable/b52.png differ
diff --git a/app/src/main/res/drawable/b53.png b/app/src/main/res/drawable/b53.png
new file mode 100755
index 0000000..61cdeec
Binary files /dev/null and b/app/src/main/res/drawable/b53.png differ
diff --git a/app/src/main/res/drawable/b54.png b/app/src/main/res/drawable/b54.png
new file mode 100755
index 0000000..9314ade
Binary files /dev/null and b/app/src/main/res/drawable/b54.png differ
diff --git a/app/src/main/res/drawable/b55.png b/app/src/main/res/drawable/b55.png
new file mode 100755
index 0000000..bb0c815
Binary files /dev/null and b/app/src/main/res/drawable/b55.png differ
diff --git a/app/src/main/res/drawable/b56.png b/app/src/main/res/drawable/b56.png
new file mode 100755
index 0000000..93c1f33
Binary files /dev/null and b/app/src/main/res/drawable/b56.png differ
diff --git a/app/src/main/res/drawable/b57.png b/app/src/main/res/drawable/b57.png
new file mode 100755
index 0000000..45b25bb
Binary files /dev/null and b/app/src/main/res/drawable/b57.png differ
diff --git a/app/src/main/res/drawable/b58.png b/app/src/main/res/drawable/b58.png
new file mode 100755
index 0000000..62cafec
Binary files /dev/null and b/app/src/main/res/drawable/b58.png differ
diff --git a/app/src/main/res/drawable/b59.png b/app/src/main/res/drawable/b59.png
new file mode 100755
index 0000000..2dfce64
Binary files /dev/null and b/app/src/main/res/drawable/b59.png differ
diff --git a/app/src/main/res/drawable/b6.png b/app/src/main/res/drawable/b6.png
new file mode 100755
index 0000000..c673a1a
Binary files /dev/null and b/app/src/main/res/drawable/b6.png differ
diff --git a/app/src/main/res/drawable/b60.png b/app/src/main/res/drawable/b60.png
new file mode 100755
index 0000000..a99805e
Binary files /dev/null and b/app/src/main/res/drawable/b60.png differ
diff --git a/app/src/main/res/drawable/b61.png b/app/src/main/res/drawable/b61.png
new file mode 100755
index 0000000..d69c487
Binary files /dev/null and b/app/src/main/res/drawable/b61.png differ
diff --git a/app/src/main/res/drawable/b62.png b/app/src/main/res/drawable/b62.png
new file mode 100755
index 0000000..a2a83ac
Binary files /dev/null and b/app/src/main/res/drawable/b62.png differ
diff --git a/app/src/main/res/drawable/b63.png b/app/src/main/res/drawable/b63.png
new file mode 100755
index 0000000..917c3a9
Binary files /dev/null and b/app/src/main/res/drawable/b63.png differ
diff --git a/app/src/main/res/drawable/b64.png b/app/src/main/res/drawable/b64.png
new file mode 100755
index 0000000..6b269be
Binary files /dev/null and b/app/src/main/res/drawable/b64.png differ
diff --git a/app/src/main/res/drawable/b65.png b/app/src/main/res/drawable/b65.png
new file mode 100755
index 0000000..96f1104
Binary files /dev/null and b/app/src/main/res/drawable/b65.png differ
diff --git a/app/src/main/res/drawable/b66.png b/app/src/main/res/drawable/b66.png
new file mode 100755
index 0000000..25229fc
Binary files /dev/null and b/app/src/main/res/drawable/b66.png differ
diff --git a/app/src/main/res/drawable/b67.png b/app/src/main/res/drawable/b67.png
new file mode 100755
index 0000000..c8ccf38
Binary files /dev/null and b/app/src/main/res/drawable/b67.png differ
diff --git a/app/src/main/res/drawable/b68.png b/app/src/main/res/drawable/b68.png
new file mode 100755
index 0000000..a327804
Binary files /dev/null and b/app/src/main/res/drawable/b68.png differ
diff --git a/app/src/main/res/drawable/b69.png b/app/src/main/res/drawable/b69.png
new file mode 100755
index 0000000..e95df81
Binary files /dev/null and b/app/src/main/res/drawable/b69.png differ
diff --git a/app/src/main/res/drawable/b7.png b/app/src/main/res/drawable/b7.png
new file mode 100755
index 0000000..991d46d
Binary files /dev/null and b/app/src/main/res/drawable/b7.png differ
diff --git a/app/src/main/res/drawable/b70.png b/app/src/main/res/drawable/b70.png
new file mode 100755
index 0000000..f71d0b4
Binary files /dev/null and b/app/src/main/res/drawable/b70.png differ
diff --git a/app/src/main/res/drawable/b71.png b/app/src/main/res/drawable/b71.png
new file mode 100755
index 0000000..fb888e4
Binary files /dev/null and b/app/src/main/res/drawable/b71.png differ
diff --git a/app/src/main/res/drawable/b72.png b/app/src/main/res/drawable/b72.png
new file mode 100755
index 0000000..4252508
Binary files /dev/null and b/app/src/main/res/drawable/b72.png differ
diff --git a/app/src/main/res/drawable/b73.png b/app/src/main/res/drawable/b73.png
new file mode 100755
index 0000000..e5501e5
Binary files /dev/null and b/app/src/main/res/drawable/b73.png differ
diff --git a/app/src/main/res/drawable/b74.png b/app/src/main/res/drawable/b74.png
new file mode 100755
index 0000000..455c28f
Binary files /dev/null and b/app/src/main/res/drawable/b74.png differ
diff --git a/app/src/main/res/drawable/b75.png b/app/src/main/res/drawable/b75.png
new file mode 100755
index 0000000..bfe7a3b
Binary files /dev/null and b/app/src/main/res/drawable/b75.png differ
diff --git a/app/src/main/res/drawable/b76.png b/app/src/main/res/drawable/b76.png
new file mode 100755
index 0000000..04b4f42
Binary files /dev/null and b/app/src/main/res/drawable/b76.png differ
diff --git a/app/src/main/res/drawable/b77.png b/app/src/main/res/drawable/b77.png
new file mode 100755
index 0000000..e2fc2ca
Binary files /dev/null and b/app/src/main/res/drawable/b77.png differ
diff --git a/app/src/main/res/drawable/b78.png b/app/src/main/res/drawable/b78.png
new file mode 100755
index 0000000..01a8263
Binary files /dev/null and b/app/src/main/res/drawable/b78.png differ
diff --git a/app/src/main/res/drawable/b79.png b/app/src/main/res/drawable/b79.png
new file mode 100755
index 0000000..04adacf
Binary files /dev/null and b/app/src/main/res/drawable/b79.png differ
diff --git a/app/src/main/res/drawable/b8.png b/app/src/main/res/drawable/b8.png
new file mode 100755
index 0000000..5b6fdeb
Binary files /dev/null and b/app/src/main/res/drawable/b8.png differ
diff --git a/app/src/main/res/drawable/b80.png b/app/src/main/res/drawable/b80.png
new file mode 100755
index 0000000..15035e5
Binary files /dev/null and b/app/src/main/res/drawable/b80.png differ
diff --git a/app/src/main/res/drawable/b81.png b/app/src/main/res/drawable/b81.png
new file mode 100755
index 0000000..4ff58d8
Binary files /dev/null and b/app/src/main/res/drawable/b81.png differ
diff --git a/app/src/main/res/drawable/b82.png b/app/src/main/res/drawable/b82.png
new file mode 100755
index 0000000..299c342
Binary files /dev/null and b/app/src/main/res/drawable/b82.png differ
diff --git a/app/src/main/res/drawable/b83.png b/app/src/main/res/drawable/b83.png
new file mode 100755
index 0000000..07b20fa
Binary files /dev/null and b/app/src/main/res/drawable/b83.png differ
diff --git a/app/src/main/res/drawable/b84.png b/app/src/main/res/drawable/b84.png
new file mode 100755
index 0000000..92cd0e9
Binary files /dev/null and b/app/src/main/res/drawable/b84.png differ
diff --git a/app/src/main/res/drawable/b85.png b/app/src/main/res/drawable/b85.png
new file mode 100755
index 0000000..6992d85
Binary files /dev/null and b/app/src/main/res/drawable/b85.png differ
diff --git a/app/src/main/res/drawable/b86.png b/app/src/main/res/drawable/b86.png
new file mode 100755
index 0000000..7793f4d
Binary files /dev/null and b/app/src/main/res/drawable/b86.png differ
diff --git a/app/src/main/res/drawable/b87.png b/app/src/main/res/drawable/b87.png
new file mode 100755
index 0000000..37dbff2
Binary files /dev/null and b/app/src/main/res/drawable/b87.png differ
diff --git a/app/src/main/res/drawable/b88.png b/app/src/main/res/drawable/b88.png
new file mode 100755
index 0000000..158b9f1
Binary files /dev/null and b/app/src/main/res/drawable/b88.png differ
diff --git a/app/src/main/res/drawable/b89.png b/app/src/main/res/drawable/b89.png
new file mode 100755
index 0000000..698d1ed
Binary files /dev/null and b/app/src/main/res/drawable/b89.png differ
diff --git a/app/src/main/res/drawable/b9.png b/app/src/main/res/drawable/b9.png
new file mode 100755
index 0000000..1919bae
Binary files /dev/null and b/app/src/main/res/drawable/b9.png differ
diff --git a/app/src/main/res/drawable/b90.png b/app/src/main/res/drawable/b90.png
new file mode 100755
index 0000000..0db321e
Binary files /dev/null and b/app/src/main/res/drawable/b90.png differ
diff --git a/app/src/main/res/drawable/b91.png b/app/src/main/res/drawable/b91.png
new file mode 100755
index 0000000..e94ab98
Binary files /dev/null and b/app/src/main/res/drawable/b91.png differ
diff --git a/app/src/main/res/drawable/b92.png b/app/src/main/res/drawable/b92.png
new file mode 100755
index 0000000..66eceb9
Binary files /dev/null and b/app/src/main/res/drawable/b92.png differ
diff --git a/app/src/main/res/drawable/b93.png b/app/src/main/res/drawable/b93.png
new file mode 100755
index 0000000..97777e6
Binary files /dev/null and b/app/src/main/res/drawable/b93.png differ
diff --git a/app/src/main/res/drawable/b94.png b/app/src/main/res/drawable/b94.png
new file mode 100755
index 0000000..03ea698
Binary files /dev/null and b/app/src/main/res/drawable/b94.png differ
diff --git a/app/src/main/res/drawable/b95.png b/app/src/main/res/drawable/b95.png
new file mode 100755
index 0000000..1e194bb
Binary files /dev/null and b/app/src/main/res/drawable/b95.png differ
diff --git a/app/src/main/res/drawable/b96.png b/app/src/main/res/drawable/b96.png
new file mode 100755
index 0000000..1bb4169
Binary files /dev/null and b/app/src/main/res/drawable/b96.png differ
diff --git a/app/src/main/res/drawable/b97.png b/app/src/main/res/drawable/b97.png
new file mode 100755
index 0000000..20bde89
Binary files /dev/null and b/app/src/main/res/drawable/b97.png differ
diff --git a/app/src/main/res/drawable/b98.png b/app/src/main/res/drawable/b98.png
new file mode 100755
index 0000000..67ecdc7
Binary files /dev/null and b/app/src/main/res/drawable/b98.png differ
diff --git a/app/src/main/res/drawable/b99.png b/app/src/main/res/drawable/b99.png
new file mode 100755
index 0000000..399e05a
Binary files /dev/null and b/app/src/main/res/drawable/b99.png differ
diff --git a/app/src/main/res/drawable/button_boundary.xml b/app/src/main/res/drawable/button_boundary.xml
new file mode 100755
index 0000000..07ed283
--- /dev/null
+++ b/app/src/main/res/drawable/button_boundary.xml
@@ -0,0 +1,33 @@
+
+
+ -
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/dotted1.xml b/app/src/main/res/drawable/dotted1.xml
new file mode 100644
index 0000000..1ab5a70
--- /dev/null
+++ b/app/src/main/res/drawable/dotted1.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/dotted2.xml b/app/src/main/res/drawable/dotted2.xml
new file mode 100644
index 0000000..50b1b27
--- /dev/null
+++ b/app/src/main/res/drawable/dotted2.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/icon.png b/app/src/main/res/drawable/icon.png
new file mode 100644
index 0000000..9f45b89
Binary files /dev/null and b/app/src/main/res/drawable/icon.png differ
diff --git a/app/src/main/res/drawable/icon2.png b/app/src/main/res/drawable/icon2.png
new file mode 100755
index 0000000..4618e75
Binary files /dev/null and b/app/src/main/res/drawable/icon2.png differ
diff --git a/app/src/main/res/drawable/rectangle_animation.xml b/app/src/main/res/drawable/rectangle_animation.xml
new file mode 100644
index 0000000..b5177f3
--- /dev/null
+++ b/app/src/main/res/drawable/rectangle_animation.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/font/janda_manatee_bubble.ttf b/app/src/main/res/font/janda_manatee_bubble.ttf
new file mode 100644
index 0000000..fd60341
Binary files /dev/null and b/app/src/main/res/font/janda_manatee_bubble.ttf differ
diff --git a/app/src/main/res/font/janda_manatee_solid.ttf b/app/src/main/res/font/janda_manatee_solid.ttf
new file mode 100644
index 0000000..b4ae06a
Binary files /dev/null and b/app/src/main/res/font/janda_manatee_solid.ttf differ
diff --git a/app/src/main/res/font/lemon_juice.otf b/app/src/main/res/font/lemon_juice.otf
new file mode 100644
index 0000000..112608b
Binary files /dev/null and b/app/src/main/res/font/lemon_juice.otf differ
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..68f54eb
--- /dev/null
+++ b/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,228 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..7353dbd
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..7353dbd
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..cdcd59e
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..b8ef064
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..321f2de
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..0cd87fa
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..b80d75d
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..6d294a4
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..f9fafa2
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..d0d4c39
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..212f66e
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..1f97d60
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/raw/low.mp3 b/app/src/main/res/raw/low.mp3
new file mode 100644
index 0000000..6b4ddc7
Binary files /dev/null and b/app/src/main/res/raw/low.mp3 differ
diff --git a/app/src/main/res/values/array.xml b/app/src/main/res/values/array.xml
new file mode 100644
index 0000000..7cecac1
--- /dev/null
+++ b/app/src/main/res/values/array.xml
@@ -0,0 +1,25 @@
+
+
+
+ - 5 Sec
+ - 10 Sec
+ - 30 Sec
+ - 60 Sec
+ - 2 Min
+ - 3 Min
+ - 5 Min
+ - 10 Min
+
+
+ - 10 %
+ - 20 %
+ - 30 %
+ - 40 %
+ - 50 %
+ - 60 %
+
+
+ - On
+ - Off
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..96f60f3
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,8 @@
+
+
+ #6200EE
+ #3700B3
+ #03DAC5
+ #6200EE
+ #3700B3
+
diff --git a/app/src/main/res/values/ic_launcher_background.xml b/app/src/main/res/values/ic_launcher_background.xml
new file mode 100644
index 0000000..c5d5899
--- /dev/null
+++ b/app/src/main/res/values/ic_launcher_background.xml
@@ -0,0 +1,4 @@
+
+
+ #FFFFFF
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..aa95840
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ JioFi Battery Notifier
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..f10f06f
--- /dev/null
+++ b/app/src/main/res/values/styles.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/app/src/test/java/espero/jiofibatterynotifier/ExampleUnitTest.java b/app/src/test/java/espero/jiofibatterynotifier/ExampleUnitTest.java
new file mode 100644
index 0000000..a8fa7ac
--- /dev/null
+++ b/app/src/test/java/espero/jiofibatterynotifier/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package espero.jiofibatterynotifier;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..02c5e01
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,29 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+
+ repositories {
+ google()
+ jcenter()
+
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:4.0.2'
+
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..199d16e
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,20 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app's APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Automatically convert third-party libraries to use AndroidX
+android.enableJetifier=true
+
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..f6b961f
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..691962c
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Fri May 29 16:23:20 IST 2020
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..e95643d
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..fcbe007
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,2 @@
+rootProject.name='JioFi Battery Notifier'
+include ':app'