Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DDC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GOKA HARSHITH
DDC
Commits
416da329
Commit
416da329
authored
Jun 30, 2016
by
Harshith Goka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debugged
parent
bdd0ce76
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
33 deletions
+55
-33
app/src/main/java/com/example/harshith/ddc/Constants.java
app/src/main/java/com/example/harshith/ddc/Constants.java
+1
-0
app/src/main/java/com/example/harshith/ddc/Gesture.java
app/src/main/java/com/example/harshith/ddc/Gesture.java
+1
-1
app/src/main/java/com/example/harshith/ddc/GlobalClass.java
app/src/main/java/com/example/harshith/ddc/GlobalClass.java
+10
-0
app/src/main/java/com/example/harshith/ddc/Live.java
app/src/main/java/com/example/harshith/ddc/Live.java
+2
-4
app/src/main/java/com/example/harshith/ddc/ReceiveDataThread.java
...main/java/com/example/harshith/ddc/ReceiveDataThread.java
+35
-25
app/src/main/java/com/example/harshith/ddc/ReceiveService.java
...rc/main/java/com/example/harshith/ddc/ReceiveService.java
+5
-2
app/src/main/java/com/example/harshith/ddc/StaticGesture.java
...src/main/java/com/example/harshith/ddc/StaticGesture.java
+1
-1
No files found.
app/src/main/java/com/example/harshith/ddc/Constants.java
View file @
416da329
...
@@ -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
;
...
...
app/src/main/java/com/example/harshith/ddc/Gesture.java
View file @
416da329
...
@@ -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
;
...
...
app/src/main/java/com/example/harshith/ddc/GlobalClass.java
View file @
416da329
...
@@ -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
;
}
}
}
app/src/main/java/com/example/harshith/ddc/Live.java
View file @
416da329
...
@@ -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
=
1
0
;
int
sensors
=
1
1
;
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
(){
...
...
app/src/main/java/com/example/harshith/ddc/ReceiveDataThread.java
View file @
416da329
...
@@ -2,6 +2,7 @@ package com.example.harshith.ddc;
...
@@ -2,6 +2,7 @@ package com.example.harshith.ddc;
import
android.bluetooth.BluetoothSocket
;
import
android.bluetooth.BluetoothSocket
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.os.Looper
;
import
android.os.Message
;
import
android.os.Message
;
...
@@ -31,7 +32,7 @@ public class ReceiveDataThread extends Thread {
...
@@ -31,7 +32,7 @@ public class ReceiveDataThread extends Thread {
this
.
bluetoothSocket
=
bluetoothSocket
;
this
.
bluetoothSocket
=
bluetoothSocket
;
this
.
handler
=
handler
;
this
.
handler
=
handler
;
this
.
globalClass
=
globalClass
;
this
.
globalClass
=
globalClass
;
stringBuilder
=
new
StringBuilder
();
this
.
mode
=
mode
;
this
.
mode
=
mode
;
a
=
new
Gesture
[
8
];
a
=
new
Gesture
[
8
];
for
(
int
i
=
0
;
i
<
8
;
i
++)
{
for
(
int
i
=
0
;
i
<
8
;
i
++)
{
...
@@ -53,7 +54,7 @@ public class ReceiveDataThread extends Thread {
...
@@ -53,7 +54,7 @@ public class ReceiveDataThread extends Thread {
a
[
q
].
updateFrame
(
hand
);
a
[
q
].
updateFrame
(
hand
);
q
=
3
;
hand
=
new
int
[]
{
0
,
1
,
1
,
1
,
0
,
8
,
8
,
8
,
8
,
1
,
8
};
q
=
3
;
hand
=
new
int
[]
{
0
,
1
,
1
,
1
,
0
,
8
,
8
,
8
,
8
,
1
,
8
};
//
End Call
//
Back
a
[
q
].
updateFrame
(
hand
);
a
[
q
].
updateFrame
(
hand
);
q
=
4
;
hand
=
new
int
[]
{
0
,
0
,
0
,
1
,
1
,
8
,
8
,
8
,-
1
,
8
,
8
};
q
=
4
;
hand
=
new
int
[]
{
0
,
0
,
0
,
1
,
1
,
8
,
8
,
8
,-
1
,
8
,
8
};
...
@@ -89,7 +90,7 @@ public class ReceiveDataThread extends Thread {
...
@@ -89,7 +90,7 @@ public class ReceiveDataThread extends Thread {
int
bytes
=
-
1
;
int
bytes
=
-
1
;
Live
staticLive
=
new
Live
();
Live
staticLive
=
new
Live
();
int
no
=
5
0
;
int
no
=
3
0
;
//StaticLive.print();
//StaticLive.print();
int
count
=
0
;
int
count
=
0
;
int
gestActive
=
-
1
;
boolean
stay
=
true
;
int
gestActive
=
-
1
;
boolean
stay
=
true
;
...
@@ -98,16 +99,16 @@ public class ReceiveDataThread extends Thread {
...
@@ -98,16 +99,16 @@ public class ReceiveDataThread extends Thread {
bytes
=
inputStream
.
read
(
buffer
);
bytes
=
inputStream
.
read
(
buffer
);
readStatus
=
Constants
.
READ_STATUS_OK
;
readStatus
=
Constants
.
READ_STATUS_OK
;
String
readMessage
=
new
String
(
buffer
,
0
,
bytes
);
String
readMessage
=
new
String
(
buffer
,
0
,
bytes
);
stringBuilder
.
append
(
readMessage
);
globalClass
.
getStringBuilder
()
.
append
(
readMessage
);
int
endOfLineIndex
=
stringBuilder
.
indexOf
(
"~"
);
int
endOfLineIndex
=
globalClass
.
getStringBuilder
()
.
indexOf
(
"~"
);
if
(
endOfLineIndex
>
0
)
{
if
(
endOfLineIndex
>
0
)
{
int
startOfLineIndex
=
stringBuilder
.
indexOf
(
"#"
);
int
startOfLineIndex
=
globalClass
.
getStringBuilder
()
.
indexOf
(
"#"
);
if
(
startOfLineIndex
>
endOfLineIndex
||
startOfLineIndex
==
-
1
)
{
if
(
startOfLineIndex
>
endOfLineIndex
||
startOfLineIndex
==
-
1
)
{
startOfLineIndex
=
0
;
startOfLineIndex
=
0
;
}
else
if
(
startOfLineIndex
==
0
)
{
}
else
if
(
startOfLineIndex
==
0
)
{
startOfLineIndex
=
1
;
startOfLineIndex
=
1
;
}
}
String
dataIn
=
stringBuilder
.
substring
(
startOfLineIndex
,
endOfLineIndex
);
String
dataIn
=
globalClass
.
getStringBuilder
()
.
substring
(
startOfLineIndex
,
endOfLineIndex
);
String
[]
readingStrings
=
dataIn
.
split
(
"\\+"
);
String
[]
readingStrings
=
dataIn
.
split
(
"\\+"
);
readings
=
new
int
[
readingStrings
.
length
];
readings
=
new
int
[
readingStrings
.
length
];
...
@@ -125,7 +126,7 @@ public class ReceiveDataThread extends Thread {
...
@@ -125,7 +126,7 @@ public class ReceiveDataThread extends Thread {
testConvert
+=
" "
+
reading
;
testConvert
+=
" "
+
reading
;
}
}
L
.
m
(
testConvert
);
L
.
m
(
testConvert
);
stringBuilder
.
delete
(
0
,
endOfLineIndex
+
2
);
globalClass
.
getStringBuilder
()
.
delete
(
0
,
endOfLineIndex
+
2
);
if
(
count
==
no
)
{
if
(
count
==
no
)
{
Log
.
d
(
"Gesture"
,
"Gesture "
+
gestActive
+
" is activated"
);
Log
.
d
(
"Gesture"
,
"Gesture "
+
gestActive
+
" is activated"
);
...
@@ -137,7 +138,11 @@ public class ReceiveDataThread extends Thread {
...
@@ -137,7 +138,11 @@ public class ReceiveDataThread extends Thread {
}
else
if
(
gestActive
==
1
)
{
}
else
if
(
gestActive
==
1
)
{
mode
=
Constants
.
MODE_VOLUME
;
mode
=
Constants
.
MODE_VOLUME
;
Looper
.
prepare
();
Looper
.
prepare
();
handler
.
obtainMessage
(
Constants
.
READ_STATUS
,
readStatus
,
mode
,
Constants
.
VOLUME_CONTROL
).
sendToTarget
();
Message
msg
=
handler
.
obtainMessage
(
Constants
.
READ_STATUS
,
readStatus
,
mode
,
Constants
.
VOLUME_CONTROL
);
Bundle
bundle
=
new
Bundle
();
bundle
.
putInt
(
Constants
.
VOLUME
,
readings
[
8
]);
msg
.
setData
(
bundle
);
handler
.
sendMessage
(
msg
);
Looper
.
loop
();
Looper
.
loop
();
}
else
if
(
gestActive
==
2
)
{
}
else
if
(
gestActive
==
2
)
{
Looper
.
prepare
();
Looper
.
prepare
();
...
@@ -145,19 +150,19 @@ public class ReceiveDataThread extends Thread {
...
@@ -145,19 +150,19 @@ public class ReceiveDataThread extends Thread {
Looper
.
loop
();
Looper
.
loop
();
}
else
if
(
gestActive
==
3
)
{
}
else
if
(
gestActive
==
3
)
{
Looper
.
prepare
();
Looper
.
prepare
();
handler
.
obtainMessage
(
Constants
.
READ_STATUS
,
readStatus
,
mode
,
Constants
.
PLAY_PAUSE
).
sendToTarget
();
handler
.
obtainMessage
(
Constants
.
READ_STATUS
,
readStatus
,
mode
,
Constants
.
BACK
).
sendToTarget
();
Looper
.
loop
();
Looper
.
loop
();
}
else
if
(
gestActive
==
4
)
{
}
else
if
(
gestActive
==
4
)
{
Looper
.
prepare
();
Looper
.
prepare
();
handler
.
obtainMessage
(
Constants
.
READ_STATUS
,
readStatus
,
mode
,
Constants
.
BACK
).
sendToTarget
();
handler
.
obtainMessage
(
Constants
.
READ_STATUS
,
readStatus
,
mode
,
Constants
.
OPEN_CAMERA
).
sendToTarget
();
Looper
.
loop
();
Looper
.
loop
();
}
else
if
(
gestActive
==
5
)
{
}
else
if
(
gestActive
==
5
)
{
Looper
.
prepare
();
Looper
.
prepare
();
handler
.
obtainMessage
(
Constants
.
READ_STATUS
,
readStatus
,
mode
,
Constants
.
OPEN_CAMERA
).
sendToTarget
();
handler
.
obtainMessage
(
Constants
.
READ_STATUS
,
readStatus
,
mode
,
Constants
.
CAMERA_CLICK
).
sendToTarget
();
Looper
.
loop
();
Looper
.
loop
();
}
else
if
(
gestActive
==
6
)
{
}
else
if
(
gestActive
==
6
)
{
Looper
.
prepare
();
Looper
.
prepare
();
handler
.
obtainMessage
(
Constants
.
READ_STATUS
,
readStatus
,
mode
,
Constants
.
CAMERA_CLICK
).
sendToTarget
();
handler
.
obtainMessage
(
Constants
.
READ_STATUS
,
readStatus
,
mode
,
Constants
.
PLAY_PAUSE
).
sendToTarget
();
Looper
.
loop
();
Looper
.
loop
();
}
else
if
(
gestActive
==
7
)
{
}
else
if
(
gestActive
==
7
)
{
Looper
.
prepare
();
Looper
.
prepare
();
...
@@ -171,7 +176,7 @@ public class ReceiveDataThread extends Thread {
...
@@ -171,7 +176,7 @@ public class ReceiveDataThread extends Thread {
}
}
if
(
count
<
no
)
{
if
(
count
<
no
)
{
if
(
readings
.
length
>
=
11
)
{
if
(
readings
.
length
=
=
11
)
{
staticLive
.
update
(
readings
);
staticLive
.
update
(
readings
);
}
}
}
}
...
@@ -196,16 +201,16 @@ public class ReceiveDataThread extends Thread {
...
@@ -196,16 +201,16 @@ public class ReceiveDataThread extends Thread {
bytes
=
inputStream
.
read
(
buffer
);
bytes
=
inputStream
.
read
(
buffer
);
readStatus
=
Constants
.
READ_STATUS_OK
;
readStatus
=
Constants
.
READ_STATUS_OK
;
String
readMessage
=
new
String
(
buffer
,
0
,
bytes
);
String
readMessage
=
new
String
(
buffer
,
0
,
bytes
);
stringBuilder
.
append
(
readMessage
);
globalClass
.
getStringBuilder
()
.
append
(
readMessage
);
int
endOfLineIndex
=
stringBuilder
.
indexOf
(
"~"
);
int
endOfLineIndex
=
globalClass
.
getStringBuilder
()
.
indexOf
(
"~"
);
if
(
endOfLineIndex
>
0
)
{
if
(
endOfLineIndex
>
0
)
{
int
startOfLineIndex
=
stringBuilder
.
indexOf
(
"#"
);
int
startOfLineIndex
=
globalClass
.
getStringBuilder
()
.
indexOf
(
"#"
);
if
(
startOfLineIndex
>
endOfLineIndex
||
startOfLineIndex
==
-
1
)
{
if
(
startOfLineIndex
>
endOfLineIndex
||
startOfLineIndex
==
-
1
)
{
startOfLineIndex
=
0
;
startOfLineIndex
=
0
;
}
else
if
(
startOfLineIndex
==
0
)
{
}
else
if
(
startOfLineIndex
==
0
)
{
startOfLineIndex
=
1
;
startOfLineIndex
=
1
;
}
}
String
dataIn
=
stringBuilder
.
substring
(
startOfLineIndex
,
endOfLineIndex
);
String
dataIn
=
globalClass
.
getStringBuilder
()
.
substring
(
startOfLineIndex
,
endOfLineIndex
);
String
[]
readingStrings
=
dataIn
.
split
(
"\\+"
);
String
[]
readingStrings
=
dataIn
.
split
(
"\\+"
);
readings
=
new
int
[
readingStrings
.
length
];
readings
=
new
int
[
readingStrings
.
length
];
...
@@ -223,19 +228,24 @@ public class ReceiveDataThread extends Thread {
...
@@ -223,19 +228,24 @@ public class ReceiveDataThread extends Thread {
testConvert
+=
" "
+
reading
;
testConvert
+=
" "
+
reading
;
}
}
L
.
m
(
testConvert
);
L
.
m
(
testConvert
);
stringBuilder
.
delete
(
0
,
endOfLineIndex
+
2
);
globalClass
.
getStringBuilder
()
.
delete
(
0
,
endOfLineIndex
+
2
);
if
(
readings
.
length
==
11
){
if
(
readings
.
length
==
11
){
staticLive
.
update
(
readings
);
staticLive
.
update
(
readings
);
}
}
if
(!
a
[
1
].
isInFrame
(
staticLive
)){
if
(!
a
[
1
].
isInFrame
(
staticLive
)){
mode
=
Constants
.
MODE_NORMAL
;
mode
=
Constants
.
MODE_NORMAL
;
Looper
.
prepare
();
Looper
.
prepare
();
handler
.
obtainMessage
(
Constants
.
READ_STATUS
,
readStatus
,
mode
,
null
).
sendToTarget
();
handler
.
obtainMessage
(
Constants
.
READ_STATUS
,
readStatus
,
mode
,
Constants
.
VOLUME_CONTROL
).
sendToTarget
();
Looper
.
loop
();
Looper
.
loop
();
}
}
else
{
else
{
mode
=
Constants
.
MODE_VOLUME
;
Looper
.
prepare
();
Looper
.
prepare
();
handler
.
obtainMessage
(
Constants
.
READ_STATUS
,
readStatus
,
mode
,
readings
[
8
]).
sendToTarget
();
Message
msg
=
handler
.
obtainMessage
(
Constants
.
READ_STATUS
,
readStatus
,
mode
,
Constants
.
VOLUME_CONTROL
);
Bundle
bundle
=
new
Bundle
();
bundle
.
putInt
(
Constants
.
VOLUME
,
readings
[
8
]);
msg
.
setData
(
bundle
);
handler
.
sendMessage
(
msg
);
Looper
.
loop
();
Looper
.
loop
();
}
}
}
}
...
@@ -252,16 +262,16 @@ public class ReceiveDataThread extends Thread {
...
@@ -252,16 +262,16 @@ public class ReceiveDataThread extends Thread {
}
}
public
void
convert
(){
public
void
convert
(){
int
endOfLineIndex
=
stringBuilder
.
indexOf
(
"~"
);
int
endOfLineIndex
=
globalClass
.
getStringBuilder
()
.
indexOf
(
"~"
);
if
(
endOfLineIndex
>
0
)
{
if
(
endOfLineIndex
>
0
)
{
int
startOfLineIndex
=
stringBuilder
.
indexOf
(
"#"
);
int
startOfLineIndex
=
globalClass
.
getStringBuilder
()
.
indexOf
(
"#"
);
if
(
startOfLineIndex
>
endOfLineIndex
||
startOfLineIndex
==
-
1
)
{
if
(
startOfLineIndex
>
endOfLineIndex
||
startOfLineIndex
==
-
1
)
{
startOfLineIndex
=
0
;
startOfLineIndex
=
0
;
}
}
else
if
(
startOfLineIndex
==
0
)
{
else
if
(
startOfLineIndex
==
0
)
{
startOfLineIndex
=
1
;
startOfLineIndex
=
1
;
}
}
String
dataIn
=
stringBuilder
.
substring
(
startOfLineIndex
,
endOfLineIndex
);
String
dataIn
=
globalClass
.
getStringBuilder
()
.
substring
(
startOfLineIndex
,
endOfLineIndex
);
String
[]
readingStrings
=
dataIn
.
split
(
"\\+"
);
String
[]
readingStrings
=
dataIn
.
split
(
"\\+"
);
readings
=
new
int
[
readingStrings
.
length
];
readings
=
new
int
[
readingStrings
.
length
];
...
@@ -280,7 +290,7 @@ public class ReceiveDataThread extends Thread {
...
@@ -280,7 +290,7 @@ public class ReceiveDataThread extends Thread {
testConvert
+=
" "
+
reading
;
testConvert
+=
" "
+
reading
;
}
}
L
.
m
(
testConvert
);
L
.
m
(
testConvert
);
stringBuilder
.
delete
(
0
,
endOfLineIndex
+
2
);
globalClass
.
getStringBuilder
()
.
delete
(
0
,
endOfLineIndex
+
2
);
// int[] flex = new int[5];
// int[] flex = new int[5];
// for (int i = 0; i != 5; i++) {
// for (int i = 0; i != 5; i++) {
...
...
app/src/main/java/com/example/harshith/ddc/ReceiveService.java
View file @
416da329
...
@@ -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
(){
...
...
app/src/main/java/com/example/harshith/ddc/StaticGesture.java
View file @
416da329
...
@@ -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
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment