pubnub / java

PubNub Java-based APIs for core Java, Android
Other
673 stars 0 forks source link

Multiple instances #15

Closed matthew-reilly closed 10 years ago

matthew-reilly commented 10 years ago

Is it wise to instantiate PubNub multiple times throughout an app? (Android) If I call shutdown(), will it shutdown all instances?

geremyCohen commented 10 years ago

A single instance should be enough in most cases... any reason you'd want more than one?

matthew-reilly commented 10 years ago

Not a definite need, but I see that some people have used MessageReceivers to communicate with the pubnub instance that is housed within a service. I think this is the best option?

geremyCohen commented 10 years ago

@devendram is our Android lead, so I will let him comment to the best practice. In the meantime, have you taken a look at our subscribeAtBootService demo? I hope it can shed light in the meantime...

matthew-reilly commented 10 years ago

Thanks!

matthew-reilly commented 10 years ago

Right now I am binding my activities to a background service that uses the PubNub api. It seems to work just fine.

geremyCohen commented 10 years ago

@matthew-reilly do you still need @devendram's assistance, or are you good?

geremyCohen commented 10 years ago

Cool. We'll close this out for now then, and ping us at support@pubnub.com if you have any further issues!