please help me with this socket(tcp)

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

please help me with this socket(tcp)

Postby pushpa » Tue Jun 23, 2009 12:13 pm

Hi Plusminus

I have tried the tcp socket program you have posted in anddev.I tried it in my system.It is working (both client and server in same system) only with loop back address 127.0.0.1.When i give Lan address(192.168.1.42) it is not working and also it is not working between two systems.I also did redir add tcp:4444:4444 in emulator console but still no result .can you please please please help me regarding this please .I am suffering with this since one month

Thanks in advance
Pushpa
pushpa
Freshman
Freshman
 
Posts: 9
Joined: Tue Jun 09, 2009 10:37 am

Top

Postby nithin11 » Tue Jun 23, 2009 12:43 pm

Hi....

I tried tcp socket connection.... it works fine for "192.168.1.2" but not for "127.0.0.1"...
can u update the sourecode...?

Thank You
Nithin
nithin11
Developer
Developer
 
Posts: 36
Joined: Mon Mar 09, 2009 5:14 am
Location: India

server and client code

Postby pushpa » Wed Jun 24, 2009 9:38 am

Hi Nithin,

Thanks for replying.I have attached the client,server and sockettest.java files.Please see and let me know.Is your code working fine between two systems?Please reply

Thanks and Regards,
Pushpa
Attachments
SocketTest.zip
(30.8 KiB) Downloaded 77 times
pushpa
Freshman
Freshman
 
Posts: 9
Joined: Tue Jun 09, 2009 10:37 am

Postby nithin11 » Thu Jun 25, 2009 5:23 am

Hi...

i tried that sample you gave... Problem is in "Socket client = serverSocket.accept(); " Server is actually not listening the client request... In my application client side is running in android and server is running in netbeans..
not in android... It works fine....

Thank You
Nithin
Nithin
nithin11
Developer
Developer
 
Posts: 36
Joined: Mon Mar 09, 2009 5:14 am
Location: India

plese see this nithin.Its abt netbeans

Postby pushpa » Fri Jun 26, 2009 10:41 am

Hi Nithin,

I installed netbeans6.5 and inserted android plug in in netbeans.Then i tried to run android appln in it.First i clicked on file->New project .Please see the attchment now.That was the window.I selected manage platforms and selected android sdk 1.5 then the next button was supposed to get enabled but it did not enable for me.Please give me the suggestion for this.It is urgent please

Thanks and Regards,
Pushpa
Attachments
netb.doc
(58 KiB) Downloaded 58 times
pushpa
Freshman
Freshman
 
Posts: 9
Joined: Tue Jun 09, 2009 10:37 am

Postby nithin11 » Sat Jun 27, 2009 11:59 am

Hi...
Dont try to install android in Netbeans... In my application Server code is written in Normal java code This code executes in netbeans only... Not in android... In android "Socket client = serverSocket.accept(); " Server is actually not listening the client request... So I tried to connect android with another server(written in netbeans)..
which is executing......

Thank You
Nithin N V
Nithin
nithin11
Developer
Developer
 
Posts: 36
Joined: Mon Mar 09, 2009 5:14 am
Location: India

Top

tcp socket

Postby pushpa » Thu Jul 02, 2009 7:30 am

Hi Nithin,

Can u please attach the entire code including java server code which u r running in netbeans and tell me how u executed if possible please

Thanks and Regards,
Pushpa
pushpa
Freshman
Freshman
 
Posts: 9
Joined: Tue Jun 09, 2009 10:37 am

Postby nithin11 » Thu Jul 02, 2009 7:54 am

Hi...

Run the server code in netbeans and client code in android... and also change the ip address and put the internet permission in manifest file.....
Attachments
server.java.java
(1.92 KiB) Downloaded 73 times
client.java
(2.54 KiB) Downloaded 71 times
Nithin
nithin11
Developer
Developer
 
Posts: 36
Joined: Mon Mar 09, 2009 5:14 am
Location: India

Postby Sapientum » Wed Nov 25, 2009 2:01 am

Hi,

I know this post is not really new, but I thought I would give it a go and post a question anyway in hope of an answer.

I've tried running your two Java-files and the server runs without any problems, but I'm having a few problems with the client....


b1 =(Button)findViewById(R.id.connect1);
b2 =(Button)findViewById(R.id.cancel);
t1 =(TextView)findViewById(R.id.text);

Those 3 lines all get the message: R.id cannot be resolved
I'm run into this problem before, but that was resolved back then by deleting import android.R; from my code... But that class isn't included in your code, so I can't seem to figure out where the problem is :)
Sapientum
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Nov 24, 2009 3:56 pm

Postby nithin11 » Thu Nov 26, 2009 9:09 am

Hi...

I think its a simple problem.... R.id.connect1 means R is root and and connect1 is id given to
button... May connect1 is not present in XML GUI file... Or Open Root file and add that 3 fileds..
Nithin
nithin11
Developer
Developer
 
Posts: 36
Joined: Mon Mar 09, 2009 5:14 am
Location: India

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests