Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LED_Tisch_App_Android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
LED_Tisch_App_Android
Commits
ffd8ed60
Commit
ffd8ed60
authored
Oct 30, 2019
by
Jonas Leder
Browse files
Options
Downloads
Patches
Plain Diff
fixed bug, app crashing after time, beacuse bluetooth buffer is full.
parent
ad1905ec
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/de/jonasled/led_table/controlActivity.java
+15
-3
15 additions, 3 deletions
app/src/main/java/de/jonasled/led_table/controlActivity.java
with
15 additions
and
3 deletions
app/src/main/java/de/jonasled/led_table/controlActivity.java
+
15
−
3
View file @
ffd8ed60
...
@@ -7,6 +7,7 @@ import android.bluetooth.BluetoothDevice;
...
@@ -7,6 +7,7 @@ import android.bluetooth.BluetoothDevice;
import
android.bluetooth.BluetoothSocket
;
import
android.bluetooth.BluetoothSocket
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.Button
;
import
android.widget.Toast
;
import
android.widget.Toast
;
...
@@ -45,6 +46,8 @@ public class controlActivity extends AppCompatActivity {
...
@@ -45,6 +46,8 @@ public class controlActivity extends AppCompatActivity {
private
Button
fireButton
;
private
Button
fireButton
;
private
Button
confettiButton
;
private
Button
confettiButton
;
private
Button
noiseButton
;
private
Button
noiseButton
;
private
Runnable
reciveHandlerTask
;
private
Handler
reciveHandler
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
@@ -120,6 +123,17 @@ public class controlActivity extends AppCompatActivity {
...
@@ -120,6 +123,17 @@ public class controlActivity extends AppCompatActivity {
finish
();
finish
();
}
}
reciveHandler
=
new
Handler
();
reciveHandlerTask
=
new
Runnable
()
{
@Override
public
void
run
()
{
empfangen
();
//delete every seccond the recive buffer, because if not the app will crash if the buffer is full
reciveHandler
.
postDelayed
(
reciveHandlerTask
,
1000
);
}
};
reciveHandlerTask
.
run
();
tetrisButton
.
setOnClickListener
(
new
View
.
OnClickListener
(){
tetrisButton
.
setOnClickListener
(
new
View
.
OnClickListener
(){
@Override
@Override
...
@@ -299,9 +313,7 @@ public class controlActivity extends AppCompatActivity {
...
@@ -299,9 +313,7 @@ public class controlActivity extends AppCompatActivity {
// Message zusammensetzen:
// Message zusammensetzen:
for
(
int
i
=
0
;
i
<
laenge
;
i
++)
for
(
int
i
=
0
;
i
<
laenge
;
i
++)
msg
+=
(
char
)
buffer
[
i
];
msg
+=
(
char
)
buffer
[
i
];
System
.
out
.
println
(
"recived: "
+
msg
);
Toast
.
makeText
(
this
,
msg
,
Toast
.
LENGTH_LONG
).
show
();
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment