Android :: Android Device To PC's Socket Connection

Oct 7, 2010

I am facing problem to establish a socket connection from android device to PC's a specific port like 8080. I just want to create a socket which will connect to the specific port and also write some data stream on that port.I have written some code for this purpose.

Android :: Android device to PC's socket connection


Android :: Socket Freezes Using GSM Connection

May 27, 2010

I'm working on application that uses a socket connection.I've implemented 2 different Threads for the read() and the write() methods so they are not being blocked by the read.Everything is working well on the WiFi connection but when I switch to GSM connection the connection becomes unstable without any exception being thrown. It means that there are freezes.the write and read seems to work but no data is actually being piped.

View 10 Replies View Related

Android :: Socket Refused Connection

Dec 7, 2009

I wondered if there could be a specific reason why a server socket could refused a client request connection , the server running on one android device the other on the emulator?

View 2 Replies View Related

Android :: How To Manage Connection To A Socket?

Jun 21, 2010

I would like to know what is the recommendation for socket connection management in Android?In our App we would like to be connected to a TCP/IP server when our app is in the foreground or paused. So, create a connection to a TCP/ IP server when the App starts basically, On Create of the launcher activity. However, we do not want to create a new connection and close connection every time an activity is created, paused, destroyed or orientation changed. So, we save the connection object in the App class and the activities will reuse the same connection.Question is when do I close it? I would like to close the socket when the App is "paused", "stopped" or "destroyed". The problem is these messages are not sent in the App context. How can I figure out if the App is in foreground or not? Even the "Terminated" event for an App is not guaranteed to be delivered. So, in that case how do I know when to disconnect?

View 2 Replies View Related

Android :: Socket Freezes Via GSM Connection

May 24, 2010

I'm working on application that uses a socket connection. I've implemented 2 different Threads for the read() and the write() methods so they are not being blocked by the read. Everything is working well on the WiFi connection but when I switch to GSM connection the connection becomes unstable without any exception being thrown. It means that there are freezes at the write and read seems to work but no data is actually being piped.

View 2 Replies View Related

Android :: Bluetooth Socket Connection

Nov 11, 2010

I'm creating an application that uses an android to send and receive data via bluetooth. but I'm having problems when creating the socket. He gets caught in that line mmSocket btserver.accept = (); And I can not pair with any device.I have another doubt, I can make that communication with an android and a symbian?

View 1 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 :: Detecting Socket Connection Failure

Apr 1, 2010

I am working on an app that uses a Socket to connect to a controller over TCP. The protocol library was written in Java and I am implementing it in android via a Service. where the Connection class is a Thread that handles the communications with the controller. It's where the Socket lives.I'm using the Preferences mechanism to store the IP and Port. If I feed the Socket the correct IP and Port, the Connection Service works beautifully. However, I am trying to simulate a user entering the wrong information and having the connection fail. The ultimate goal is to present a dialog and offer the ability to "reconnect" or "update settings". However, when I enter a wrong Port number, the application simply hangs.I was under the impression that Threads executed concurrently so I've tried moving the call to start the Connection Service to a Thread, but it still hangs the application.

View 3 Replies View Related

Android :: Permanent Socket Connection Drains Battery

Jul 15, 2010

I am developing an app which has one service running in the background even if the application is closed. This service basically listens to the server via socket connection. It is an app's requirement to keep one consistent connection open. but this drains battery liek anything. I know socket is costly affair in the sense of battery life. Do anybody know any other way to keep communication channel open? or any optimization in using socket?

View 9 Replies View Related

Android :: Create Persistent Socket Connection On Droid?

Apr 29, 2010

First off, let me say that feel free to recommend me if long lived TCP persistent connections are the way to go or persistent HTTP connections are better.

I've also pre-read that instead of having a persistent connection, I can have a polling mechanism.

I'm just asking in the curious interest of how can I create a persistent connection from Android to a server?

View 2 Replies View Related

Android :: SSL Socket Blocks On Read While Changing Connection / Is It A Bug?

Feb 19, 2010

I assume that when I do a read on the inputstream, it blocks until it gets more data to read.
I also assume that when the connection is closed, the read throws an IOException.

The problem is that sometimes when I change the connection from carrier to WiFi or from WiFi to carrier, the read just gets stuck and never throws the IOException.

The SDK is 1.5 and the phone a HTC Hero.

This behavior is quite ugly for me because I need to stay always connected.
Does someone else have ever seen this problem ? Is it a bug or am I the bug?

View 2 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 :: Make Beep Sound Notification On Socket Connection Establishment?

Aug 3, 2010

How can I make the Device sound a beep when socket connection has been established. In other words, how to set a notification tone when an event occurs in Android sdk?

View 1 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

General :: Socket Connection App SDK?

Jun 20, 2012

I'm making a chat program and server relay on pc and I was wondering if there's a simple template for tcp/ip socket connections.

View 9 Replies View Related

Socket Programming - TCP Connection Through NetBios (NBNS) Name?

Dec 22, 2011

I'd like to know whether there is a way to connect to a TCP server (socket server) in an computer using his name (e.g.: my computer has a host name: MyComputer; then I must connect with it using his name).

It can be done using NBNS protocol (NetBios Name Service), but always I try to connect using his name, the Tablet uses DNS protocol instead of NBNS, as I might expct.

View 1 Replies View Related

Socket Networking - Set Up Basic Network Connection Using Droids?

Feb 7, 2012

I'm trying to set up a basic network connection using droids but I'm having problems.my server program:

Code:
ServerSocket ss = new ServerSocket(8888);
while(!end){
//Server is waiting for client here, if needed[code]....

the server runs until it reaches ss.accept() like it should but the client still can't connect. The client usually times out and nothing happens

I'm running both these programs using eclipse on my computer. I set the premissions in the manifest for both programs to let them use the internet and I have the port forwarding .

View 2 Replies View Related

Android :: Android Socket Connection Refused

Mar 11, 2010

I am trying to open a Socket on Android but everytime I try I keep getting connection refused error no matter what way I try.The error happens on the following line of code where I try to create the connection.

View 2 Replies View Related

Android :: Multiplayer Game - Device To Device Connection Using Sets Of Api

Mar 24, 2009

I have developed a sports game which is single player. Now I want to have one more game mode which is multiplayer.

My question is how can i do device to device connection in android using sets of api which can be :

1.Bluetooth - whose APIs are not currently available.

2.gtalkservice - removed from sdk1.0 3.wifi - I dont knw how to connect 2 devices using wifi apis . I have asked about wifi because we have developed a game on iphone which used wifi connection for multiplayer stuff.

Or is there any other apis which can be used for implementation of multiplayer in game ?

View 3 Replies View Related

Communicate To WiFi Enabled Arduino Board With Static IP - Socket Connection

Feb 3, 2012

So Im writing an application to communicate to a Wi-Fi enabled Arduino board with a static IP...

This is what Im trying to do...
1.) Enter Ip and Host
2.) Connect
3.) Simply send either a "0" or "1" to the arduino board

There are two activities at the moment, one to enter the IP and port of the Board (which is set from the board itself) and one to send data to the board. When i comment out the connection methods in the Communicator class the app swithches activities without any issues, but when i un-comment them and attempt to connect, the app immediately closes after i attempt to connect.

Code:

package car.test.namespace;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

[Code]...

Code:

package car.test.namespace;
import java.io.*;
import java.net.*;
public class Communication {

[Code]...

Code:

package car.test.namespace;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

[Code]..

Also, im not even seeing the "Connection Failed" message, the app is just shutting down,.

View 4 Replies View Related

Android :: Android Bluetooth Crashes Application When Remote Device Closes Socket

Feb 16, 2010

I have connected my Android application to a Windows desktop machine via Bluetooth. The application interacts with the machine. At the end of the interaction the application on the desktop closes the socket that was opened between the Android and the desktop application. Right when socket.close() is called on the Windows machine my Android app pops open a dialog saying that the application has stopped unexpectedly and then it quits. I have a breakpoint on the line in the ConnectedThread (like in the BluetoothChat sample) where I read the InputStream on the Android and that is not hit. I also have a breakpoint in the catch statement for the try surrounding the place where I read the InputStream. That one also does not get hit. So I have no idea how I can catch this error. Is this a bug?

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 :: Android Socket Connection

Jun 8, 2010

I'm guessing this will be such a newbee question but I hit a wall and I am running the WebSocket.Now, when I start the server and run the Weberknecht client like a normal Java application I get a connection. Granted, the connection is quickly dropped because the handshake needs to be configured but at least the server shows me a connection was attempted.

View 2 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 :: USB Adb Connection Unknown Device Which Has No IDs

Oct 15, 2010

This month, I am not able to get a AT&T Samsung Galaxy Captivate to be recognized by my Win xp when I connect them with a USB cable. This is the same phone I had trouble connecting a few months back. With much help from this list, I was able to get them connected. (Win device mngr, red check mark, get ID, insert this ID in android_winusb.inf file and reinstall android sdk usb driver.) After the fix, communication was successfull for Aug and Sept (about 10 connections per monthduring a 5 day period). But this month the Win xp will not recognize the phone. The only thing that happens is that the device manager, usb, list is updated to include "unknown device" which has no ID's. I have talked to AT&T and Samsung. One person said that there was "an update Oct 5" and this bit of information got me introduced to Samsung tech suppor level 1 and then, after considerable talking, to level 2. Samsung level 2 said that I must have the specific USB cable that came in the box with the phone, I said that probably was not the problem because I have used this (motorola) cable successfully at least 20 times. Then all of a sudden I get a dial tone. So I drove the 20 miles, went into the owners home (while talking to him on his phone, he has mine to use beta testing) and got the cable. Results are the same with this Samsung cable. I am writting this long note becasue I have lots of time waiting for 50 minutes for level 2 support again. I am loosing hope that Samsung is going to be able to help me or possibly they recognize my phone # and know my problem is unresolvable. Does anybody have any light they can shed on this issue?

View 2 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

Android :: Protocol To Secure A Connection Between A Mobile Device / A Web Service?

Jun 30, 2009

I'm looking for a protocol to secure a connection between a mobile device and a web service. I want to ensure that only the mobile device can perform actions on the web service and vice versa. Data doesn't need to be encrypted. I know Oauth, but it seems that it's more used to secure connections when you got 3 different entities (Server, Consumer and Auth). Here, the Consumer and the User would be the same person. Is there a simple protocol to do that (without requiring the user to login and then authorize the access token like it is the case for Oauth)? I need to use it on different plateforms, so the protocol needs to be available at least on iPhone and PHP.

View 3 Replies View Related

Android : Way To Control Which (data) Connection Device Uses For Connecting To Website?

Jan 13, 2010

I'm retreiving data from an Internet service. Is there a way to control which (data) connection the device uses for connecting to a website?(access via wifi or via the cellular network).

View 1 Replies View Related

Sending Message From Android Device To PC (computer) Using Internet Connection

Nov 11, 2012

I am creating an Android application. This application should send message to computer via internet and Wifi (check whether if the device is using internet). The main function is by pressing on a button in Android device a message should go to computer via internet (I don't know, but I think it should be with UDP). I know that I need to set the server for computer and write down IP and port to the android app code. I don't have any clue how to do it. I kinda need to create a computer (windows 7) server receiver, which would receive messages. I am using Eclipse Android SDK

View 1 Replies View Related







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