Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a7ed3eb
Merge pull request #1 from danieldimit/new-UI
danieldimit Jan 24, 2016
01ef11a
Merge pull request #2 from danieldimit/new-UI
danieldimit Jan 28, 2016
3c7ab2b
Merge pull request #3 from danieldimit/new-UI
danieldimit Jan 28, 2016
c505baa
Merge pull request #4 from danieldimit/new-UI
danieldimit Jan 28, 2016
be84ecf
Habe bei allen Intents Hinzugefuegt, dass gechekt wird, welche Androi…
Jan 28, 2016
d11dd7b
Merge pull request #5 from danieldimit/new-UI
danieldimit Jan 28, 2016
c742fe7
Habe den Bluetooth Scan und verbindung mit Humidity und temperature h…
Jan 28, 2016
a261d3f
Merge branch 'master' of https://github.com/danieldimit/SmartSecurity
Jan 28, 2016
824fb5d
Merge pull request #6 from danieldimit/new-UI
danieldimit Jan 28, 2016
b42edc7
InfoActivity auto refresh every 1 second, cleaned the project a littl…
Jan 29, 2016
4d7ab58
Habe eine update funktion von Sensor implmentiert, die sensordaten we…
Jan 31, 2016
8297a90
Intent fixed
Jan 31, 2016
ac58004
Merge branch 'master' of https://github.com/danieldimit/SmartSecurity
Jan 31, 2016
37a1361
null pointer fix
Jan 31, 2016
d2efad3
Bluetooth connection in Service, SensorDataUpdater working, InfoActiv…
Jan 31, 2016
0ac7db8
Added refresh button and toast
Feb 1, 2016
4d81b4e
Habe um multiple connections erweitert undsensirion
Feb 1, 2016
44c153c
Merge branch 'master' of https://github.com/danieldimit/SmartSecurity
Feb 1, 2016
48bf0b1
Habe das löschen von sensoren eingebaut
Feb 1, 2016
587c6a5
Better logo, alarm_on_acitivity screen is locked in protrait orientation
Feb 1, 2016
57dcae9
Merge remote-tracking branch 'origin/master'
Feb 1, 2016
7fecd1f
remove unnecessary xml
Feb 1, 2016
5a34eb1
SensorListActivity xml fixed, bug- no "phantom sensor" when no connec…
Feb 1, 2016
96a9259
sensor list layout, phantom sensor bug
Feb 2, 2016
506ec9f
logic improvements and accelerometer
Collect0r Feb 2, 2016
6bdf56b
Mehrere Sensoren funktionieren nun und TI Sensortag verhält sich wie …
Feb 2, 2016
47299a1
Geht jetzt mit mehreren sensoren, manchmal kommen adaten aber nicht an
Feb 2, 2016
be7cd3b
Merge branch 'master' of https://github.com/danieldimit/SmartSecurity
Collect0r Feb 2, 2016
288f225
final
Collect0r Feb 2, 2016
54369aa
Added screenshots and documenation to repository
danieldimit Nov 29, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Smart Security

For documentations read projectReport.pdf.

To see screenshots of the application see appScreenshots.png
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ android {

defaultConfig {
applicationId "com.proseminar.smartsecurity"
minSdkVersion 15
minSdkVersion 18
targetSdkVersion 23
versionCode 1
versionName "1.0"
Expand Down
8 changes: 5 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@
-->
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<application
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<activity
android:name=".InfoActivity"
android:allowBackup="true"
android:icon="@mipmap/smartlogo"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true">
<intent-filter>
Expand All @@ -28,8 +30,8 @@
</intent-filter>
</activity>
<activity android:name=".SettingsActivity" />
<activity android:name=".AlarmOnActivity" />
<activity android:name=".MainActivity" />
<activity android:name=".AlarmOnActivity"
android:screenOrientation="portrait"/>
<activity android:name=".SensorListActivity" />


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package com.proseminar.smartsecurity;
// Declare any non-default types here with import statements
import com.proseminar.smartsecurity.SensorDataUpdateResult;
import com.proseminar.smartsecurity.SensorDataCollectorListener;
import android.bluetooth.BluetoothDevice;

interface SensorDataCollectorApi {

Expand All @@ -14,4 +15,8 @@ interface SensorDataCollectorApi {
void addListener(SensorDataCollectorListener listener);

void removeListener(SensorDataCollectorListener listener);

void addBluetoothConnection(String s);

void removeBluetoothConnection(String s);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.IBinder;
import android.os.RemoteException;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
Expand Down Expand Up @@ -38,6 +38,8 @@ public class AlarmOnActivity extends AppCompatActivity {
// Count down timers
private CountDownTimer turnOnTimer;

Resources res;

private SensorDataCollectorApi api;

private SensorDataCollectorListener.Stub collectorListener = new SensorDataCollectorListener.Stub() {
Expand Down Expand Up @@ -76,7 +78,6 @@ protected void onCreate(Bundle savedInstanceState) {
currentStatus = mPrefs.getBoolean(KEY, OFF);
updater = mPrefs.edit();

Log.e(TAG, "+++++++++++++++ ON CREATE");
// Set different layouts depending on the status of the alarm.
if (currentStatus) {
setContentView(R.layout.activity_alarm_on);
Expand All @@ -86,13 +87,15 @@ protected void onCreate(Bundle savedInstanceState) {
}
initButton();

res = getResources();
final int countDownMiliSeconds = res.getInteger(R.integer.ui_alarm_on_countdown);

if (!currentStatus) {
// Timer counting down the time until the alarm gets turned on (30 000)
turnOnTimer = new CountDownTimer(2000, 1000) {
turnOnTimer = new CountDownTimer(countDownMiliSeconds, 1000) {

public void onTick(long millisUntilFinished) {
tvSeconds.setText(Integer.toString((int) (millisUntilFinished / 1000)));
Log.e("STOP", "click");
}

// The timer is over the alarm turns on.
Expand All @@ -116,11 +119,23 @@ protected void onResume() {
turnOnTimer.start();
}

Intent intent = new Intent(SensorDataCollectorService.class.getName());
Intent intent;
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
if (currentapiVersion >= android.os.Build.VERSION_CODES.LOLLIPOP){
// Do something for lollipop and above versions

intent = new Intent(SensorDataCollectorService.class.getCanonicalName());
// This is the key line that fixed everything for me
intent.setPackage("com.proseminar.smartsecurity");
} else{
// do something for phones running an SDK before lollipop

intent = new Intent(SensorDataCollectorService.class.getName());
}
// start the service explicitly.
// otherwise it will only run while the IPC connection is up.
this.startService(intent);
bindService(intent, serviceConnection, 0);
this.bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE);
}

@Override
Expand All @@ -135,7 +150,6 @@ protected void onPause() {
@Override
protected void onDestroy() {
super.onDestroy();
Log.e(TAG, "+++++++++++++++DSTRY");
if (!(turnOnTimer == null)) {
turnOnTimer.cancel();
}
Expand Down
Loading