Commit 416da329 authored by Harshith Goka's avatar Harshith Goka

Debugged

parent bdd0ce76
...@@ -23,6 +23,7 @@ public class Constants { ...@@ -23,6 +23,7 @@ public class Constants {
public static String END_CALL="EndCall"; public static String END_CALL="EndCall";
public static String HOME="Home"; public static String HOME="Home";
public static String BACK = "Back"; public static String BACK = "Back";
public static String VOLUME = "Volume";
public static int MODE_NORMAL = 0; public static int MODE_NORMAL = 0;
public static int MODE_VOLUME = 255; public static int MODE_VOLUME = 255;
......
...@@ -8,7 +8,7 @@ public class Gesture{ ...@@ -8,7 +8,7 @@ public class Gesture{
public int adcLevels = 2; public int adcLevels = 2;
public int adcUpper = 0; public int adcUpper = 0;
public int adcLower = 100; public int adcLower = 100;
public int mpuLevels = 100; public int mpuLevels = 3;
public int mpuUpper = 50; public int mpuUpper = 50;
public int mpuLower = -50; public int mpuLower = -50;
......
...@@ -17,4 +17,14 @@ public class GlobalClass extends Application { ...@@ -17,4 +17,14 @@ public class GlobalClass extends Application {
public Handler getProcessHandler() { public Handler getProcessHandler() {
return processHandler; return processHandler;
} }
StringBuilder stringBuilder = new StringBuilder();
public StringBuilder getStringBuilder() {
return stringBuilder;
}
public void setStringBuilder(StringBuilder stringBuilder) {
this.stringBuilder = stringBuilder;
}
} }
...@@ -8,7 +8,7 @@ import java.util.Scanner; ...@@ -8,7 +8,7 @@ import java.util.Scanner;
public class Live { public class Live {
int reading[]; int reading[];
int sensors = 10; int sensors = 11;
public Live(){ public Live(){
reading = new int [sensors]; reading = new int [sensors];
...@@ -31,9 +31,7 @@ public class Live { ...@@ -31,9 +31,7 @@ public class Live {
} }
public void update(int[] readings){ public void update(int[] readings){
for(int i = 0;i < sensors;i++){ reading = readings.clone();
reading[i] = readings[i];
}
} }
public void print(){ public void print(){
......
...@@ -61,7 +61,7 @@ public class ReceiveService extends Service { ...@@ -61,7 +61,7 @@ public class ReceiveService extends Service {
} }
else if (message.what == Constants.READ_STATUS) { else if (message.what == Constants.READ_STATUS) {
if (message.arg1 == Constants.READ_STATUS_OK) { if (message.arg1 == Constants.READ_STATUS_OK) {
if (((String) message.obj).equals(Constants.OPEN_CAMERA)) { if (message.obj.equals(Constants.OPEN_CAMERA)) {
openCamera(); openCamera();
L.s(getBaseContext(), "Camera Open"); L.s(getBaseContext(), "Camera Open");
resumeReading(message.arg2); resumeReading(message.arg2);
...@@ -102,7 +102,8 @@ public class ReceiveService extends Service { ...@@ -102,7 +102,8 @@ public class ReceiveService extends Service {
resumeReading(message.arg2); resumeReading(message.arg2);
} }
else if(message.obj.equals(Constants.VOLUME_CONTROL)){ else if(message.obj.equals(Constants.VOLUME_CONTROL)){
updateVolume((int) message.obj); updateVolume(message.getData().getInt(Constants.VOLUME));
resumeReading(Constants.MODE_VOLUME);
} }
} }
else if(message.arg1 == Constants.READ_STATUS_NOT_OK){ else if(message.arg1 == Constants.READ_STATUS_NOT_OK){
...@@ -198,6 +199,7 @@ public class ReceiveService extends Service { ...@@ -198,6 +199,7 @@ public class ReceiveService extends Service {
Intent intent = new Intent(); Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW); intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("file://" + imageLocation), "image/*"); intent.setDataAndType(Uri.parse("file://" + imageLocation), "image/*");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent); startActivity(intent);
} }
} }
...@@ -235,6 +237,7 @@ public class ReceiveService extends Service { ...@@ -235,6 +237,7 @@ public class ReceiveService extends Service {
Intent intent = new Intent(); Intent intent = new Intent();
ComponentName comp = new ComponentName("com.android.music", "com.android.music.MusicBrowserActivity"); ComponentName comp = new ComponentName("com.android.music", "com.android.music.MusicBrowserActivity");
intent.setComponent(comp); intent.setComponent(comp);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent); startActivity(intent);
} }
public void audioPlayPause(){ public void audioPlayPause(){
......
...@@ -64,7 +64,7 @@ public class StaticGesture extends Gesture { ...@@ -64,7 +64,7 @@ public class StaticGesture extends Gesture {
public boolean isInFrame(Live live){ public boolean isInFrame(Live live){
for (int i=0; i<sensors; i++) { for (int i=0; i<sensors; i++) {
if(!((eFrame[i][0]<live.reading[i]) && (live.reading[i]<eFrame[i][1]))){ if(!((eFrame[i][0]<= live.reading[i]) && (live.reading[i] <= eFrame[i][1]))){
return false; return false;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment