Android :: Activity Manager Vs Socket

Apr 7, 2010

I'm trying to catch socket errors (invalid ip, wrong port, etc.).It seems like the ActivityManager is shutting me down before I have time to catch these errors. I really have no idea what's going on here. My splash screen Haus attempts to start the service from a thread, however when the thread get's to the "about to create socket", it simply locks up. It locks up the entire app until the Force Close dialog box arrives.
I have Log.i all the way into the class that makes the connection.04-07 22:15:29.286: INFO/CONNECTION(19053): 4368 04-07 22:15:29.296: INFO/CONNECTION(19053): establishConnection() 04-07 22:15:29.446: INFO/CONNNECTION(19053): about to create socket 04-07 22:15:34.036: INFO/ActivityManager(76): Displayed activity com.scs.haus/.Haus: 8545 ms (total 8545 ms) 04-07 22:15:38.989: WARN/ActivityManager(76): Launch timeout has expired, giving up wake lock! I never see any of these Logs, except of course for the one that tells me I'm inside the method.

Android :: Activity Manager vs Socket


Android : Closing Activity Completely / Process Killed By Activity Manager Service

Aug 2, 2010

Whenever the memory needs to be reclaimed, the process is being killed by Activity Manager Service in killPidsForProcess. I have a back button in my activity window on right corner of the title bar.

I want to kill the activity completely on clicking the close button. Can I reuse the same function and will it have any major effect? Please help me out in this.

View 3 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 :: 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 : Need Activity Manager Information

Feb 16, 2009

I have been practicing with android for a while and read a few books but there is something I can not find anywhere even on the net. I am interesting in the activity manager and how it works. Especially how the activities are pushed on the stack then pulled, etc... I looked everywhere I could for such documents but the only things I could find were overall documents with not much details. I have downloaded the entire source code (cupcake branch) and started to have a look at it but obviously the code is big and very complicated. I was just wondering if an android google engineer somewhere or even somebody else who could let me know where I could find such information (whether it is a document, a link, etc...).

View 2 Replies View Related

Android :: Eclipse Can't Connect Activity Manager - HelloWorld Not Appear

Jun 24, 2010

This appears related to:http://stackoverflow.com/questions/3037512/android-application-doesnt-start-from-eclipse/3106897#3106897 Even with the Android 2.2 platform is this still the accepted way to operate the emulator? i.e. 1, 2, 3 start/kill processes as described in the above post? I am having a similar problem on WinXP with Eclipse w/ ADT plugin. Why would the activity not be able to start on the emulator? The computer has 756MB RAM if that could be the problem. The deployment is going along until Eclipse tries to deploy the activity. The emulator starts with the text "ANDROID_" and then eventually just displays the ANDROID logo, though appears to still be running just fine. Any ideas? Thanks. The code was copied from the HelloWorld tutorial. Here is the Eclipse console log including the error messages towards the end:
[2010-06-23 15:43:26 - myHelloWorldProject]
[2010-06-23 15:43:26 - myHelloWorldProject] Android Launch!
[2010-06-23 15:43:26 - myHelloWorldProject] adb is running normally.
[2010-06-23 15:43:27 - myHelloWorldProject] Performing net.concentricllc.HelloWorld.HelloAndroid activity launch
[2010-06-23 15:43:27 - myHelloWorldProject] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'myHelloWorldAVD'
[2010-06-23 15:43:27 - myHelloWorldProject] WARNING: Application does not specify an API level requirement!
[2010-06-23 15:43:27 - myHelloWorldProject] Device API version is 8 (Android 2.2)
[2010-06-23 15:43:27 - myHelloWorldProject] Uploading myHelloWorldProject.apk onto device 'emulator-5554'
[2010-06-23 15:43:32 - myHelloWorldProject] Installing myHelloWorldProject.apk...
[2010-06-23 15:48:29 - myHelloWorldProject] Success!
[2010-06-23 15:48:37 - myHelloWorldProject] Starting activity net.concentricllc.HelloWorld.HelloAndroid on device
[2010-06-23 15:51:35 - myHelloWorldProject] Device not ready. Waiting 3 seconds before next attempt.
[2010-06-23 15:51:36 - myHelloWorldProject] ActivityManager: android.util.AndroidException: Can't connect to activity manager; is the system running?
[2010-06-23 15:51:38 - myHelloWorldProject] Starting activity net.concentricllc.HelloWorld.HelloAndroid on device
[2010-06-23 15:53:36 - myHelloWorldProject] Device not ready. Waiting 3 seconds before next attempt.
[2010-06-23 15:53:36 - myHelloWorldProject] ActivityManager: android.util.AndroidException: Can't connect to activity manager; is the system running?
[2010-06-23 15:53:39 - myHelloWorldProject] Starting activity net.concentricllc.HelloWorld.HelloAndroid on device
[2010-06-23 15:55:41 - myHelloWorldProject] Device not ready. Waiting 3 seconds before next attempt.
[2010-06-23 15:55:41 - myHelloWorldProject] ActivityManager: android.util.AndroidException: Can't connect to activity manager; is the system running?
[2010-06-23 15:55:44 - myHelloWorldProject] Starting activity net.concentricllc.HelloWorld.HelloAndroid on device
[2010-06-23 15:57:15 - myHelloWorldProject] Device not ready. Waiting 3 seconds before next attempt.
[2010-06-23 15:57:15 - myHelloWorldProject] ActivityManager: android.util.AndroidException: Can't connect to activity manager; is the system running?
[2010-06-23 15:57:18 - myHelloWorldProject] Starting activity net.concentricllc.HelloWorld.HelloAndroid on device
[2010-06-23 15:58:51 - myHelloWorldProject] ActivityManager: Error type 2
[2010-06-23 15:58:52 - myHelloWorldProject] ActivityManager: android.util.AndroidException: Can't connect to activity manager; is the system running?

View 3 Replies View Related

Android :: Get Result From Search Manager To Main Activity

Nov 18, 2010

Activity A is main activity. Whereas Activity B is SearcActivity (Search Manager). Activity B is List Activity, so whatever result comes, result is displayed in the list. Once user clicks on the list, I want to get that list selected item to be returned to ActivityA.What I did. Code...

View 3 Replies View Related

Android :: Communicate With A Location Manager Started From Another Activity

Aug 20, 2010

In my app I want to obtain a gps lock and record the coords. But I do not want to lock the device into looking for the gps. The user is to be free to traverse through the app and the different activities within.

So If I call a locationListener in activity A, can I reference it in activities B C and D?

if is was still in activity A I could say something like

A.this.mlocListener.removeMyUpdates();

When I am in activity B how can I reference the LocationListener I set up in Activity A

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

Android :: Socket Is Not Connected

Feb 17, 2010

I am trying to use httpclient to hit a http link. For some reason I keep on geting this "socket is not connected" error. I am not sure about the reason for this error. Can any one help? This error also occurs when I start using the car navigation app or whenever I try to forward calls.

View 5 Replies View Related

Android :: How To Connect G1 With Pc By Socket

Mar 3, 2009

I have a java server which run on the pc, and a client which run on the G1. Now, G1 is connected to the pc with a usb cable. I want to use socket to let them communicate with each other, as what I did in the emulator. But now G1 cannot find the server through the ip "10.0.2.2".InetAddress serverAddr = InetAddress.getByName ("10.0.2.2"); ClientSocket = new Socket(serverAddr,SERVERPORT); The ClientSocket is null. What's the IP of the pc now?

View 3 Replies View Related

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 :: Reading Data From Socket

Oct 31, 2009

I am facing some problem during reading data from socket If there is some null data in socket stream so the DataInputStream would not read the full data and the so at the receiving end there is exception for parsing data.What is the right way to read the data from socket so there is no loss of data at any time ?

View 3 Replies View Related

Android :: Getting File Descriptor From Socket

Jul 23, 2010

The documentation for FileDescriptor says it is "The lowest-level representation of a file, device, or socket". I see that some classes like FileOutputStream and LocalSocket expose a getFD(), but Socket doesn't.How do you get at a true (INET) socket's fd? Alternatively, how do you get at the (private) SocketImpl member of Socket named "impl" (this one exposes the fd)

View 4 Replies View Related

Android :: Socket Timeout Not Working?

Jun 5, 2009

In the sample code, a SocketTimeoutException should be thrown if the connection can't be stablished in a second, isn't it? But the timeout take a looong time to be detected.

View 4 Replies View Related

Android :: How To Listen On Socket Port 80?

Jun 4, 2010

I'm new to Android development, now I'm working on a simple HTTP server project. I try to use ServerSocket to listen on port 80 but I failed. There will have an exception if I did this. I have already set INTERNET permission in manifest. I found that everything is Okay if I use port 8080, that's strange for me, why I cannot use port 80? I don't want my users to use another port to connect my server.

View 2 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 :: How To Send File By Socket?

May 5, 2009

I want to send a file from the Android phone to a server by socket.Could anyone give me some example code about how to do it?

View 2 Replies View Related

Android :: Proxy SDK 1.5 R1 - Socket Time Out

Aug 10, 2009

With this SDK version I can use my emulator using a proxy server. There is three solutions: - add values in system table - configure -http-proxy in eclipse run menu - configure APN on emulator to set the proxy. When I use Android browser, it's really slow but it's working. If I try to to a post from my application, I take an ANR and some minutes later a socket time out.

View 2 Replies View Related

Android :: Socket Not Disconnecting When Connectivity Changes

Jan 5, 2010

My chat application connects to a server and information is sent/received by the user. When the connection changes, such as 3g->wifi, wifi->3g, losing a data connection, etc, the socket sometimes stays connected for ages before disconnecting. During this time, it's impossible to tell if the connection is still active, it seems as if messages are being sent just fine. Other times, when sending a message, it will throw an IO error and disconnect.

Apart from implementing code to detect connection changes and reconnecting appropriately, is it possible to have the socket immediately throw an IO exception when connectivity changes?

I'm connecting using the following code:.........

I'm not using setSoTimeout as data may not be transferred for long periods of time depending on the remote server's configuration.

View 2 Replies View Related

Android :: Bad Socket Exception - SOCKS

Oct 14, 2010

I tried to connect to a server through a SOCKS server in an Android client app (Android OS 1.5 and 1.6) with below snippet code:

CODE:......

However it gave out an exception on the last line:

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

View 1 Replies View Related

Android :: Droid WIFI Socket Name?

Nov 10, 2010

I am developing one Android application which communicate with Wifi network. I want to know the name of the wifi socket in Android Device. i searched in google but nothing help me. I heard android device used RFCOMM socket for Bluetooth communication. Is RFCOMM socket used for Wifi communication?

View 1 Replies View Related

Android :: How To Perform Socket Communication

Jan 22, 2010

I have done socket communication in a single application it is working fine.

But my requirement is i have opened two emulators and i am able to send sms between those two.

Now i want to run server in one emulator(myavd-5554) and client on another emulator(myavd1-5556)

I have used the following code on Serverside public class TCPServerActivity extends Activity

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

View 2 Replies View Related







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