diff --git a/README.md b/README.md new file mode 100644 index 0000000..62f97b5 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +## Nock Nock + +![Showcase](https://raw.githubusercontent.com/afollestad/nock-nock/master/art/showcase.png) + +Nock Nock is a simple app which allows you to monitor your websites for maximum uptime. + +The app will automatically knock on the door of your websites (or web servers) on a chosen interval +to make sure they are up and responding successfully. If something is wrong, you get a notification telling you so. \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 32524be..ee7921f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "com.afollestad.nocknock" minSdkVersion 21 targetSdkVersion 24 - versionCode 1 - versionName "1.0" + versionCode 2 + versionName "0.1.0" jackOptions { enabled true diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index fc288fb..c144c2b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,7 +15,7 @@ tools:ignore="AllowBackup,GoogleAppIndexingWarning"> @@ -25,24 +25,30 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/afollestad/nocknock/services/BootReceiver.java b/app/src/main/java/com/afollestad/nocknock/services/BootReceiver.java new file mode 100644 index 0000000..82b45c9 --- /dev/null +++ b/app/src/main/java/com/afollestad/nocknock/services/BootReceiver.java @@ -0,0 +1,27 @@ +package com.afollestad.nocknock.services; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; + +import com.afollestad.inquiry.Inquiry; +import com.afollestad.nocknock.api.ServerModel; +import com.afollestad.nocknock.ui.MainActivity; +import com.afollestad.nocknock.util.AlarmUtil; + +/** + * @author Aidan Follestad (afollestad) + */ +public class BootReceiver extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { + Inquiry.init(context, MainActivity.DB_NAME, 1); + ServerModel[] models = Inquiry.get() + .selectFrom(MainActivity.SITES_TABLE_NAME, ServerModel.class) + .all(); + AlarmUtil.setSiteChecks(context, models); + } + } +} diff --git a/art/showcase.png b/art/showcase.png new file mode 100644 index 0000000..1c2fb42 Binary files /dev/null and b/art/showcase.png differ