Hi Dirk! MQTT is really good. I've never heard about it.
Regarding 24/7 We have two states: 1. In charge (connected devices, push all required data (apks, general info, media content) to all tablets from the server; 2. In use (updates not allowed, only critical information could be submitted by using XMPP pubsub); Yes, that's a really minus of MQTT cause it doesn't allow to send ping. But I was able to find the following solution: http://stackoverflow.com/questions/10065624/how-to-send-ping-using-ecipse-paho-mqtt-client https://github.com/chinesejie/paho-for-android Thank You! Dan. понедельник, 23 сентября 2013 г., 15:55:36 UTC+3 пользователь Dirk Jäckel написал: > > Hi! > > Do you have enough power for the device so it can run 24/7 without > sleeping? i.e. an external battery or power source? > > If not, have a look at this example using MQTT. It worked for me but I > am not sure about the licensing of the wmqtt.jar. > > http://dalelane.co.uk/blog/?p=1599&cpage=1 > > It should be possible to adapt this strategy to XMPP. > > It boils down to this: > > - create a service (make it sticky) > - Create a tcp connection (to a server) > - Register Broadcast Receiver for network connectivity changes and alarm > after 20 minutes (or more/less depending on NAT timeouts of your network > provider) > - Schedule an alarm (to send keepalive packet) > - Go to sleep > - When alarm is triggered: send ping (sleep again) > - When network is lost: cleanup (sleep again) > - When message comes in: handle message (sleep again) > - When connectivity is restored: reconnect (sleep again) > > The problem with the paho and the fusecore mqtt-client implementation > is, that they do not allow sending a ping request "manually". So you > have to either patch them or send a bigger publish packet. > > Regards, > Dirk > > > > danaimset <mailto:[email protected] <javascript:>> > > 20. September 2013 08:32 > > Hi all! > > > > I'm working with one very wide project and we need to support 24/7 > > connection with device. > > This project is for custom ROM and we will not have Google apps > installed. > > We are thinking about performance. Maybe someone could help us with > > the following questions: > > How many TCP connections Google Services keep in android ? And what is > > the best practices. > > > > We need to have realtime support for all our components that will be > > controlled through the web admin. > > So we'll have to implement our own Cloud Messaging. We concentrated on > > XMPP solution that we may know. > > > > Maybe someone could suggest the best approach. > > > > Thank you, > > Dan. > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to > > [email protected]<javascript:> > > To unsubscribe from this group, send email to > > [email protected] <javascript:> > > For more options, visit this group at > > http://groups.google.com/group/android-developers?hl=en > > --- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To unsubscribe from this group and stop receiving emails from it, send > > an email to [email protected]<javascript:>. > > > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

