tajchert / BusWear

EventBus for Android Wear devices.
Apache License 2.0
257 stars 23 forks source link

Receive event without registering #6

Closed tasomaniac closed 9 years ago

tasomaniac commented 9 years ago

With the traditional EventBus systems, your app is already running and you have components already registered.

This library is cool. But my problem is that when I send something from the phone, wear app may not be running at that time. It starts the wear app because of the WearableListenerService inside it. Since there is no registered component at that time, it doesn't do anything. How do you use it in cases like this?

tajchert commented 9 years ago

This is due to architecture of EventBus itself. On my side I recommend to use MessageAPI to send command that should be run in background - but there would a problem with only one instance of WearableListenerService (you can go around it by using my other library - ServiceWear) and handle it there (ex. run Activity that should be a subscriber of particular event). Other (recommended) solution is to override syncEvent() in EventBus class and check if it is event that require to start some Activity or not. Hope it helps. If somebody find some other ways or have a comment to mentioned once - feel free to post here as well.

tasomaniac commented 9 years ago

I finally implemented my own WearableListenerService.

I am investigating libraries like yours. I must say that this library is great because it is so much simple. I also find the library Teleport. It supports custom TeleportService which can start your wear app when a message comes. But I find it hard and not straightforward to use.

Thank you very much.