Alarms are set when phone reboots. Added README.

This commit is contained in:
Aidan Follestad 2016-07-30 18:05:26 -05:00
parent 02df162526
commit f3c3237f1e
5 changed files with 47 additions and 6 deletions

8
README.md Normal file
View file

@ -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.

View file

@ -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

View file

@ -15,7 +15,7 @@
tools:ignore="AllowBackup,GoogleAppIndexingWarning">
<activity
android:name=".ui.MainActivity"
android:name="com.afollestad.nocknock.ui.MainActivity"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -25,24 +25,30 @@
</activity>
<activity
android:name=".ui.AddSiteActivity"
android:name="com.afollestad.nocknock.ui.AddSiteActivity"
android:label="@string/add_site"
android:launchMode="singleTop"
android:theme="@style/AppTheme.Transparent"
android:windowSoftInputMode="stateHidden" />
<activity
android:name=".ui.ViewSiteActivity"
android:name="com.afollestad.nocknock.ui.ViewSiteActivity"
android:label="@string/view_site"
android:launchMode="singleTop"
android:theme="@style/AppTheme.Ink"
android:windowSoftInputMode="stateHidden" />
<service
android:name=".services.CheckService"
android:name="com.afollestad.nocknock.services.CheckService"
android:enabled="true"
android:label="Site Check Service" />
<receiver android:name=".services.BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
</manifest>

View file

@ -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);
}
}
}

BIN
art/showcase.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 KiB