mirror of
https://github.com/afollestad/nock-nock.git
synced 2025-08-03 06:38:38 +00:00
Alarms are set when phone reboots. Added README.
This commit is contained in:
parent
02df162526
commit
f3c3237f1e
5 changed files with 47 additions and 6 deletions
8
README.md
Normal file
8
README.md
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
## Nock Nock
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
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.
|
|
@ -8,8 +8,8 @@ android {
|
||||||
applicationId "com.afollestad.nocknock"
|
applicationId "com.afollestad.nocknock"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 24
|
targetSdkVersion 24
|
||||||
versionCode 1
|
versionCode 2
|
||||||
versionName "1.0"
|
versionName "0.1.0"
|
||||||
|
|
||||||
jackOptions {
|
jackOptions {
|
||||||
enabled true
|
enabled true
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
tools:ignore="AllowBackup,GoogleAppIndexingWarning">
|
tools:ignore="AllowBackup,GoogleAppIndexingWarning">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.MainActivity"
|
android:name="com.afollestad.nocknock.ui.MainActivity"
|
||||||
android:launchMode="singleTop">
|
android:launchMode="singleTop">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
@ -25,24 +25,30 @@
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.AddSiteActivity"
|
android:name="com.afollestad.nocknock.ui.AddSiteActivity"
|
||||||
android:label="@string/add_site"
|
android:label="@string/add_site"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:theme="@style/AppTheme.Transparent"
|
android:theme="@style/AppTheme.Transparent"
|
||||||
android:windowSoftInputMode="stateHidden" />
|
android:windowSoftInputMode="stateHidden" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.ViewSiteActivity"
|
android:name="com.afollestad.nocknock.ui.ViewSiteActivity"
|
||||||
android:label="@string/view_site"
|
android:label="@string/view_site"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:theme="@style/AppTheme.Ink"
|
android:theme="@style/AppTheme.Ink"
|
||||||
android:windowSoftInputMode="stateHidden" />
|
android:windowSoftInputMode="stateHidden" />
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".services.CheckService"
|
android:name="com.afollestad.nocknock.services.CheckService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:label="Site Check Service" />
|
android:label="Site Check Service" />
|
||||||
|
|
||||||
|
<receiver android:name=".services.BootReceiver">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
|
@ -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
BIN
art/showcase.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 695 KiB |
Loading…
Add table
Add a link
Reference in a new issue