Android :: Server Socket Accept() Not Accepting Connections

Oct 27, 2010

I am trying to setup at ServerSocket on my Android phone, and send a char or int or anything from my computer. The code on the phone creates a ServerSocket and then blocks whilst waiting for a connection(plus some more bits if the socket is created. But I'm not getting this point, so left that out!)Basically, the phone is getting to accept, and the computer is not connecting. The xx.xx.xx.xx is the public IP of the phone I obtain programatically (and it matches up with checking on whatismyip.com).I have set the INTERNET permission on the phone. I have also been able to do this in reverse (ServerSocket on pc, client on phone).

Android :: Server Socket accept() not accepting connections


Android :: How To Use Http Connections Like TCP Socket In Java

Mar 9, 2010

may be asking a bit much here but I have faith in the community so it's worth trying. I'm making a game and I'm trying to pick the connection type to use for communicating between a Java mobile client and a Java server backend.Socket programing in Java is easy - there's a lovely tutorial on the subject and two way communication is trivial.Trouble is that on a mobile client (Android) it's not guaranteed that the cellular network will let you make TCP connections. That makes me think using an HTTP connection is the way to go. HTTP connections are request based but I need a way to push notifications from the server to the client. It seems the solution to this problem is to use 'long polling' I have read a bit about it but have yet to see a simple example for what I'm trying to achieve.Again I might be asking a lot but this seems like a fairly common problem, is there a library or framework I can import / use to wrap a Http connection and provide a two way long standing connection (That reconnects automatically etc). I read a bit about cometD but it doesn't seem to have a Java library that I can just pick up.The communication I need is not heavy, not constant two way streams of data just occasional updates either way to keep the game going.

View 4 Replies View Related

Android :: Connecting Android Bluetooth Client Socket To Ubuntu Server Socket

Jul 15, 2010

I am writing an Android app that should exchange data to a server over Bluetooth, with the server side on a PC running Ubuntu, using the bluez library, in C (or C++).

My Android app fails (IOException) when I try to connect to my server socket on the PC.

Here is essentially what I in the java code (in Android, full eclipse project here: http://dl.dropbox.com/u/2968234/ThinBTClient.zip)

CODE:...........

This throws IOException after a timeout of 10seconds or so.

On the server side (in Ubuntu 8.10), I basically set up a Bluetooth server socket, along the lines described in the example bluez/sdp-register.c

Down below is my C++ program. To compile it do

g++ -I/usr/include/glib-2.0/ -I/usr/lib/glib-2.0/include -o bt_server bt_server.cpp -lbluetooth

I can do the reverse succesfully, i.e. create a server socket in Android and connect from Linux, however this is not what I want to do!

I think either the problem has to do with my config of Ubuntu.

CODE:................

View 1 Replies View Related

Android : UDP Server Doesnt Accept Calls From Outside / Way To Fix

May 12, 2010

Ive implement simple udp server on my Android device.(sdk 1.5) it works fine when i am running a local client on the phone sends through it trigger to my server. but when i try to get udp call from an outside server to my phone, it doesn't work. already make sure the outside server isn't blocked by firewall and it's sending the udp trigger to the right port, which my phone is listening to.

View 1 Replies View Related

Android :: Server Socket Error / How To Fix?

Jun 25, 2010

I'm now facing a very strange server socket problem, I have a server that will listen on a TCP port, I use the following code to do this work. public class RequestListenerThread extends Thread.

View 4 Replies View Related

Android :: Server Socket 3G Connection

Mar 3, 2010

I have been trying to setup a Droid to Droid 3G connection. I can confirm that all works great in wifi mode. The Droid can make connection requests (Http, Telnet, raw sockets) in 3G, but I cannot get the Droid to accept a socket connection in 3G mode. I was told by Verizon that a special license may be needed to accept socket connection requests and they would send me some information. So far none has been received. If anyone knows how to program the Droid to accept socket connection requests over 3G, please respond. Also if anyone knows why this not allowed please respond.

View 10 Replies View Related

Android :: Server Socket Error

May 19, 2010

I am attempting to open a ServerSocket on my Android device to receive network connections, but do not seem to recieve network traffic from them. Running netstat -an on the device shows it is listening on 0.0.0.0:1234, but my connections to telnet to <public ip of Android device>:1234 do not appear (and do not receive a SYN,ACK in response). How can I write an application which will open an accessible server socket? Is this possible? I am thinking that either the ISP (mobile carrier) may be blocking this incoming connection attempts or the Android OS is blocking them (host firewall)?

View 4 Replies View Related

Android Server Socket Programming?

Mar 14, 2014

I have recently developed android application using server socket programming My problem is this its running show slow.

View 2 Replies View Related

Android :: How To Connect Emulator To Socket Server?

Aug 6, 2010

So I have an android application that needs to connect to a socket server. That's simple enough if the socket server was running on my development machine. However the socket server is running on a server not only not on my own machine, but on a different subnet. How would I connect my emulator to the socket server? I understand how the port forwarding works to connect to the local machine, but I'm sort of confused on how I can redirect it across a subnet from my dev machine.

View 1 Replies View Related

Android :: Client-Server App / Bad Socket Exception

Mar 3, 2010

I have a simple client-server app on android. the android service communicates with the server via tcp sockets. the service sends a simple String to server which works. the server processes the string and sends back an object to the android service. the object implements the serializable interface. the object "leaves" the server successfully but at the point where the android service receives the object (socket.readObject()

View 1 Replies View Related

Android :: Server Certificates For Two Way Authentication SSL Socket

Oct 31, 2010

I'm working on an Android app that requires both client and server certificate authentication. I have an SSLClient class that I created that works beautifully on regular desktop Java SE 6. I've moved it into my Android project and I'm getting the following error: "KeyStore JKS implementation not found".I've looked online a bit and it looks like there's a possibility that Java Keystores are not supported on Android (awesome!) but I have a feeling there's more to it than that because none of the sample code I've found resembles what I'm trying to do at all. Everything I found talks about using an http client rather than raw SSL sockets. I need SSL sockets for this application.

View 1 Replies View Related

Android :: Can't Open Server Socket On Port 80 / How To Use

Jul 18, 2009

I was developing an app which need to open serversocket.

But, when i open one on poet 80, this throw a BindException :/ iven with the INTERNET permission. Open on other port work (ex: 8080).

Does this mean android not allow me to use this socket?

View 3 Replies View Related

Android :: Server Socket Programming In 1.5 / Most Power Efficient Way?

Dec 2, 2009

I am doing a project where I have too develop an application that listens for incoming events by a service. The device that has to listen too events is an Android phone with Android SDK 1.5 on it. Currently the services that call events only implement communication trough UDP or TCP sockets. I can solve my problem by setting up a ServerSocket, but i doubt that's the most power efficient way. This application will be running most of the time, with Wi-Fi on, and I'd like too reach an long battery duration. I've been looking for options on the internet for my question for a while but i couldn't get a real answer.What is the most efficient way too listen to incoming events? Should I make an ServerSocket? or what are my options?Are there any other implementations that are more power efficient?

View 1 Replies View Related

Android :: Server Socket To Wake Up A Sleeping Phone

Mar 17, 2010

I noticed that if the Android phone is listening on a ServerSocket on the 3G network, and is then put to sleep with the power button, it no longer listens for incoming connections. The incoming TCP connection does not wake up the phone. Is this there a way to enable waking up a sleeping phone on incoming Server Socket connections, the way that incoming data on a regular Socket does?

View 2 Replies View Related

Android :: Unable To Send Data Over TCP From Java Socket To .net Tcp Server

Nov 2, 2010

i am trying to get an android app to send tcp data to a server on my network. The server was written in c#. When i use the code below to transmit data, the server only receives a whole series of.

Socket socket = new Socket(host, port);
PrintWriter pw = new PrintWriter(socket.getOutputStream(), true);
pw.print("test");
socket.close();

View 3 Replies View Related

Android :: PHP Socket Server (Push Notifications) - Security / Authentication

Aug 31, 2010

I have recently written a socket server in PHP that will be handling communication between an Android phone application and my PHP webserver. Due to the fact that Android doesn't natively support push style notifications we are going to be using our webserver as the middleware layer to handle our 'pushes'. The socket server is stable, runs well, and seems to scale nicely. While I would eventually like to re-write this in C I don't have the skill necessary to do that right now so I am going to be staying in PHP for at least a short while. As of this moment our Android emulator is able to communicate through the server, get pushes, etc. so that part is all covered.

My concern is that, right now, anyone can open a socket to my server and will be given a client connection. While we won't be passing sensitive data back and forth I don't want to allow just anyone to connect over and receive broadcast information, eat up my resources, and clog my server in general. The question is, how do I secure a server like this? Let's assume that I am running on port 25,000--can I set up some sort of SSL layer on that port and expect devices like the Android to be able to communicate over that port without any special protocols or jumping through hoops? I have considered asking the connecting clients to authenticate their user against our user database before being given a client connection, but that would require the passing of credentials in plain text over the network which I am not about to do.

I am rather new to straight TCP communication from PHP and feel like I might just be missing something simple that allows for authentication on this level.
Additional information: If I am able to get a valid username and password securely I would be using MySQL to validate the user and then accept/reject their connection based on the results of the query.

View 4 Replies View Related

Android :: Server Socket Ports Connection Timeout Error

Jul 9, 2010

I am playing around a bit with peer-to-peer communication with android devices.I have written a basic program that creates a listening ServerSocket on each phone using the application. Using the application you can also connect to other devices that is listening, by connecting to the remote ServerSocket. Nothing strange about that.My problem is that it seems that the listening port is not open for connection on different devices. I can connect to my HTC Desire, works like a charm. But connecting to a HTC Hero I get timeout, same if I try to connect to the emulator. But connection FROM the emulator to the Desire and FROM the Hero to the Desire works like a charm. Whats up with this? No security apps is installed and both devices(and the emulator) is running 2.1.

View 1 Replies View Related

Android :: Unable To Create Server Socket In Eclipse (java)

Oct 20, 2010

Hi, i am very new to programming in java however have a lot of experience in .NET (c# & vb.net). I am trying to create a new instance of a serversocket class in eclipse IDE and when i type the following code it is giving me an "Unhandled exception type IOException" and i havent even tried to run the code yet! I dont understand how my code is exceptioning before runtime or what i can do to fix it.

View 2 Replies View Related

Android : Make Socket Client - Server Source Code?

Apr 7, 2010

I want to make my phone communicate with computer with socket. I have try many kinds of source in internet. None of them works. The phone always display "HelloWorld <ActivityName>". Log.d() seems not work on my phone, because, I have used that, but nothing was printed.

View 3 Replies View Related

Android :: Connection Between Server/socket When It Moves From EDGE To WIFI And Vice Versa

Dec 16, 2009

Does Android keep the connection between the server/socket when it moves from EDGE to WIFI and vice versa?

View 1 Replies View Related

Android :: How Can Android Know That Socket Is Disconnected By Server?

Jun 6, 2009

I wrote one application using socket, which connectes to one server. for some reasone, the server may Disconnect the connection, I noticed that once the connection is disconnected, android GC starts to work, and the emulator is freeze, after a while, my application got IOException, then GC stop to work, who know why?

View 2 Replies View Related

Android :: Java Socket Not Throwing Exceptions On Dead Socket?

Jun 29, 2010

We have a simple client server architecture between our mobile device and our server both written in Java. An extremely simple ServerSocket and Socket implementation. However one problem is that when the client terminates abruptly (without closing the socket properly) the server does not know that it is disconnected. Furthermore, the server can continue to write to this socket without getting any exceptions. Why? According to documentation Java sockets should throw exceptions if you try to write to a socket that is not reachable on the other end!

View 5 Replies View Related

Android :: Socket Programming - Java - Many Clients One Socket

Nov 12, 2009

Essentially Im trying to get many many java clients connect to a socket on my ColdFusion server (Using the Socket Gateway). However before i even start to code this, Im a little confused about sockets and their performance. First of all, are sockets meant for many(1000+) clients connecting to one socket (say port 2202) on one server? How is the performance if all there waiting for is basically a ping, or something such that when these clients receive this "ping" they can go get some new data.

View 5 Replies View Related

Android :: Google Not Accepting Password

Apr 19, 2010

I was out with a friend, he asked if he could use my droid to check something on Grisliest, he sent a link thru my g mail account. Then I noticed when loggin back on to g mail it was asking me for my password? I put it in and it kept saying WRONG password (it was not).Went on my pc at home and still could not get into my account. clicked help they asked for my address, I put it in, then a scene came on saying my account has been suspended due to a violation of there terms and policies, I wrote them 3 days ago, they have not gotten back to me, I got a support phone number, but a recording says google does not have tech support via phone. So now I can not log onto my g mail, android market, maps, all I can do now is make phone calls. what can I do.

View 1 Replies View Related

Android :: Socket Exception Socket Not Connected Android

Oct 27, 2010

In my android application i am trying to run a application using GPRS connection and not WIFI.When tried to run in wifi the app runs fine.The browser works fine with the APN settings set but when trying to connect to server using my application it gives me socket exception.I am using the below permissions in manifest file.
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses- permission>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>
<uses-permission android:name= "android.permission.CHANGE_NETWORK_STATE"></uses-permission>
<uses-permission android:name= "android.permission.WRITE_APN_SETTINGS" ></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" ></uses-permission>
I am receiving Socket not connected exception.Is there any other permission which i need to add for using GPRS connection other than WIFI.
10-27 18:26:19.689: WARN/CalSyncSvc(166): com.motorola.blur.service.email.protocol.activesync.ASException: Problem executing HTTP POST

10-27 18:26:19.689: WARN/CalSyncSvc(166): at com.motorola.blur.service.email.protocol.activesync.ActiveSyncMgr.sendRequest(Unknown Source)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at com.motorola.blur.service.email.protocol.activesync.ActiveSyncMgr.sendXMLCommandNoProvisoning(Unknown Source)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at com.motorola.blur.service.email.protocol.activesync.ActiveSyncMgr.sendXMLCommand0(Unknown Source)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at com.motorola.blur.service.email.protocol.activesync.ActiveSyncMgr.sendXMLCommand(Unknown Source)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at com.motorola.blur.service.email.protocol.activesync.ActiveSyncMgr.sendFolderSyncCommand(Unknown Source)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at com.motorola.blur.service.email.protocol.activesync.ProviderAPI.sendFolderSync(Unknown Source)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at com.motorola.blur.service.email.protocol.activesync.ProviderAPI.updateMapFromFolderSync(Unknown Source)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at com.motorola.blur.service.email.protocol.activesync.ProviderAPI.updateFromFolderSync(Unknown Source)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at com.motorola.blur.calendar.sync.activesync.SyncService.syncAccount(Unknown Source)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at com.motorola.blur.calendar.sync.activesync.SyncService$QueueEntry.run(Unknown Source)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:416)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at java.util.concurrent.FutureTask.run(FutureTask.java:122)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at java.lang.Thread.run(Thread.java:1058)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at com.motorola.blur.util.concurrent.BlurThreadFactory$BlurPooledThread.run(Unknown Source)
10-27 18:26:19.689: WARN/CalSyncSvc(166): Caused by: java.net.SocketTimeoutException: Socket is not connected
10-27 18:26:19.689: WARN/CalSyncSvc(166): at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl(Native Method)


10-27 18:26:19.689: WARN/CalSyncSvc(166): at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocket(OSNetworkSystem.java:140)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:229)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:521)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at java.net.Socket.connect(Socket.java:1019)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:317)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:129)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
10-27 18:26:19.689: WARN/CalSyncSvc(166): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
10-27 18:26:19.689: WARN/CalSyncSvc(166): ... 17 more

View 2 Replies View Related

General :: Android 4.3 - Delete Email After Accepting Event Request

Mar 11, 2014

I am running Android 4.3 and I have a issue when I delete Event Emails.When i accept an Event Email request, it is added to the S Planner !when I delete the Event Email from the built in Email Manager (Hotmail Email account) it also removes the event from S Planner.

Surely I should be able to delete an email after accepting the event request, without S Planner deleting the Event from my Calendar.

View 7 Replies View Related

General :: P990 - Phone Not Accepting ROM?

Oct 1, 2013

I've been trying to get a Cyanogenmod on my LG Optimus 2x/Speed/P990. Most of the (german) how-to's didn't work, until I found a toolkit named "AIO Toolkit for P990/SU 660" by SpyrosK, which did finally install a CWM-based recovery (v6.0.2.5).

Following the steps of the how-to's I found I tried installing various Roms, all of the available Cyanogenmod Roms from their homepage, and another I found somewhere else.

All ended with the same, the phone doesn't boot into the rom, but into the Stock 4.0.4 ICS

I'm installing in the following order:

-wipe data/factory reset

-wipe cache partition

-advances > wipe dalvik cache

-install zip from sdcard

-choose zip from external sdcard

-e.g. cm-7.2.0-p990.zip

-yes

-reboot system now

It always sends me back into stock 4.0.4

Did I mess up something in the CWM-order?

View 1 Replies View Related

HTC Hero :: New Orange ROM Accepting Unlock Code

Feb 6, 2010

With the earlier Orange ROM , even if we enter the unlock code, the hero shows a screen with message "unlocking " and this screen remain for ever.Anyone has idea if this issue is fixed with new orange ROM released in feb 2010.(i.e the code should unlock the mobile without any issue)

View 11 Replies View Related

HTC Incredible :: Phone Not Accepting Smart30 Promo Code

May 2, 2010

I finally had the time to sit down and order my Incredible. However, it is not accepting the SMART30 promo code to save $30. Anyone else who has tried to use this code unsuccessfully (or successfully)?

View 2 Replies View Related

Sony Ericsson Xperia X10 :: Not Accepting Google User Name / Password

Aug 24, 2010

I just recently bought a sony x10 phone everything was fine until one of the kids entered wrong start up key 5 times in a row now i cant gain access to phone in any way,does not accept google user name or password,tried switching off for 10 mins taking out battery and so on to no effect.user name and password seems to be accepted online. Also tried to fix problem online using sony Ericsson pc companion which asks to drag down on phone but does not allow drag down.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved