Android : Reliability of CCS GCM when sending downstream message

on Friday, August 1, 2014


Hi all I am having a doubt on reliability of CCS GCM theory of Google. I have followed the below link and set up a server and made a chat client in android


I can send upstream message, it gets delivered well in time. When I wanted to do a broadcast directly from the server to devices which are in the list I followed the below code


I made a for loop an



for(int i= 0; i< 100; i++){
Date date = new Date(System.currentTimeMillis());
DateFormat formatter = new SimpleDateFormat("HH:mm:ss:SSS");
String dateFormatted = formatter.format(date);
payload.put("message", dateFormatted + " "+Integer.valueOf(i).toString());
messageId = getRandomMessageId();
sInstance.send(createJsonMessage("APA91bEfm0B4q02oZWMm-Kda47aKktcMpdSedxWfgti46T10-HVeIU9wjsuXZHrwly8xzweO20CrvCbAZdrTo9tTq238uz8j8a8yw-a_9_mvKuOAaxmSF2M0-La3fQuUCIZmmmFkDMrGe-oLcGuzzFBt6KOu3JjPg_mQ_ohqDMyT_rQx9CTbBxE", messageId, payload,collapseKey, timeToLive, delayWhileIdle));
try {
Thread.sleep(10000);
} catch (InterruptedException ex) {
java.util.logging.Logger.getLogger(SmackCcsClient.class.getName()).log(Level.SEVERE, null, ex);
}
}


However I get fistful of message at android end. I have sent 100 odd messages, some times I received 20, sometime 10, sometimes 50 messages.


Is it not possible to create chat application(broadcast chat) with CCS?


N:B:- I am getting acknowledgements from Google as soon as I fire the message. Why google is not delivering..I am trying with 1 device now, in future, I am planning to have 100000 device message sending. Is it possible or not?


0 comments:

Post a Comment