-
Notifications
You must be signed in to change notification settings - Fork 2
Software #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Added lesson activity and integrated with main
* Add on-click listener for connect button * Removed bluefruit folder * Add FastBle dependency * Update dependencies * Added bluetooth functionality * Fix corrupt logo
public static BleDevice SignBuddy; | ||
public static ReentrantLock samplesLock = new ReentrantLock(); | ||
public static List<SignBuddyProto.SBPSample> samples = new ArrayList<>(); | ||
public static ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leave these as private and just redefine them in the other activity
public void onFinish() { | ||
countText.setText("GO!"); | ||
BleManager.getInstance().notify(MainActivity.SignBuddy, UUID_SERVICE, UUID_CHARACTERISTIC_NOTIFY, new BleNotifyCallback() { | ||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notify should be called before this somewhere. This is where you actually need to send the command to the device to record the data, and so the app should already be waiting to be notified
} | ||
} | ||
}); | ||
countText.setText(gestureData.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will get called right away like this and so this string will likely be empty
overridePendingTransition(0, 0); | ||
} | ||
else { | ||
Toast.makeText(LessonActivity.this, "Incorrect, Please try again!", Toast.LENGTH_SHORT).show(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think toast is mostly used for debug info, I think these important messages should be displayed as text in the activity screen
String data19 = String.valueOf((gestureData.getSamples(0).getTouchData().getTouch8() ? 1 : -1)/12.64911); | ||
String data20 = String.valueOf((gestureData.getSamples(0).getTouchData().getTouch9() ? 1 : -1)/12.64911); | ||
String[] args = {data0, data1, data2, data3, data4, data5, data6, data7, data8, data9, data10, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20}; | ||
SVCalpha = SVC.main(args)+1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the +1 is necessary
private boolean checkCorrect() { | ||
|
||
if (alphanum<=9){ | ||
correct = (alphanum==SVCalpha); | ||
} | ||
//skip j | ||
if (alphanum<26 && alphanum>10){ | ||
correct = (alphanum==SVCalpha-1); | ||
} | ||
if (alphanum==10 || alphanum ==26) { | ||
correct = true;//skip this letter | ||
} | ||
return correct; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is kind of confusing, can you just define an enum for all of the letters
No description provided.