Haven is for people who need a way to protect their personal spaces and possessions without compromising their own privacy, through an Android app and on-device sensors
Refactoring to a Gradle project
mziccardfe470059ba87
diff --git a/build.gradle b/build.gradlenew file mode 100644index 0000000..2da36f4--- /dev/null+++ b/build.gradle@@ -0,0 +1,48 @@+buildscript {+ dependencies {+ classpath 'com.android.tools.build:gradle:1.1.0'+ }+}++apply plugin: 'com.android.application'++repositories {+ maven { url "http://dl.bintray.com/populov/maven" }+ mavenCentral()+}++android {+ compileSdkVersion 16+ buildToolsVersion "21.1.2"++ packagingOptions {+ exclude 'META-INF/LICENSE.txt'+ exclude 'META-INF/NOTICE.txt'+ }++ defaultConfig {+ applicationId "me.ziccard.secureit"+ minSdkVersion 10+ targetSdkVersion 15+ compileOptions {+ sourceCompatibility JavaVersion.VERSION_1_5+ targetCompatibility JavaVersion.VERSION_1_5+ }+ }++ buildTypes {+ release {+ minifyEnabled false+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'+ }+ }+}++dependencies {+ compile 'com.android.support:support-v4:18.0.0'+ compile "com.androidplot:androidplot-core:0.6.1"+ compile 'org.apache.httpcomponents:httpclient:4.2.3'+ compile 'org.apache.httpcomponents:httpcore:4.2.3'+ compile 'org.apache.httpcomponents:httpmime:4.2.3'+ compile 'com.viewpagerindicator:library:2.4.1@aar'+}diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jarnew file mode 100644index 0000000..8c0fb64Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differdiff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.propertiesnew file mode 100644index 0000000..0c71e76--- /dev/null+++ b/gradle/wrapper/gradle-wrapper.properties@@ -0,0 +1,6 @@+#Wed Apr 10 15:27:10 PDT 2013+distributionBase=GRADLE_USER_HOME+distributionPath=wrapper/dists+zipStoreBase=GRADLE_USER_HOME+zipStorePath=wrapper/dists+distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zipdiff --git a/gradlew b/gradlewnew file mode 100644index 0000000..91a7e26--- /dev/null+++ b/gradlew@@ -0,0 +1,164 @@+#!/usr/bin/env bash++##############################################################################+##+## Gradle start up script for UN*X+##+##############################################################################++# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.+DEFAULT_JVM_OPTS=""++APP_NAME="Gradle"+APP_BASE_NAME=`basename "$0"`++# 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+case "`uname`" in+ CYGWIN* )+ cygwin=true+ ;;+ Darwin* )+ darwin=true+ ;;+ MINGW* )+ msys=true+ ;;+esac++# For Cygwin, ensure paths are in UNIX format before anything is touched.+if $cygwin ; then+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`+fi++# 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\"`/" >&-+APP_HOME="`pwd -P`"+cd "$SAVED" >&-++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" ] ; 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"`++ # 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++# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules+function splitJvmOpts() {+ JVM_OPTS=("$@")+}+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"++exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"diff --git a/gradlew.bat b/gradlew.batnew file mode 100644index 0000000..aec9973--- /dev/null+++ b/gradlew.bat@@ -0,0 +1,90 @@+@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++@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=++set DIRNAME=%~dp0+if "%DIRNAME%" == "" set DIRNAME=.+set APP_BASE_NAME=%~n0+set APP_HOME=%DIRNAME%++@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 Windowz variants++if not "%OS%" == "Windows_NT" goto win9xME_args+if "%@eval[2+2]" == "4" goto 4NT_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=%*+goto execute++:4NT_args+@rem Get arguments from the 4NT Shell from JP Software+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++:omegadiff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xmlnew file mode 100644index 0000000..6f83f0b--- /dev/null+++ b/src/main/AndroidManifest.xml@@ -0,0 +1,44 @@+<manifest xmlns:android="http://schemas.android.com/apk/res/android"+ package="me.ziccard.secureit"+ android:versionCode="1"+ android:versionName="1.0" >++ <uses-permission android:name="android.permission.INTERNET" />+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />+ <uses-permission android:name="android.permission.CAMERA" />+ <uses-permission android:name="android.permission.RECORD_AUDIO"/>+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>+ <uses-permission android:name="android.permission.BLUETOOTH" />+ <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />+ <uses-permission android:name="android.permission.READ_PHONE_STATE" />+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />+ <uses-permission android:name="android.permission.SEND_SMS" />+ <uses-feature android:name="android.hardware.camera" />+ <uses-feature android:name="android.hardware.camera.autofocus" />+ <uses-feature android:glEsVersion="0x00020000" android:required="true" />++ <uses-sdk+ android:minSdkVersion="10"+ android:targetSdkVersion="15" />++ <application+ android:icon="@drawable/ic_launcher"+ android:label="@string/app_name"+ android:theme="@style/AppTheme" >+ <activity+ android:name=".StartActivity"+ android:label="@string/title_activity_start" >+ <intent-filter>+ <action android:name="android.intent.action.MAIN" />+ <category android:name="android.intent.category.LAUNCHER" />+ </intent-filter>+ </activity>+ <activity android:label="@string/app_name" android:name=".MonitorFragment"/>+ <activity+ android:label="@string/app_name"+ android:name=".MonitorActivity"+ android:launchMode="singleTop"+ android:screenOrientation="portrait"/>+ <service android:name=".service.UploadService"/>+ </application>+</manifest>diff --git a/src/me/ziccard/secureit/MicrophoneVolumePicker.java b/src/main/java/me/ziccard/secureit/MicrophoneVolumePicker.javasimilarity index 98%rename from src/me/ziccard/secureit/MicrophoneVolumePicker.javarename to src/main/java/me/ziccard/secureit/MicrophoneVolumePicker.javaindex aa420c5..9cac399 100644--- a/src/me/ziccard/secureit/MicrophoneVolumePicker.java+++ b/src/main/java/me/ziccard/secureit/MicrophoneVolumePicker.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit;import android.content.Context;diff --git a/src/me/ziccard/secureit/MonitorActivity.java b/src/main/java/me/ziccard/secureit/MonitorActivity.javasimilarity index 98%rename from src/me/ziccard/secureit/MonitorActivity.javarename to src/main/java/me/ziccard/secureit/MonitorActivity.javaindex df94dd6..b1159b8 100644--- a/src/me/ziccard/secureit/MonitorActivity.java+++ b/src/main/java/me/ziccard/secureit/MonitorActivity.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit;import me.ziccard.secureit.fragment.AccelerometerFragment;diff --git a/src/me/ziccard/secureit/Preview.java b/src/main/java/me/ziccard/secureit/Preview.javasimilarity index 98%rename from src/me/ziccard/secureit/Preview.javarename to src/main/java/me/ziccard/secureit/Preview.javaindex 7760a0d..73b8dfe 100644--- a/src/me/ziccard/secureit/Preview.java+++ b/src/main/java/me/ziccard/secureit/Preview.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit;import java.io.File;diff --git a/src/me/ziccard/secureit/SecureItPreferences.java b/src/main/java/me/ziccard/secureit/SecureItPreferences.javasimilarity index 98%rename from src/me/ziccard/secureit/SecureItPreferences.javarename to src/main/java/me/ziccard/secureit/SecureItPreferences.javaindex 297b87a..15478a9 100644--- a/src/me/ziccard/secureit/SecureItPreferences.java+++ b/src/main/java/me/ziccard/secureit/SecureItPreferences.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit;import android.app.Activity;diff --git a/src/me/ziccard/secureit/StartActivity.java b/src/main/java/me/ziccard/secureit/StartActivity.javasimilarity index 99%rename from src/me/ziccard/secureit/StartActivity.javarename to src/main/java/me/ziccard/secureit/StartActivity.javaindex 733bf69..7ad2fe7 100644--- a/src/me/ziccard/secureit/StartActivity.java+++ b/src/main/java/me/ziccard/secureit/StartActivity.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit;import java.io.File;diff --git a/src/me/ziccard/secureit/async/AudioRecorderTask.java b/src/main/java/me/ziccard/secureit/async/AudioRecorderTask.javasimilarity index 97%rename from src/me/ziccard/secureit/async/AudioRecorderTask.javarename to src/main/java/me/ziccard/secureit/async/AudioRecorderTask.javaindex 3952633..e03b179 100644--- a/src/me/ziccard/secureit/async/AudioRecorderTask.java+++ b/src/main/java/me/ziccard/secureit/async/AudioRecorderTask.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.async;import java.io.BufferedReader;diff --git a/src/me/ziccard/secureit/async/BluetoothServerTask.java b/src/main/java/me/ziccard/secureit/async/BluetoothServerTask.javasimilarity index 98%rename from src/me/ziccard/secureit/async/BluetoothServerTask.javarename to src/main/java/me/ziccard/secureit/async/BluetoothServerTask.javaindex bfb0e5f..5659642 100644--- a/src/me/ziccard/secureit/async/BluetoothServerTask.java+++ b/src/main/java/me/ziccard/secureit/async/BluetoothServerTask.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.async;import java.io.IOException;diff --git a/src/me/ziccard/secureit/async/MicSamplerTask.java b/src/main/java/me/ziccard/secureit/async/MicSamplerTask.javasimilarity index 94%rename from src/me/ziccard/secureit/async/MicSamplerTask.javarename to src/main/java/me/ziccard/secureit/async/MicSamplerTask.javaindex df56f1f..c6296df 100644--- a/src/me/ziccard/secureit/async/MicSamplerTask.java+++ b/src/main/java/me/ziccard/secureit/async/MicSamplerTask.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.async;import java.io.IOException;@@ -47,7 +53,7 @@ public class MicSamplerTask extends AsyncTask<Void,Object,Void> {publishProgress(volumeMeter.getAmplitude());}try {- Thread.sleep(1000);+ Thread.sleep(500);} catch (InterruptedException e) {//Nothing to do we exit next linediff --git a/src/me/ziccard/secureit/async/MicrophoneTaskFactory.java b/src/main/java/me/ziccard/secureit/async/MicrophoneTaskFactory.javasimilarity index 93%rename from src/me/ziccard/secureit/async/MicrophoneTaskFactory.javarename to src/main/java/me/ziccard/secureit/async/MicrophoneTaskFactory.javaindex 1cd4c7f..66d0cfb 100644--- a/src/me/ziccard/secureit/async/MicrophoneTaskFactory.java+++ b/src/main/java/me/ziccard/secureit/async/MicrophoneTaskFactory.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.async;import android.content.Context;diff --git a/src/me/ziccard/secureit/async/MotionAsyncTask.java b/src/main/java/me/ziccard/secureit/async/MotionAsyncTask.javasimilarity index 96%rename from src/me/ziccard/secureit/async/MotionAsyncTask.javarename to src/main/java/me/ziccard/secureit/async/MotionAsyncTask.javaindex b50d822..eb48e3e 100644--- a/src/me/ziccard/secureit/async/MotionAsyncTask.java+++ b/src/main/java/me/ziccard/secureit/async/MotionAsyncTask.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.async;import java.util.ArrayList;diff --git a/src/me/ziccard/secureit/async/upload/AuthenticatorTask.java b/src/main/java/me/ziccard/secureit/async/upload/AuthenticatorTask.javasimilarity index 98%rename from src/me/ziccard/secureit/async/upload/AuthenticatorTask.javarename to src/main/java/me/ziccard/secureit/async/upload/AuthenticatorTask.javaindex add3ab0..260fa4b 100644--- a/src/me/ziccard/secureit/async/upload/AuthenticatorTask.java+++ b/src/main/java/me/ziccard/secureit/async/upload/AuthenticatorTask.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.async.upload;import java.io.BufferedReader;diff --git a/src/me/ziccard/secureit/async/upload/BluetoothPeriodicPositionUploaderTask.java b/src/main/java/me/ziccard/secureit/async/upload/BluetoothPeriodicPositionUploaderTask.javasimilarity index 98%rename from src/me/ziccard/secureit/async/upload/BluetoothPeriodicPositionUploaderTask.javarename to src/main/java/me/ziccard/secureit/async/upload/BluetoothPeriodicPositionUploaderTask.javaindex 7be561e..49a1ae1 100644--- a/src/me/ziccard/secureit/async/upload/BluetoothPeriodicPositionUploaderTask.java+++ b/src/main/java/me/ziccard/secureit/async/upload/BluetoothPeriodicPositionUploaderTask.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.async.upload;import java.io.ObjectInputStream;diff --git a/src/me/ziccard/secureit/async/upload/DelegatedPositionUploaderTask.java b/src/main/java/me/ziccard/secureit/async/upload/DelegatedPositionUploaderTask.javasimilarity index 96%rename from src/me/ziccard/secureit/async/upload/DelegatedPositionUploaderTask.javarename to src/main/java/me/ziccard/secureit/async/upload/DelegatedPositionUploaderTask.javaindex c075be3..f8dba34 100644--- a/src/me/ziccard/secureit/async/upload/DelegatedPositionUploaderTask.java+++ b/src/main/java/me/ziccard/secureit/async/upload/DelegatedPositionUploaderTask.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.async.upload;import java.io.BufferedReader;diff --git a/src/me/ziccard/secureit/async/upload/ImagesUploaderTask.java b/src/main/java/me/ziccard/secureit/async/upload/ImagesUploaderTask.javasimilarity index 97%rename from src/me/ziccard/secureit/async/upload/ImagesUploaderTask.javarename to src/main/java/me/ziccard/secureit/async/upload/ImagesUploaderTask.javaindex 327661d..048ad04 100644--- a/src/me/ziccard/secureit/async/upload/ImagesUploaderTask.java+++ b/src/main/java/me/ziccard/secureit/async/upload/ImagesUploaderTask.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.async.upload;import java.io.BufferedReader;diff --git a/src/me/ziccard/secureit/async/upload/PeriodicPositionUploaderTask.java b/src/main/java/me/ziccard/secureit/async/upload/PeriodicPositionUploaderTask.javasimilarity index 98%rename from src/me/ziccard/secureit/async/upload/PeriodicPositionUploaderTask.javarename to src/main/java/me/ziccard/secureit/async/upload/PeriodicPositionUploaderTask.javaindex f546e18..770e2cb 100644--- a/src/me/ziccard/secureit/async/upload/PeriodicPositionUploaderTask.java+++ b/src/main/java/me/ziccard/secureit/async/upload/PeriodicPositionUploaderTask.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.async.upload;import java.io.BufferedReader;diff --git a/src/me/ziccard/secureit/bluetooth/ObjectBluetoothSocket.java b/src/main/java/me/ziccard/secureit/bluetooth/ObjectBluetoothSocket.javasimilarity index 91%rename from src/me/ziccard/secureit/bluetooth/ObjectBluetoothSocket.javarename to src/main/java/me/ziccard/secureit/bluetooth/ObjectBluetoothSocket.javaindex 5114405..95b61d2 100644--- a/src/me/ziccard/secureit/bluetooth/ObjectBluetoothSocket.java+++ b/src/main/java/me/ziccard/secureit/bluetooth/ObjectBluetoothSocket.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.bluetooth;import java.io.IOException;diff --git a/src/me/ziccard/secureit/codec/AudioCodec.java b/src/main/java/me/ziccard/secureit/codec/AudioCodec.javasimilarity index 66%rename from src/me/ziccard/secureit/codec/AudioCodec.javarename to src/main/java/me/ziccard/secureit/codec/AudioCodec.javaindex d4a159d..71dfde0 100644--- a/src/me/ziccard/secureit/codec/AudioCodec.java+++ b/src/main/java/me/ziccard/secureit/codec/AudioCodec.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.codec;import java.io.IOException;@@ -21,8 +27,9 @@ public class AudioCodec {if (recorder == null) {minSize = AudioRecord.getMinBufferSize(8000,- AudioFormat.CHANNEL_IN_DEFAULT,+ AudioFormat.CHANNEL_IN_DEFAULT,AudioFormat.ENCODING_PCM_16BIT);+ Log.e("AudioCodec", "Minimum size is " + minSize);recorder = new AudioRecord(MediaRecorder.AudioSource.MIC,8000,@@ -39,10 +46,17 @@ public class AudioCodec {*/public short[] getAmplitude() {if (recorder != null) {- short[] buffer = new short[minSize];- recorder.read(buffer, 0, minSize);+ short[] buffer = new short[8192];+ int readBytes = 0;+ while (readBytes < 8192) {+ readBytes += recorder.read(buffer, readBytes, 8192-readBytes);+ }+ short[] copyToReturn = Arrays.copyOf(buffer, 512);+ Arrays.sort(buffer);+ Log.e("AudioCodec", "Recorder has read: " + readBytes + " the maximum is: " ++ buffer[minSize-1]);- return Arrays.copyOf(buffer, 512);+ return copyToReturn;}return null;}diff --git a/src/me/ziccard/secureit/codec/ImageCodec.java b/src/main/java/me/ziccard/secureit/codec/ImageCodec.javasimilarity index 95%rename from src/me/ziccard/secureit/codec/ImageCodec.javarename to src/main/java/me/ziccard/secureit/codec/ImageCodec.javaindex 01a4087..d9bb88b 100644--- a/src/me/ziccard/secureit/codec/ImageCodec.java+++ b/src/main/java/me/ziccard/secureit/codec/ImageCodec.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.codec;import java.io.ByteArrayOutputStream;diff --git a/src/me/ziccard/secureit/config/Remote.java b/src/main/java/me/ziccard/secureit/config/Remote.javasimilarity index 87%rename from src/me/ziccard/secureit/config/Remote.javarename to src/main/java/me/ziccard/secureit/config/Remote.javaindex 620a9ec..a665e4b 100644--- a/src/me/ziccard/secureit/config/Remote.java+++ b/src/main/java/me/ziccard/secureit/config/Remote.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.config;import java.util.UUID;diff --git a/src/me/ziccard/secureit/fragment/AccelerometerFragment.java b/src/main/java/me/ziccard/secureit/fragment/AccelerometerFragment.javasimilarity index 98%rename from src/me/ziccard/secureit/fragment/AccelerometerFragment.javarename to src/main/java/me/ziccard/secureit/fragment/AccelerometerFragment.javaindex 8c27a7a..b216350 100644--- a/src/me/ziccard/secureit/fragment/AccelerometerFragment.java+++ b/src/main/java/me/ziccard/secureit/fragment/AccelerometerFragment.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.fragment;import me.ziccard.secureit.R;diff --git a/src/me/ziccard/secureit/fragment/CameraFragment.java b/src/main/java/me/ziccard/secureit/fragment/CameraFragment.javasimilarity index 95%rename from src/me/ziccard/secureit/fragment/CameraFragment.javarename to src/main/java/me/ziccard/secureit/fragment/CameraFragment.javaindex b4c4101..6e1c1d6 100644--- a/src/me/ziccard/secureit/fragment/CameraFragment.java+++ b/src/main/java/me/ziccard/secureit/fragment/CameraFragment.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.fragment;import me.ziccard.secureit.Preview;diff --git a/src/me/ziccard/secureit/fragment/EmptyFragment.java b/src/main/java/me/ziccard/secureit/fragment/EmptyFragment.javasimilarity index 95%rename from src/me/ziccard/secureit/fragment/EmptyFragment.javarename to src/main/java/me/ziccard/secureit/fragment/EmptyFragment.javaindex f02ba66..64d5410 100644--- a/src/me/ziccard/secureit/fragment/EmptyFragment.java+++ b/src/main/java/me/ziccard/secureit/fragment/EmptyFragment.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.fragment;import me.ziccard.secureit.R;diff --git a/src/me/ziccard/secureit/fragment/MicrophoneFragment.java b/src/main/java/me/ziccard/secureit/fragment/MicrophoneFragment.javasimilarity index 98%rename from src/me/ziccard/secureit/fragment/MicrophoneFragment.javarename to src/main/java/me/ziccard/secureit/fragment/MicrophoneFragment.javaindex ab42b96..90836df 100644--- a/src/me/ziccard/secureit/fragment/MicrophoneFragment.java+++ b/src/main/java/me/ziccard/secureit/fragment/MicrophoneFragment.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.fragment;import android.content.ComponentName;diff --git a/src/me/ziccard/secureit/messages/BluetoothMessage.java b/src/main/java/me/ziccard/secureit/messages/BluetoothMessage.javasimilarity index 62%rename from src/me/ziccard/secureit/messages/BluetoothMessage.javarename to src/main/java/me/ziccard/secureit/messages/BluetoothMessage.javaindex ed4152f..9c47fda 100644--- a/src/me/ziccard/secureit/messages/BluetoothMessage.java+++ b/src/main/java/me/ziccard/secureit/messages/BluetoothMessage.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.messages;import java.io.Serializable;diff --git a/src/me/ziccard/secureit/messages/BluetoothMessageData.java b/src/main/java/me/ziccard/secureit/messages/BluetoothMessageData.javasimilarity index 65%rename from src/me/ziccard/secureit/messages/BluetoothMessageData.javarename to src/main/java/me/ziccard/secureit/messages/BluetoothMessageData.javaindex bf189f5..75ff5ab 100644--- a/src/me/ziccard/secureit/messages/BluetoothMessageData.java+++ b/src/main/java/me/ziccard/secureit/messages/BluetoothMessageData.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.messages;import java.util.Date;diff --git a/src/me/ziccard/secureit/messages/HelloMessage.java b/src/main/java/me/ziccard/secureit/messages/HelloMessage.javasimilarity index 85%rename from src/me/ziccard/secureit/messages/HelloMessage.javarename to src/main/java/me/ziccard/secureit/messages/HelloMessage.javaindex d5ede5c..734c392 100644--- a/src/me/ziccard/secureit/messages/HelloMessage.java+++ b/src/main/java/me/ziccard/secureit/messages/HelloMessage.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.messages;import java.util.Date;diff --git a/src/me/ziccard/secureit/messages/KeyRequest.java b/src/main/java/me/ziccard/secureit/messages/KeyRequest.javasimilarity index 85%rename from src/me/ziccard/secureit/messages/KeyRequest.javarename to src/main/java/me/ziccard/secureit/messages/KeyRequest.javaindex afb9f5b..c79c943 100644--- a/src/me/ziccard/secureit/messages/KeyRequest.java+++ b/src/main/java/me/ziccard/secureit/messages/KeyRequest.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.messages;import java.util.Date;diff --git a/src/me/ziccard/secureit/messages/KeyResponse.java b/src/main/java/me/ziccard/secureit/messages/KeyResponse.javasimilarity index 83%rename from src/me/ziccard/secureit/messages/KeyResponse.javarename to src/main/java/me/ziccard/secureit/messages/KeyResponse.javaindex 621684d..42e1e53 100644--- a/src/me/ziccard/secureit/messages/KeyResponse.java+++ b/src/main/java/me/ziccard/secureit/messages/KeyResponse.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.messages;import java.util.Date;diff --git a/src/me/ziccard/secureit/messages/MessageBuilder.java b/src/main/java/me/ziccard/secureit/messages/MessageBuilder.javasimilarity index 95%rename from src/me/ziccard/secureit/messages/MessageBuilder.javarename to src/main/java/me/ziccard/secureit/messages/MessageBuilder.javaindex f4d34ad..207a158 100644--- a/src/me/ziccard/secureit/messages/MessageBuilder.java+++ b/src/main/java/me/ziccard/secureit/messages/MessageBuilder.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.messages;import java.security.spec.AlgorithmParameterSpec;diff --git a/src/me/ziccard/secureit/messages/MessageType.java b/src/main/java/me/ziccard/secureit/messages/MessageType.javasimilarity index 51%rename from src/me/ziccard/secureit/messages/MessageType.javarename to src/main/java/me/ziccard/secureit/messages/MessageType.javaindex 230e7cc..ff6c4a2 100644--- a/src/me/ziccard/secureit/messages/MessageType.java+++ b/src/main/java/me/ziccard/secureit/messages/MessageType.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.messages;public enum MessageType {diff --git a/src/me/ziccard/secureit/motiondetection/IMotionDetector.java b/src/main/java/me/ziccard/secureit/motiondetection/IMotionDetector.javasimilarity index 83%rename from src/me/ziccard/secureit/motiondetection/IMotionDetector.javarename to src/main/java/me/ziccard/secureit/motiondetection/IMotionDetector.javaindex 98c3d45..cfa4826 100644--- a/src/me/ziccard/secureit/motiondetection/IMotionDetector.java+++ b/src/main/java/me/ziccard/secureit/motiondetection/IMotionDetector.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.motiondetection;import java.util.List;diff --git a/src/me/ziccard/secureit/motiondetection/LuminanceMotionDetector.java b/src/main/java/me/ziccard/secureit/motiondetection/LuminanceMotionDetector.javasimilarity index 94%rename from src/me/ziccard/secureit/motiondetection/LuminanceMotionDetector.javarename to src/main/java/me/ziccard/secureit/motiondetection/LuminanceMotionDetector.javaindex 9cf6bbe..3c651f0 100644--- a/src/me/ziccard/secureit/motiondetection/LuminanceMotionDetector.java+++ b/src/main/java/me/ziccard/secureit/motiondetection/LuminanceMotionDetector.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.motiondetection;import java.util.ArrayList;diff --git a/src/me/ziccard/secureit/opengl/AccelerometerGLRenderer.java b/src/main/java/me/ziccard/secureit/opengl/AccelerometerGLRenderer.javasimilarity index 99%rename from src/me/ziccard/secureit/opengl/AccelerometerGLRenderer.javarename to src/main/java/me/ziccard/secureit/opengl/AccelerometerGLRenderer.javaindex b5d38e5..6809c51 100644--- a/src/me/ziccard/secureit/opengl/AccelerometerGLRenderer.java+++ b/src/main/java/me/ziccard/secureit/opengl/AccelerometerGLRenderer.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.opengl;import java.nio.ByteBuffer;diff --git a/src/me/ziccard/secureit/opengl/AccelerometerGLSurfaceView.java b/src/main/java/me/ziccard/secureit/opengl/AccelerometerGLSurfaceView.javasimilarity index 84%rename from src/me/ziccard/secureit/opengl/AccelerometerGLSurfaceView.javarename to src/main/java/me/ziccard/secureit/opengl/AccelerometerGLSurfaceView.javaindex 6e4ab8a..1976a4b 100644--- a/src/me/ziccard/secureit/opengl/AccelerometerGLSurfaceView.java+++ b/src/main/java/me/ziccard/secureit/opengl/AccelerometerGLSurfaceView.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.opengl;import android.content.Context;diff --git a/src/me/ziccard/secureit/opengl/RawResourceReader.java b/src/main/java/me/ziccard/secureit/opengl/RawResourceReader.javasimilarity index 89%rename from src/me/ziccard/secureit/opengl/RawResourceReader.javarename to src/main/java/me/ziccard/secureit/opengl/RawResourceReader.javaindex 7a94ce9..4484bc0 100644--- a/src/me/ziccard/secureit/opengl/RawResourceReader.java+++ b/src/main/java/me/ziccard/secureit/opengl/RawResourceReader.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.opengl;import java.io.BufferedReader;diff --git a/src/me/ziccard/secureit/opengl/ShaderHelper.java b/src/main/java/me/ziccard/secureit/opengl/ShaderHelper.javasimilarity index 96%rename from src/me/ziccard/secureit/opengl/ShaderHelper.javarename to src/main/java/me/ziccard/secureit/opengl/ShaderHelper.javaindex 956725d..24a30e4 100644--- a/src/me/ziccard/secureit/opengl/ShaderHelper.java+++ b/src/main/java/me/ziccard/secureit/opengl/ShaderHelper.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.opengl;import android.opengl.GLES20;diff --git a/src/me/ziccard/secureit/opengl/TextureHelper.java b/src/main/java/me/ziccard/secureit/opengl/TextureHelper.javasimilarity index 93%rename from src/me/ziccard/secureit/opengl/TextureHelper.javarename to src/main/java/me/ziccard/secureit/opengl/TextureHelper.javaindex ad5cce0..6f8286d 100644--- a/src/me/ziccard/secureit/opengl/TextureHelper.java+++ b/src/main/java/me/ziccard/secureit/opengl/TextureHelper.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.opengl;import android.content.Context;diff --git a/src/me/ziccard/secureit/service/UploadService.java b/src/main/java/me/ziccard/secureit/service/UploadService.javasimilarity index 98%rename from src/me/ziccard/secureit/service/UploadService.javarename to src/main/java/me/ziccard/secureit/service/UploadService.javaindex 0620e81..2a2b9ab 100644--- a/src/me/ziccard/secureit/service/UploadService.java+++ b/src/main/java/me/ziccard/secureit/service/UploadService.java@@ -1,3 +1,9 @@+/*+ * Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato+ * Licensed under the MIT license.+ */++package me.ziccard.secureit.service;import me.ziccard.secureit.MonitorActivity;diff --git a/src/main/res/drawable-hdpi/ic_action_search.png b/src/main/res/drawable-hdpi/ic_action_search.pngnew file mode 100644index 0000000..67de12dBinary files /dev/null and b/src/main/res/drawable-hdpi/ic_action_search.png differdiff --git a/src/main/res/drawable-hdpi/ic_launcher.png b/src/main/res/drawable-hdpi/ic_launcher.pngnew file mode 100644index 0000000..0b604cbBinary files /dev/null and b/src/main/res/drawable-hdpi/ic_launcher.png differdiff --git a/src/main/res/drawable-ldpi/ic_launcher.png b/src/main/res/drawable-ldpi/ic_launcher.pngnew file mode 100644index 0000000..3558841Binary files /dev/null and b/src/main/res/drawable-ldpi/ic_launcher.png differdiff --git a/src/main/res/drawable-mdpi/ic_action_search.png b/src/main/res/drawable-mdpi/ic_action_search.pngnew file mode 100644index 0000000..134d549Binary files /dev/null and b/src/main/res/drawable-mdpi/ic_action_search.png differdiff --git a/src/main/res/drawable-mdpi/ic_launcher.png b/src/main/res/drawable-mdpi/ic_launcher.pngnew file mode 100644index 0000000..ff604b1Binary files /dev/null and b/src/main/res/drawable-mdpi/ic_launcher.png differdiff --git a/src/main/res/drawable-xhdpi/ic_action_search.png b/src/main/res/drawable-xhdpi/ic_action_search.pngnew file mode 100644index 0000000..d699c6bBinary files /dev/null and b/src/main/res/drawable-xhdpi/ic_action_search.png differdiff --git a/src/main/res/drawable-xhdpi/ic_launcher.png b/src/main/res/drawable-xhdpi/ic_launcher.pngnew file mode 100644index 0000000..574e3ecBinary files /dev/null and b/src/main/res/drawable-xhdpi/ic_launcher.png differdiff --git a/src/main/res/drawable/back.xml b/src/main/res/drawable/back.xmlnew file mode 100644index 0000000..0a78175--- /dev/null+++ b/src/main/res/drawable/back.xml@@ -0,0 +1,7 @@+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >+ <solid android:color="#ffffff" />+ <stroke android:width="2dip" android:color="#000000"/>+ <padding android:left="7dp" android:top="7dp"+ android:right="7dp" android:bottom="7dp" />+ <corners android:radius="4dp" />+</shape>\ No newline at end of filediff --git a/src/main/res/drawable/backtx.bmp b/src/main/res/drawable/backtx.bmpnew file mode 100644index 0000000..ab16eadBinary files /dev/null and b/src/main/res/drawable/backtx.bmp differdiff --git a/src/main/res/drawable/black_white_gradient.xml b/src/main/res/drawable/black_white_gradient.xmlnew file mode 100644index 0000000..579b804--- /dev/null+++ b/src/main/res/drawable/black_white_gradient.xml@@ -0,0 +1,8 @@+<shape xmlns:android="http://schemas.android.com/apk/res/android"+ android:shape="rectangle">+ <gradient+ android:startColor="#00000000"+ android:centerColor="#FFFFFFFF"+ android:endColor="#00000000"+ android:angle="0" />+</shape>\ No newline at end of filediff --git a/src/main/res/drawable/fronttx.bmp b/src/main/res/drawable/fronttx.bmpnew file mode 100644index 0000000..e16276aBinary files /dev/null and b/src/main/res/drawable/fronttx.bmp differdiff --git a/src/main/res/drawable/red_back.xml b/src/main/res/drawable/red_back.xmlnew file mode 100644index 0000000..d322c39--- /dev/null+++ b/src/main/res/drawable/red_back.xml@@ -0,0 +1,7 @@+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >+ <solid android:color="#ffffff" />+ <stroke android:width="2dip" android:color="#FF0000"/>+ <padding android:left="7dp" android:top="7dp"+ android:right="7dp" android:bottom="7dp" />+ <corners android:radius="4dp" />+</shape>\ No newline at end of filediff --git a/src/main/res/layout/accelerometer_fragment.xml b/src/main/res/layout/accelerometer_fragment.xmlnew file mode 100644index 0000000..ec5efc7--- /dev/null+++ b/src/main/res/layout/accelerometer_fragment.xml@@ -0,0 +1,47 @@+<?xml version="1.0" encoding="utf-8"?>++<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"+ android:layout_width="fill_parent"+ android:orientation="vertical"+ android:layout_height="wrap_content">++ <TextView+ android:id="@+id/accelerometer_text"+ android:layout_centerHorizontal="true"+ android:layout_width="fill_parent"+ android:layout_height="wrap_content"+ android:text="SHAKE DETECTED"+ android:textColor="#FFFFFF"+ android:textSize="22dp"+ android:textStyle="bold"+ android:typeface="sans"+ android:background="#820600"+ android:layout_marginTop="10dp"+ android:gravity="center"+ android:paddingTop="2dp"+ android:paddingBottom="2dp"+ />++ <TextView+ android:id="@+id/magnetic_field_text"+ android:layout_below="@id/accelerometer_text"+ android:layout_centerHorizontal="true"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ />++ <TextView+ android:id="@+id/orientation_text"+ android:layout_below="@id/magnetic_field_text"+ android:layout_centerHorizontal="true"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ />++ <FrameLayout android:id="@+id/opengl"+ android:layout_below="@id/orientation_text"+ android:layout_centerHorizontal="true"+ android:layout_width="fill_parent"+ android:layout_height="fill_parent">+ </FrameLayout>+</RelativeLayout>diff --git a/src/main/res/layout/activity_monitor.xml b/src/main/res/layout/activity_monitor.xmlnew file mode 100644index 0000000..fa79d4d--- /dev/null+++ b/src/main/res/layout/activity_monitor.xml@@ -0,0 +1,21 @@+<?xml version="1.0" encoding="utf-8"?>+<LinearLayout+ xmlns:android="http://schemas.android.com/apk/res/android"+ android:orientation="vertical"+ android:layout_width="fill_parent"+ android:layout_height="fill_parent">++ <com.viewpagerindicator.TitlePageIndicator+ android:id="@+id/indicator"+ android:padding="10dip"+ android:layout_height="wrap_content"+ android:layout_width="fill_parent"+ />+ <android.support.v4.view.ViewPager+ android:id="@+id/pager"+ android:layout_width="fill_parent"+ android:layout_height="0dp"+ android:layout_weight="1"+ />++</LinearLayout>\ No newline at end of filediff --git a/src/main/res/layout/activity_start.xml b/src/main/res/layout/activity_start.xmlnew file mode 100644index 0000000..3fc324f--- /dev/null+++ b/src/main/res/layout/activity_start.xml@@ -0,0 +1,263 @@+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"+ xmlns:tools="http://schemas.android.com/tools"+ android:layout_width="fill_parent"+ android:layout_height="fill_parent">++<RelativeLayout+ android:layout_width="match_parent"+ android:layout_height="match_parent" >++ <CheckBox+ android:id="@+id/accelerometer_check"+ android:text="@string/accelerometer_label"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:layout_centerHorizontal="true"+ tools:context=".StartActivity" />++ <RelativeLayout+ android:background="@drawable/back"+ android:layout_below="@id/accelerometer_check"+ android:id="@+id/accelerometer_options"+ android:layout_width="match_parent"+ android:layout_height="wrap_content"+ android:visibility="gone"+ android:paddingLeft="30dp"+ android:paddingRight="30dp"+ android:layout_marginLeft="20dp"+ android:layout_marginRight="20dp">+ <TextView+ android:id="@+id/accelerometer_prompt"+ android:text="@string/accelerometer_prompt"+ android:layout_alignParentLeft="true"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:paddingTop="10dp"+ />+ <Spinner+ android:id="@+id/accelerometer_sensitivity_spinner"+ android:layout_alignParentRight="true"+ android:prompt="@string/accelerometer_prompt"+ android:entries="@array/accelerometer_sensitivity"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:layout_centerHorizontal="true"+ />++ </RelativeLayout>++ <CheckBox+ android:id="@+id/camera_check"+ android:text="@string/camera_label"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:layout_centerHorizontal="true"+ tools:context=".StartActivity"+ android:layout_below="@id/accelerometer_options"/>+ <RelativeLayout+ android:background="@drawable/back"+ android:layout_below="@id/camera_check"+ android:id="@+id/camera_options"+ android:layout_width="match_parent"+ android:layout_height="wrap_content"+ android:visibility="gone"+ android:paddingLeft="30dp"+ android:paddingRight="30dp"+ android:layout_marginLeft="20dp"+ android:layout_marginRight="20dp">+ <CheckBox+ android:id="@+id/flash_check"+ android:text="@string/flash_label"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:layout_centerHorizontal="true"+ tools:context=".StartActivity"+ />+ <TextView+ android:id="@+id/camera_prompt"+ android:text="@string/camera_prompt"+ android:layout_alignParentLeft="true"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:paddingTop="10dp"+ android:layout_below="@id/flash_check"+ />+ <Spinner+ android:id="@+id/camera_spinner"+ android:layout_alignParentRight="true"+ android:prompt="@string/camera_prompt"+ android:entries="@array/select_camera"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:layout_centerHorizontal="true"+ android:layout_below="@id/flash_check"+ />+ <TextView+ android:id="@+id/camera_sensitivity_prompt"+ android:text="@string/accelerometer_prompt"+ android:layout_alignParentLeft="true"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:paddingTop="10dp"+ android:layout_below="@id/camera_prompt"+ />+ <Spinner+ android:id="@+id/camera_sensitivity_spinner"+ android:layout_alignParentRight="true"+ android:layout_below="@id/camera_spinner"+ android:prompt="@string/accelerometer_prompt"+ android:entries="@array/accelerometer_sensitivity"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:layout_centerHorizontal="true"+ />++ </RelativeLayout>+ <CheckBox+ android:id="@+id/microphone_check"+ android:text="@string/microphone_label"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:layout_centerHorizontal="true"+ tools:context=".StartActivity"+ android:layout_below="@id/camera_options" />++ <RelativeLayout+ android:background="@drawable/back"+ android:layout_below="@id/microphone_check"+ android:id="@+id/microphone_options"+ android:layout_width="match_parent"+ android:layout_height="wrap_content"+ android:visibility="gone"+ android:paddingLeft="30dp"+ android:paddingRight="30dp"+ android:layout_marginLeft="20dp"+ android:layout_marginRight="20dp">+ <TextView+ android:id="@+id/microphone_prompt"+ android:text="@string/accelerometer_prompt"+ android:layout_alignParentLeft="true"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:paddingTop="10dp"+ />+ <Spinner+ android:id="@+id/microphone_sensitivity_spinner"+ android:layout_alignParentRight="true"+ android:prompt="@string/accelerometer_prompt"+ android:entries="@array/accelerometer_sensitivity"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:layout_centerHorizontal="true"+ />++ </RelativeLayout>++ <CheckBox+ android:id="@+id/sms_check"+ android:text="@string/sms_label"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:layout_centerHorizontal="true"+ tools:context=".StartActivity"+ android:layout_below="@id/microphone_options" />++ <RelativeLayout+ android:background="@drawable/back"+ android:layout_below="@id/sms_check"+ android:id="@+id/sms_options"+ android:layout_width="match_parent"+ android:layout_height="wrap_content"+ android:visibility="gone"+ android:paddingLeft="30dp"+ android:paddingRight="30dp"+ android:layout_marginLeft="20dp"+ android:layout_marginRight="20dp">+ <EditText+ android:id="@+id/phone_number"+ android:hint="@string/sms_hint"+ android:inputType="phone"+ android:layout_centerHorizontal="true"+ android:layout_width="fill_parent"+ android:layout_height="wrap_content"+ android:paddingTop="10dp"+ />++ </RelativeLayout>++ <CheckBox+ android:id="@+id/remote_check"+ android:text="@string/remote_label"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:layout_centerHorizontal="true"+ tools:context=".StartActivity"+ android:layout_below="@id/sms_options" />++ <RelativeLayout+ android:background="@drawable/back"+ android:layout_below="@id/remote_check"+ android:id="@+id/remote_options"+ android:layout_width="match_parent"+ android:layout_height="wrap_content"+ android:visibility="gone"+ android:paddingLeft="30dp"+ android:paddingRight="30dp"+ android:layout_marginLeft="20dp"+ android:layout_marginRight="20dp">+ <EditText+ android:id="@+id/email"+ android:hint="@string/email_hint"+ android:inputType="textEmailAddress"+ android:layout_centerHorizontal="true"+ android:layout_width="fill_parent"+ android:layout_height="wrap_content"+ android:paddingTop="10dp"+ />+ <EditText+ android:id="@+id/password"+ android:layout_below="@id/email"+ android:hint="@string/password_hint"+ android:inputType="textPassword"+ android:layout_centerHorizontal="true"+ android:layout_width="fill_parent"+ android:layout_height="wrap_content"+ android:paddingTop="10dp"+ />++ </RelativeLayout>++ <RelativeLayout+ android:background="@drawable/back"+ android:layout_below="@id/remote_options"+ android:id="@+id/unlock_options"+ android:layout_width="match_parent"+ android:layout_height="wrap_content"+ android:paddingLeft="30dp"+ android:paddingRight="30dp"+ android:layout_marginTop="10dp"+ android:layout_marginLeft="20dp"+ android:layout_marginRight="20dp">++ <EditText+ android:id="@+id/unlock_code"+ android:hint="@string/unlock_code_hint"+ android:inputType="textPassword"+ android:layout_centerHorizontal="true"+ android:layout_width="fill_parent"+ android:layout_height="wrap_content"+ android:paddingTop="10dp"+ />++ </RelativeLayout>++ <Button+ android:id="@+id/start_button"+ android:text="@string/start_button"+ android:layout_below="@id/unlock_options"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:layout_centerHorizontal="true"/>++</RelativeLayout>+</ScrollView>\ No newline at end of filediff --git a/src/main/res/layout/camera_fragment.xml b/src/main/res/layout/camera_fragment.xmlnew file mode 100644index 0000000..92bdbf6--- /dev/null+++ b/src/main/res/layout/camera_fragment.xml@@ -0,0 +1,43 @@+<?xml version="1.0" encoding="utf-8"?>++<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"+ android:layout_width="fill_parent"+ android:orientation="vertical"+ android:layout_height="wrap_content">++ <FrameLayout android:id="@+id/preview"+ android:layout_centerHorizontal="true"+ android:layout_width="150dp"+ android:layout_height="200dp">+ </FrameLayout>+++ <ImageView+ android:src="@drawable/ic_launcher"+ android:id="@+id/old_image"+ android:layout_alignParentLeft="true"+ android:layout_width="150dp"+ android:layout_height="200dp"+ android:paddingLeft="20dp"+ android:layout_below="@id/preview"+ />++ <ImageView+ android:id="@+id/new_image"+ android:src="@drawable/ic_launcher"+ android:layout_alignParentRight="true"+ android:layout_width="150dp"+ android:layout_height="200dp"+ android:layout_alignRight="@id/old_image"+ android:paddingRight="20dp"+ android:layout_below="@id/preview"+ />++ <TextView+ android:id="@+id/textview"+ android:layout_centerHorizontal="true"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:layout_below="@id/new_image"+ />+</RelativeLayout>diff --git a/src/main/res/layout/empty_fragment.xml b/src/main/res/layout/empty_fragment.xmlnew file mode 100644index 0000000..741b33f--- /dev/null+++ b/src/main/res/layout/empty_fragment.xml@@ -0,0 +1,28 @@+<?xml version="1.0" encoding="utf-8"?>++<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"+ android:layout_width="fill_parent"+ android:orientation="vertical"+ android:layout_height="wrap_content">++ <RelativeLayout+ android:background="@drawable/red_back"+ android:id="@+id/camera_options"+ android:layout_centerHorizontal="true"+ android:layout_centerVertical="true"+ android:layout_width="match_parent"+ android:layout_height="wrap_content"+ android:paddingLeft="30dp"+ android:paddingRight="30dp"+ android:layout_marginLeft="20dp"+ android:layout_marginRight="20dp">++ <TextView+ android:id="@+id/label"+ android:layout_centerHorizontal="true"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ />+ </RelativeLayout>++</RelativeLayout>diff --git a/src/main/res/layout/microphone_fragment.xml b/src/main/res/layout/microphone_fragment.xmlnew file mode 100644index 0000000..2af03ed--- /dev/null+++ b/src/main/res/layout/microphone_fragment.xml@@ -0,0 +1,24 @@+<?xml version="1.0" encoding="utf-8"?>++<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"+ android:layout_width="fill_parent"+ android:orientation="vertical"+ android:id="@+id/linear_layout"+ android:layout_height="wrap_content">++<!-- <com.androidplot.xy.XYPlot+ android:id="@+id/mySimpleXYPlot"+ android:layout_width="fill_parent"+ android:layout_height="200dp"+ android:layout_marginTop="10dp"+ android:layout_marginLeft="0px"+ android:layout_marginRight="0px"+ title=""+ /> -->++ <TextView xmlns:android="http://schemas.android.com/apk/res/android"+ android:id="@+id/microphone"+ android:layout_gravity="center_horizontal"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"/>+</LinearLayout>\ No newline at end of filediff --git a/src/main/res/menu/monitor_activity.xml b/src/main/res/menu/monitor_activity.xmlnew file mode 100644index 0000000..4e3c4f3--- /dev/null+++ b/src/main/res/menu/monitor_activity.xml@@ -0,0 +1,6 @@+<menu xmlns:android="http://schemas.android.com/apk/res/android">+ <item android:id="@+id/menu_settings"+ android:title="@string/menu_stop"+ android:orderInCategory="100"+ android:showAsAction="never" />+</menu>diff --git a/src/main/res/raw/per_pixel_fragment_shader.glsl b/src/main/res/raw/per_pixel_fragment_shader.glslnew file mode 100644index 0000000..c459332--- /dev/null+++ b/src/main/res/raw/per_pixel_fragment_shader.glsl@@ -0,0 +1,33 @@+precision mediump float; // Set the default precision to medium. We don't need as high of a+ // precision in the fragment shader.+uniform vec3 u_LightPos; // The position of the light in eye space.+uniform sampler2D u_Texture; // The input texture.++varying vec3 v_Position; // Interpolated position for this fragment.+varying vec4 v_Color; // This is the color from the vertex shader interpolated across the+ // triangle per fragment.+varying vec3 v_Normal; // Interpolated normal for this fragment.+varying vec2 v_TexCoordinate; // Interpolated texture coordinate per fragment.++// The entry point for our fragment shader.+void main()+{+ // Will be used for attenuation.+ float distance = length(u_LightPos - v_Position);++ // Get a lighting direction vector from the light to the vertex.+ vec3 lightVector = normalize(u_LightPos - v_Position);++ // Calculate the dot product of the light vector and vertex normal. If the normal and light vector are+ // pointing in the same direction then it will get max illumination.+ float diffuse = max(dot(v_Normal, lightVector), 0.0);++ // Add attenuation.+ diffuse = diffuse * (1.0 / (1.0 + (0.10 * distance)));++ // Add ambient lighting+ diffuse = diffuse + 0.3;++ // Multiply the color by the diffuse illumination level and texture value to get final output color.+ gl_FragColor = (v_Color * diffuse * texture2D(u_Texture, v_TexCoordinate));+}diff --git a/src/main/res/raw/per_pixel_vertex_shader.glsl b/src/main/res/raw/per_pixel_vertex_shader.glslnew file mode 100644index 0000000..1d02117--- /dev/null+++ b/src/main/res/raw/per_pixel_vertex_shader.glsl@@ -0,0 +1,32 @@+uniform mat4 u_MVPMatrix; // A constant representing the combined model/view/projection matrix.+uniform mat4 u_MVMatrix; // A constant representing the combined model/view matrix.++attribute vec4 a_Position; // Per-vertex position information we will pass in.+attribute vec4 a_Color; // Per-vertex color information we will pass in.+attribute vec3 a_Normal; // Per-vertex normal information we will pass in.+attribute vec2 a_TexCoordinate; // Per-vertex texture coordinate information we will pass in.++varying vec3 v_Position; // This will be passed into the fragment shader.+varying vec4 v_Color; // This will be passed into the fragment shader.+varying vec3 v_Normal; // This will be passed into the fragment shader.+varying vec2 v_TexCoordinate; // This will be passed into the fragment shader.++// The entry point for our vertex shader.+void main()+{+ // Transform the vertex into eye space.+ v_Position = vec3(u_MVMatrix * a_Position);++ // Pass through the color.+ v_Color = a_Color;++ // Pass through the texture coordinate.+ v_TexCoordinate = a_TexCoordinate;++ // Transform the normal's orientation into eye space.+ v_Normal = vec3(u_MVMatrix * vec4(a_Normal, 0.0));++ // gl_Position is a special variable used to store the final position.+ // Multiply the vertex by the matrix to get the final point in normalized screen coordinates.+ gl_Position = u_MVPMatrix * a_Position;+}\ No newline at end of filediff --git a/src/main/res/values-v11/styles.xml b/src/main/res/values-v11/styles.xmlnew file mode 100644index 0000000..d408cbc--- /dev/null+++ b/src/main/res/values-v11/styles.xml@@ -0,0 +1,5 @@+<resources>++ <style name="AppTheme" parent="android:Theme.Holo.Light" />++</resources>\ No newline at end of filediff --git a/src/main/res/values-v14/styles.xml b/src/main/res/values-v14/styles.xmlnew file mode 100644index 0000000..1c089a7--- /dev/null+++ b/src/main/res/values-v14/styles.xml@@ -0,0 +1,5 @@+<resources>++ <style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar" />++</resources>\ No newline at end of filediff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xmlnew file mode 100644index 0000000..433d69c--- /dev/null+++ b/src/main/res/values/strings.xml@@ -0,0 +1,79 @@+<resources>++ <string name="app_name">SecureIt</string>++ <string name="menu_stop">Stop</string>++ <string name="title_activity_start">SecureIt</string>++ <string name="accelerometer_label">+ Use accelerometer to detect motion+ </string>+ <string name="accelerometer_prompt">+ Set sensitivity+ </string>++ <string name="microphone_label">+ Use microphone to detect any sound+ </string>++ <string name="camera_label">+ Use the camera to detect motion+ </string>++ <string name="flash_label">+ Activate the flash+ </string>++ <string name="sms_label">+ Send an SMS as alert+ </string>++ <string name="remote_label">+ Send alert data to SecureIt+ </string>++ <string name="sms_hint">+ Phone+ </string>++ <string name="email_hint">+ </string>++ <string name="password_hint">+ Password+ </string>++ <string name="unlock_code_hint">+ Code to stop the app+ </string>+++ <string name="start_button">+ Start+ </string>++ <string name="camera_prompt">+ Select the camera+ </string>++ <array name="accelerometer_sensitivity">+ <item>Low</item>+ <item>Medium</item>+ <item>High</item>+ </array>+ <array name="select_camera">+ <item>Front</item>+ <item>Back</item>+ </array>++ <string name="secure_service_started">+ Home security deamon started+ </string>++ <string name="secure_service_stopped">+ Home security deamon stopped+ </string>++</resources>\ No newline at end of filediff --git a/src/main/res/values/styles.xml b/src/main/res/values/styles.xmlnew file mode 100644index 0000000..4dba0d0--- /dev/null+++ b/src/main/res/values/styles.xml@@ -0,0 +1,5 @@+<resources>++ <style name="AppTheme" parent="android:Theme.Light" />++</resources>\ No newline at end of file