Sending Packets via UDP over a WIFI connection

by Joshua Nelson » Fri, 12 Mar 2010 01:46:43 GMT


Sponsored Links
 Hi All,

I am trying to send UDP packets over a WIFI connection from my phone
to a Server on my pc. Here is the code that I have on my client:

 String data = "Testing";
 byte [] buffer = data.getBytes();

 DatagramPacket packet = new DatagramPacket(buffer, buffer.length,
                new InetSocketAddress(ipaddress, port));

 DatagramSocket socket = new DatagramSocket(5003);
 socket.send(packet);

I have tried this code in a Java app sending from my laptop to my
desktop and it works fine. I am assuming its because I am not setting
up the WIFI connection properly that it is not working on my phone.
Any ideas?

--



Other Threads

1. 3g problem with telephony

Hallo!

This isn't probably the right group to ask this question, but I
haven't found anything else. I have the following problem on my
Samsung Galaxy S with Android: as soon as I disable the settings
option "use only 2G networks to save battery" I have no network
connection (3G and H is available at my location and provided by the
provider - verified it with a Nokia phone) and not even telephony
works. Moreover it doesn't even seem to dial when I call somebody. The
phone is not reachable, so it doesn't ring when somebody calls. I
already tried a reset of the phone, but it didn't help (the thing is
that it already worked). Do you have an idea, which settings I messed
up?

Thanks in advance
Charlie

-- 

2. Anybody looking for a project?


To make a long story short, it occurred to me that I don't have the kind of time anymore to do really great cell phone apps, for several different operating systems, but that there are probably lots of developers looking for ideas, and both of these websites are sites that are only useful if a lot of people are using them, so the more apps, the more users, the better they are :). For that reason, I have decided that I should make my web service API's available to developers that want to develop for them. I hope it will be a good opportunity for some small developers to create great apps without having to maintain servers and databases. The API's I would release are for two websites: http://bistroblurb.com - It's a restaurant review site http://ihottonight.com - Find the clubs that are HOT tonight :). I do have Android apps for both websites that already use the web services API. If you want to see what can be done with the webservices, you can have a look at : Bistro Bot : it's available on the market or you can download it from http://bistroblurb.com/phone_pages/bistrobot/latest/bistro.apk iHotTonight : I'm just getting ready to release the BETA version... it's not on the market yet, but it can be downloaded from http://ihottonight.com/cellphoneapps/hottonight_free/latest/hottonight_free.apk I also have the start of some documentation for the web services on the following page, and I'll be adding more this week : http://ihottonight.com/index.php/cell-phone-apps/web-services-api.html Both websites are on a cloud server, so adding capacity is about a 5 minute process and our sites should be able to handle any amount of traffic you throw at them ;). If anybody is interested in developing cell phone apps for them, the terms of service for the Web Service API's allow you to monetize your apps in any way you decide. It's your app, so you can create Free apps, Free Apps with advertising, or Paid Apps without paying us any royalties. There are a few restrictions on using our name and/or logos, but I've tried to make the TOS as flexible as possible. Oh... I should also add that if the app you develop is a quality app, we will even promote it for you on our websites. Please note that the websites themselves are under development, but the Web Service API's are production ready, and both of our own cell phone apps use the same Web Service API's. If you're interested, please don't reply to this list. Send me a private email... Thanks. Sincerely, Brad Gies ----------------------------------------------------------------------- Bistro Bot - Bistro Blurb http://www.bgies.com http://www.bistroblurb.com http://www.ihottonight.com ----------------------------------------------------------------------- Never doubt that a small group of thoughtful, committed people can change the world. Indeed. It is the only thing that ever has - Margaret Mead --

3. Tabbed Preference Activity??

4. ANN: 0xbench, integrated Android benchmark suite by 0xlab

5. Sound levels

6. Pros/cons of multiple activities in an app vs. one activity, multiple views

7. Problem Porting Android Eclair to Gumstix Overo Fire