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
bdd0ce76
Commit
bdd0ce76
authored
Jun 30, 2016
by
Harshith Goka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ArrayOutOfBound , Last resort
parent
72299da0
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
300 additions
and
239 deletions
+300
-239
app/src/main/java/com/example/harshith/ddc/Constants.java
app/src/main/java/com/example/harshith/ddc/Constants.java
+7
-2
app/src/main/java/com/example/harshith/ddc/Gesture.java
app/src/main/java/com/example/harshith/ddc/Gesture.java
+4
-4
app/src/main/java/com/example/harshith/ddc/MainActivity.java
app/src/main/java/com/example/harshith/ddc/MainActivity.java
+1
-1
app/src/main/java/com/example/harshith/ddc/ProcessService.java
...rc/main/java/com/example/harshith/ddc/ProcessService.java
+0
-23
app/src/main/java/com/example/harshith/ddc/ProcessThread.java
...src/main/java/com/example/harshith/ddc/ProcessThread.java
+0
-40
app/src/main/java/com/example/harshith/ddc/ReceiveDataThread.java
...main/java/com/example/harshith/ddc/ReceiveDataThread.java
+144
-101
app/src/main/java/com/example/harshith/ddc/ReceiveService.java
...rc/main/java/com/example/harshith/ddc/ReceiveService.java
+140
-63
app/src/main/java/com/example/harshith/ddc/StaticGesture.java
...src/main/java/com/example/harshith/ddc/StaticGesture.java
+4
-5
No files found.
app/src/main/java/com/example/harshith/ddc/Constants.java
View file @
bdd0ce76
...
@@ -13,13 +13,18 @@ public class Constants {
...
@@ -13,13 +13,18 @@ public class Constants {
public
static
int
READ_STATUS_OK
=
0
;
public
static
int
READ_STATUS_OK
=
0
;
public
static
int
READ_STATUS_NOT_OK
=
1
;
public
static
int
READ_STATUS_NOT_OK
=
1
;
public
static
String
MUSIC_PLAYER
=
"Music Player"
;
public
static
String
PLAY_PAUSE
=
"Play/Pause"
;
public
static
String
PLAY_PAUSE
=
"Play/Pause"
;
public
static
String
OK_GOOGLE
=
"Ok Google"
;
public
static
String
OK_GOOGLE
=
"Ok Google"
;
public
static
String
OPEN_CAMERA
=
"Camera"
;
public
static
String
OPEN_CAMERA
=
"Camera"
;
public
static
String
GOOGLE_NOW
=
"GoogleApp"
;
public
static
String
GOOGLE_NOW
=
"GoogleApp"
;
public
static
String
CAMERA_CLICK
=
"CameraClick"
;
public
static
String
CAMERA_CLICK
=
"CameraClick"
;
public
static
String
VOLUME_UP
=
"VolumeUp"
;
public
static
String
VOLUME_CONTROL
=
"Volume Control"
;
public
static
String
VOLUME_DOWN
=
"VolumeDown"
;
public
static
String
END_CALL
=
"EndCall"
;
public
static
String
END_CALL
=
"EndCall"
;
public
static
String
HOME
=
"Home"
;
public
static
String
BACK
=
"Back"
;
public
static
int
MODE_NORMAL
=
0
;
public
static
int
MODE_VOLUME
=
255
;
}
}
app/src/main/java/com/example/harshith/ddc/Gesture.java
View file @
bdd0ce76
...
@@ -4,13 +4,13 @@ package com.example.harshith.ddc;
...
@@ -4,13 +4,13 @@ package com.example.harshith.ddc;
public
class
Gesture
{
public
class
Gesture
{
public
int
dataPoints
=
50
;
public
int
dataPoints
=
50
;
public
int
sensors
=
1
0
;
public
int
sensors
=
1
1
;
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
=
3
;
public
int
mpuLevels
=
100
;
public
int
mpuUpper
=
1800
0
;
public
int
mpuUpper
=
5
0
;
public
int
mpuLower
=
-
1800
0
;
public
int
mpuLower
=
-
5
0
;
public
Gesture
(){}
public
Gesture
(){}
...
...
app/src/main/java/com/example/harshith/ddc/MainActivity.java
View file @
bdd0ce76
...
@@ -66,7 +66,7 @@ public class MainActivity extends AppCompatActivity {
...
@@ -66,7 +66,7 @@ public class MainActivity extends AppCompatActivity {
checkBTState
();
checkBTState
();
if
(
checkSelfPermission
(
android
.
Manifest
.
permission
.
CALL_PHONE
)
==
PackageManager
.
PERMISSION_DENIED
){
if
(
checkSelfPermission
(
android
.
Manifest
.
permission
.
CALL_PHONE
)
==
PackageManager
.
PERMISSION_DENIED
){
requestPermissions
(
new
String
[]{
android
.
Manifest
.
permission
.
CALL_PHONE
},
1
);
requestPermissions
(
new
String
[]{
android
.
Manifest
.
permission
.
CALL_PHONE
,
"android.permission.READ_EXTERNAL_STORAGE"
},
1
);
}
}
mPairedDevicesArrayAdapter
.
clear
();
mPairedDevicesArrayAdapter
.
clear
();
...
...
app/src/main/java/com/example/harshith/ddc/ProcessService.java
deleted
100644 → 0
View file @
72299da0
package
com.example.harshith.ddc
;
import
android.app.Service
;
import
android.content.Intent
;
import
android.os.IBinder
;
import
android.support.annotation.Nullable
;
/**
* Created by harshith on 18/6/16.
*/
public
class
ProcessService
extends
Service
{
@Override
public
void
onCreate
()
{
}
@Nullable
@Override
public
IBinder
onBind
(
Intent
intent
)
{
return
null
;
}
}
app/src/main/java/com/example/harshith/ddc/ProcessThread.java
deleted
100644 → 0
View file @
72299da0
package
com.example.harshith.ddc
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.os.Message
;
/**
* Created by harshith on 18/6/16.
*/
public
class
ProcessThread
extends
Thread
{
int
[]
liveReadings
;
Handler
handler
;
GlobalClass
globalClass
;
public
ProcessThread
(
GlobalClass
globalClass
)
{
liveReadings
=
null
;
this
.
globalClass
=
globalClass
;
}
@Override
public
void
run
()
{
Looper
.
prepare
();
handler
=
new
Handler
(){
@Override
public
void
handleMessage
(
Message
msg
)
{
liveReadings
=
(
int
[])
msg
.
obj
;
L
.
m
(
liveReadings
.
toString
());
}
};
globalClass
.
setProcessHandler
(
handler
);
Looper
.
loop
();
while
(
true
){
if
(
liveReadings
!=
null
){
}
}
}
}
app/src/main/java/com/example/harshith/ddc/ReceiveDataThread.java
View file @
bdd0ce76
This diff is collapsed.
Click to expand it.
app/src/main/java/com/example/harshith/ddc/ReceiveService.java
View file @
bdd0ce76
This diff is collapsed.
Click to expand it.
app/src/main/java/com/example/harshith/ddc/StaticGesture.java
View file @
bdd0ce76
...
@@ -49,17 +49,16 @@ public class StaticGesture extends Gesture {
...
@@ -49,17 +49,16 @@ public class StaticGesture extends Gesture {
Frame
[]
f
=
new
Frame
[
sensors
];
Frame
[]
f
=
new
Frame
[
sensors
];
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
f
[
i
]
=
new
Frame
(
hand
[
i
],
false
,
adcUpper
,
adcLower
,
2
);
f
[
i
]
=
new
Frame
(
hand
[
i
],
false
,
adcUpper
,
adcLower
,
adcLevels
);
}
}
for
(
int
i
=
4
;
i
<
sensors
;
i
++)
{
for
(
int
i
=
5
;
i
<
sensors
;
i
++)
{
f
[
i
]
=
new
Frame
(
hand
[
i
],
true
,
mpuUpper
,
mpuLower
,
3
);
f
[
i
]
=
new
Frame
(
hand
[
i
],
true
,
mpuUpper
,
mpuLower
,
mpuLevels
);
}
}
for
(
int
i
=
0
;
i
<
sensors
;
i
++)
{
for
(
int
i
=
0
;
i
<
sensors
;
i
++)
{
f
[
i
].
pushLimits
(
data
[
i
]);
f
[
i
].
pushLimits
(
data
[
i
]);
}
}
this
.
updateFrame
(
data
);
this
.
updateFrame
(
data
);
}
}
...
...
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