Sending object to Android client, what to use?

Asked

Viewed 124 times

-1

I am developing an Android app that is a table of a football championship with the results of the games presented in a list.

As the games happen I register in a database and send the result to customers on Android.

Note that customers only receive information and return nothing.

Would you like to know what to use when sending information? I intend to send a game object to the client through a simple java application that sends this object by socket.

Is that what you call a servelet? It turns out that I don’t think socket is good for sending objects, right? Plus I want something that is safe and I don’t know if socket is the most advisable way to do it. Does anyone have any suggestions?

  • 1

    Run, your question is a little wide. Try to divide your problem into smaller and more direct parts. You can [Dit] your question here.

  • 1

    Using a url and exporting to a json would be a solution.

  • Matthew your suggestion seems interesting, can you give me more information?

1 answer

0


I deepened more in the suggestions given and I believe that the best is the union of Webservice, SOAP and JASON or XML.

Thank you all for your strength!

  • 1

    The problem of using socket is that if a client is temporarily inaccessible (for example without network access), the message sent at that time is lost. The suggestion to resolve this would be to use push notification, for example GCM. Webservices are a bad option because client applications would Polling continuously to the server asking for new messages, which would cause unnecessary bandwidth consumption. Push notification is more attractive because it is the server that takes the initiative to send the message when there is something new to send.

  • Can you explain to me what it would be like?

  • 1

    Who knows when there is new information is the server. Then the most appropriate thing is for the server to take the initiative of sending the new information to the clients when it becomes available. The opposite of that is Polling: The client keeps asking the server, "Do you have new information?" Do you have new information?" , spending internet and server processing unnecessarily. Maybe that explanation help you understand better (in it "Polling" is under the name of "Pulling", both of you are right).

  • Nice guy I got! But I believe that the WS in this case also generate a problem of the type Polling, because the client will have to access the Webservice in search of a game. Right? And thinking of security I read a lot that the best is HTTP. You think I can get you security tb with socket?

  • 1

    Right. And security isn’t HTTP, it’s HTTPS. With socket you also get security, in both cases a layer of security can be added using for example SSL. But I still think you’re going the wrong way; using push notification (Google Cloud Messaging) would solve all these problems and more to ensure the arrival of the message even in cases of momentary loss of connectivity. The technology underneath the GCM are secure sockets. Doing otherwise is only worth it if you are willing to practice using these basic technologies.

  • Cool! I will seek to know more about GCM looks pretty interesting! Thanks for the help!!

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.