Skip to content
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

Phone crashes #10

Open
davidkrammer opened this issue May 1, 2019 · 4 comments
Open

Phone crashes #10

davidkrammer opened this issue May 1, 2019 · 4 comments
Labels

Comments

@davidkrammer
Copy link

My Smartphone (Samsung Galaxy S10+) crashes after around a minute using your sample Code.
It simply stops working and shutsdown and restarts.

Before it shutsdown the code works really fine! Everything works as expected.

I dont have any Logs, as i cannot connect my PC with Android Studio and the Arduino (Wemos D1 mini in my Case) at the same time..

Any ideas?

@omaraflak
Copy link
Owner

omaraflak commented May 4, 2019

Hey @davidkrammer, thank you for the feedback !

There is a way to get the logs. Do you think you could connect your phone to your pc using adb over TCP ?

Steps to do it :

  1. If your phone doesn't have this option in the developer section, you can download this app : https://play.google.com/store/apps/details?id=com.ttxapps.wifiadb&hl=en
  2. Start ADB over TCP. Your phone and your pc need to be on the same network
  3. In Android Studio's terminal, connect to your phone using adb connect <ip_address>

You should be able to see the logs now :)

Keep me updated !

@omaraflak omaraflak added the bug label May 13, 2019
@omaraflak omaraflak assigned omaraflak and unassigned omaraflak May 13, 2019
@davidkrammer
Copy link
Author

davidkrammer commented May 14, 2019

When the phone crashes the Logs from the wifiadb disappear also. But i found a temporary fix.
I added arduino.close(); in the onArduinoDetached() Method.
The only issue with this is, that i need to restart my Application if i disconnect and reconnect the Arduino. Else it won't get recognized by my App.

@omaraflak
Copy link
Owner

I'm glad you found a solution for your case, though it would nice to know why it crashed in the first place. The default behavior of Android Studio is to show the logs of the "selected application". When it crashes, the application is no longer selected and the logs disappear. You can change that in your settings. You just need to select Edit Filter Configuration… and create a filter for your app specifically.

Thanks !

@omaraflak
Copy link
Owner

Also, check out this sample code. It may help you in case you're using the lib in the wrong way :

https://github.com/OmarAflak/Arduino-Library/blob/master/app/src/main/java/me/aflak/libraries/MainActivity.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants