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.
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.
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.
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.
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.
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.
This is kind of confusing, can you just define an enum for all of the letters
No description provided.