1

I'm looking to program something for an Android machine. Basically I want the phone to communicate with a server, sending it TCP/UDP packets, and I want the server to reply to the phone an answer depending on the packet received.

I did it while ago, with 2 PC's it wasn't really a problem. I had my "server side" running on a loop listening to a certain port and then replying.

My question is how should I write this code if I don't want to have a PC running as a server? Any recommendations on a good free-host-server on the web, and what kind of language I should use..?

As you can see I'm a bit lost, and need some tips/guides or anything that will help me get started.

Thanks a lot

2
  • This question is way to broad. Commented Nov 3, 2011 at 22:39
  • use any language and use http. I.e. you can use java+tomcat. Or php,ruby,etc. has cheap hosting. Commented Nov 3, 2011 at 22:43

2 Answers 2

2

Without better understanding of the problem space in play, he says:

Honestly, you're better off just writing a web service the phone can contact via HTTP. All of the APIs are already there in both Android and whatever server side technology you want to use (Java, Python, Ruby, knock yourself out).

Writing a bespoke socket connector is pretty archaic... 1990 called, they want their proprietary socket protocol back...

Sign up to request clarification or add additional context in comments.

Comments

2

Since you want to go from a server on the web to an android device there are a large number of choices. Just as a starting point I'd look into Google App Engine as your server (Free for light traffic) and Android development. If you search for those two keywords (GoogleAppEngine & Android) I bet you find many tutorials that will get you started.

PS: Your first paragraph describes every single web application ever created--in fact it would make a reasonable definition of what a "Server Application" is--so I'd say it's somewhat general but I hope I got the idea of what you were after and gave you a push in the right direction.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.