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

Is it possible to create more than one Sensey instance in an activity listening on different views #18

Closed
c0state opened this issue Jan 24, 2017 · 2 comments
Labels

Comments

@c0state
Copy link

c0state commented Jan 24, 2017

It seems like only one instance of Sensey can be created per activity (or context to be precise). Is there any way to create and attach different Sensey listeners to more than one view in a single activity?

@nisrulz
Copy link
Owner

nisrulz commented Feb 6, 2017

@c0state the reason Sensey uses a singleton , is because it access sensor data which are specifically hardware that you have access to. The data stream you would usually get would also be one, as the hardware is going to be one. Hence even if you had multiple listeners you would still be accessing the same data stream. In this scenario all your listeners would still fire up even if you used multiple Sensey instances.

As of current state, Sensey cannot get data stream from multiple sensors of the same type in the device, which is when this would be useful, wherein Sensey could access 2 different sensors and respond on each as the data changes.

Let me know what are your thoughts on this if this makes sense to you.

@c0state
Copy link
Author

c0state commented Apr 30, 2017

That makes sense, thanks for the detailed information.

@c0state c0state closed this as completed Apr 30, 2017
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