deepstreamIO / deepstream.io-client-java

The Java/Android Client for deepstream.io
Other
35 stars 37 forks source link

Best practice for android integration #60

Closed babnik63 closed 7 years ago

babnik63 commented 7 years ago

Hi What is the best practice in using deepstream in ever connected android apps like messengers? Using android services or ...when to login, keep session between activities, ... If it is possible give me detailed info.

chinmaygit commented 7 years ago

You can use service, to maintain connection, and also session. basically your connection is your session. you can connect with user data or anonymously. depending your deepstream configuration, as far as i know about it.

yasserf commented 7 years ago

We have a DeepstreamFactory where you can get the deepstream session or create it if it doesn't exist. We will be releasing an example messenger application on github that will demonstrate that by end of this week!

babnik63 commented 7 years ago

A sample is very useful, thanks

On Sat, Feb 18, 2017, 18:00 Yasser Fadl notifications@github.com wrote:

We have a DeepstreamFactory where you can get the deepstream session or create it if it doesn't exist. We will be releasing an example messenger application on github that will demonstrate that by end of this week!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/deepstreamIO/deepstream.io-client-java/issues/60#issuecomment-280849062, or mute the thread https://github.com/notifications/unsubscribe-auth/ABLwGOrqCYVig0pnbnfiGOmDudkZZHhYks5rdwB_gaJpZM4LjQ4T .

--

Regards B.Niknia CTO & Member of board Next Generation Solutions co.

babnik63 commented 7 years ago

@yasserf Isn't there any update for an android messenger sample app?

AlexBHarley commented 7 years ago

@babnik63 we should have one out soon. I'll update this post when we do

babnik63 commented 7 years ago

My biggest problem is keep connection open and retry on network disconnect and reconnect s or open again afre restating deepstream server. All in Android.

AlexBHarley commented 7 years ago

@babnik63 I haven't had any problems with the client reconnecting after restarting a deepstream server. One thing to keep in mind though is that the client will stop reconnecting after 5 (this is configurable) attempts.

This is something we have discussed internally and will visit at some point for better offline first functionality.

babnik63 commented 7 years ago

So we can put some configs and extend reconnect attempts to infinity? Is it safe? I was working on a timer based approach.

On Fri, Mar 3, 2017, 15:38 Alex Harley notifications@github.com wrote:

@babnik63 https://github.com/babnik63 I haven't had any problems with the client reconnecting after restarting a deepstream server. One thing to keep in mind though is that the client will stop reconnecting after 5 (this is configurable) attempts.

This is something we have discussed internally and will visit at some point for better offline first functionality.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/deepstreamIO/deepstream.io-client-java/issues/60#issuecomment-283937955, or mute the thread https://github.com/notifications/unsubscribe-auth/ABLwGEaTBNQOtavJ7i5uIK25K4FNfnLdks5riAK0gaJpZM4LjQ4T .

--

Regards B.Niknia CTO & Member of board Next Generation Solutions co.

babnik63 commented 7 years ago

@yasserf , hi any news about messenger sample code?

AlexBHarley commented 7 years ago

Hey @babnik63, here are the tutorials for both web and android

We decided to use records and lists for these, however the functionality could easily be implemented with events as well.