Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


android networking


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 ms75214   Members   -  Reputation: 143

Like
0Likes
Like

Posted 26 April 2011 - 04:46 PM

why doesn't the android sdk come with any networking samples?

Sponsor:

#2 Zael   Members   -  Reputation: 154

Like
1Likes
Like

Posted 28 April 2011 - 11:44 AM

why doesn't the android sdk come with any networking samples?


Probably because Android networking works through Java Sockets (same way as Computer Java applications). The SDK does provide a networking example for bluetooth. For pure TCP/IP networking you should be able to just use Java Sockets and enable Internet permissions.

Note: Most carriers block incoming connections over their network (phone cannot act as server on 3g network). I found this out after days of unsuccessful testing of my own application.

Good luck.

#3 BootComp   Members   -  Reputation: 100

Like
0Likes
Like

Posted 10 June 2011 - 10:47 PM

Oh, so what other options do we have for client to client communications in Android?

#4 braindigitalis   Members   -  Reputation: 585

Like
0Likes
Like

Posted 11 June 2011 - 02:10 AM

Because a phone is behind Nat or otherwise inaccessible on a mobile internet network you will have to set up a server instead that is just hosted on a standard internet sever outside the mobile network, then connect to that. Failing that yout could use mms or text messaging i guess but that would get expensive and i certainly wouldnt use an app that communicated that way :-)

Games Currently In Development:

Currently rewriting Firework Factory - Casual Puzzler for PC in Direct3D 11. Latest Journal Entry.

 

 


#5 BootComp   Members   -  Reputation: 100

Like
0Likes
Like

Posted 11 June 2011 - 02:33 AM

Hmm... do you mean a standard HTTP server and let the app communicate over HTTP with the server?

#6 braindigitalis   Members   -  Reputation: 585

Like
0Likes
Like

Posted 11 June 2011 - 06:57 AM

Sure that would work and would be easiest to do... :-) have it talk to a database through the websever perhaps

Games Currently In Development:

Currently rewriting Firework Factory - Casual Puzzler for PC in Direct3D 11. Latest Journal Entry.

 

 


#7 VildNinja   Members   -  Reputation: 462

Like
0Likes
Like

Posted 11 June 2011 - 07:44 AM

HTTP wouldn't necessarily be a good idea.. Unless you plan on sending text, and don't care about speed (like in a turn based game).

As Zael said, it works just as on a computer. You can't create a server if you are behind a firewall, and apparently (according to Zael) most phones on a 3G network are. Therefore you have to set up a server some where directly connected to the internet (or with a port forward). once your phone connects to that server NAT should take care of allowing your phone to send and receive data from that host, whether you are using TCP, UDP or some high level protocol like HTTP.

I've noticed that some real time games only allow for multiplayer if you are on a wireless network, but i think that's just a stability thing (+ not getting angry customers with a huge data bill (so remember to make sure that your users are aware of the possible costs for using a mobile network))

Edit: Also why would any one down vote a question?

#8 braindigitalis   Members   -  Reputation: 585

Like
1Likes
Like

Posted 13 June 2011 - 06:57 AM

Last i checked the largest of the slower-paced social games use xml/http exclusively for communication (e.g. the farmville clones etc) - this is simply because the languages they use (read: flash) are best at using this for communication, and that they are more likely to be able to reach the central server even in a restricted environment and even behind a proxy.

On some 3G networks you are proxied and HTTP is the only allowed protocol. On newer phones and most networks this is not a problem, but it would certainly expand your userbase to have a HTTP based protocol.

However, as VildNinja said, you will find it to be slower and not really a good solution for any fast paced games.

Games Currently In Development:

Currently rewriting Firework Factory - Casual Puzzler for PC in Direct3D 11. Latest Journal Entry.

 

 





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS