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

when using the close() method, it's not more possible to open() the ADK again #11

Closed
palazzem opened this Issue Nov 25, 2014 · 2 comments

Comments

Projects
None yet
1 participant
@palazzem
Copy link
Owner

palazzem commented Nov 25, 2014

No description provided.

@palazzem palazzem added the bug label Nov 25, 2014

@palazzem palazzem modified the milestone: 0.3.0 Nov 25, 2014

@palazzem

This comment has been minimized.

Copy link
Owner Author

palazzem commented Dec 25, 2014

It seems related to the ADK low level implementation. Further investigation is required.

@palazzem palazzem removed this from the 0.3.0 milestone Jan 10, 2015

@palazzem

This comment has been minimized.

Copy link
Owner Author

palazzem commented Feb 21, 2015

This wrong behavior is related to an ADK bug never fixed / merged to Android upstream. More information here:

For this reason, at the moment it's impossible through ADKToolkit to manage a "graceful shutdown" that allows to reopen the communication channel again. The only workaround that I found is to send continuous data from Arduino (so the reading thread never stuck) and call the open() in the onResume() callback while you can call the close() in the onDestroy() (event if we cannot be sure that the onDestroy() callback will be called by the system).

If we close the communication channel in the onPause(), because it's not possible to open it anymore, means that you can't open any other activity without loosing the capability to communicate with connected Accessories.

I will merge these considerations in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment