Android :: Socket Leak In Apache Harmony SocketImpl?

Aug 17, 2010

I have been working with dnsjava to do a lot of DNS lookups, using the Lookup class with its own resolver per lookup, and also with a single shared resolver. No matter how I invoke it, there are always collections of sockets left open at the end of the process, and eventually my process runs out of file descriptors and is killed.

Tracing the code, I found that creating a Selector object causes two additional sockets to be created, and these are the two that are never closed. The dnsjava code is calling the Selector's close() method (I have stepped over that and verified that the two sockets, sink and source, are left open after it).

Is there some way I can force those sockets to close? I don't see any public API to get the source and sink socket references from the Selector class, but perhaps I am missing something?

Android :: Socket leak in Apache Harmony SocketImpl?


Android :: Can Not Import Org.apache.harmony.xml.ExpatReader

Jun 29, 2010

I need to parse an UTF-8 encoded input stream, so I think the most appropriate method is to use

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

For that I need to import org.apache.harmony.xml.ExpatReader but I cannot figure out how, I mean which Java package must I install from http://harmony.apache.org/download.cgi?

Or is there an alternative method to accomplish the same goal?

View 1 Replies View Related

Android :: Use Org.apache.harmony.luni.platform.OSNewtorkSystem In SDK ?

Dec 4, 2009

How can I use org.apache.harmony.luni.platform.OSNewtorkSystem in Android SDK ?

I'm working with Android SDK 1.5. And I'm programming a application running on Android Emulator.

This application used a library for communication using TCP/IP.

In debug mode, when create a instance of org.apache.harmony.nio.internal.PipeImpl class a message that is "Permission denied (maybe missing INTERNET permission)" is thrown.

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

View 2 Replies View Related

Android :: IOException - Received Authentication Challenge Is Null - Apache Harmony - Android

Aug 31, 2009

I am trying to send a GET via Android's HttpURLConnection (which is an org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection), and upon receiving the response, an IOException is thrown:

in doRequestInternal(): "Received authentication challenge is null"

What does this error mean, and what is causing this? I am writing OAuth parameters to the Authorization header, but I do this on other occasions, too, without problems.

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

View 2 Replies View Related

Android :: External Library Needs Org.apache.commons.httpclient Instead Of Org.apache.commons.http.client

Sep 28, 2010

I'm trying to use the Amazon Web Services java sdk jar but it has references to org.apache.commons.httpclient. All I seem to have in my Android sdk is org.apache.commons.http.client, which is a different namespace and obviously causes the build to fail. I'm new to Java and Android dev... is there a way to "map" one to the other or create some sort of symbolic link? If not, does that mean I have to import a "standard" org.apache.commons library?

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 :: 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

HTC Incredible :: Rooted Older 2.2 Leak To New 2.2 Leak?

Sep 1, 2010

Okay so a month or so ago I rooted with Unrevoked and put on the 2.2 leak that was available at the time. I doubt I'll get an OTA for the official 2.2 but I saw the update.zip was made available. Is there anyway to put this on my phone? I'm assuming I'll have to downgrade to stock RUU first and then I'll lose root and lose all my backup info. Basically I want the new 2.2 but I don't want to lose my data. Is this possible yet and if so how do you do it? There are a gazillion threads about similar issues but I haven't seen one that specifically talks about this yet, although it's probably in here somewhere.

View 2 Replies View Related

HTC Droid Eris :: New Leak V Old Leak Differences

Apr 7, 2010

What are they? Does the version 2 get rid of all the bugs? What bugs still remain if so?

View 7 Replies View Related

HTC Droid Eris :: Differences Between 2.1v2 Leak And 2.1v3 Leak?

May 18, 2010

What are the differences and is it worth the bother to re-flash to 2.1v3 leak from 2.1v2 leak? (since it appears that none of us leakers are going to get the OTA)

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

HTC Droid Eris :: Can I Go From Leak V1 To Leak V3?

May 22, 2010

How do I go from 2.1 ver 1 to 2.1 v3 leak on eris?? If this is already stated somewhere, I couldnt find it. If you know, or can reply with a link for me,

View 20 Replies View Related

Android :: Which Org.apache.http Is Using - And Where Can Get That As Jar?

Mar 8, 2010

At the moment I'm trying to build some integration tests for an android project. I would like to use the same apache http classes I use on the android. Which version is this and can I get a jar of that somewhere?

Trying to use the jar that comes with android only resolves in Exceptions... But most of the tests won't need running them in the emulator all the time just because I use some apache libraries or do they?

View 1 Replies View Related

Android :: Apache HttpClient 4.1?

Aug 26, 2010

Has anyone tried to use a newer version of Apache HttpClient on Android? There's an annoying bug in the HttpClient used by Android and I was wondering if I would run into problems trying to redistribute HttpClient 4.1 with my app.

View 2 Replies View Related

Android :: How To Use Apache Commons In Application

Aug 19, 2009

How to use apache.commons in my android application.

I put the right import, but when I compile it I get the following error:

: package org.apache.commons.io does not exist import org.apache.commons.io.IOUtils;

View 6 Replies View Related

Android :: Http-cleint Tutorials From Svn.apache.org

Apr 30, 2010

I was trying http-cleint tutorials from svn.apache.org. While running the application I am getting the following error in console.

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

I have added android.permission.INTERNET in AndroidManifest.xml.

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

The java code in HalloAndroid.java is as follows

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

View 1 Replies View Related

Android :: Apache HttpClient Digest Authentication?

Jun 2, 2010

Basically what I need to do is to perform digest authentication. First thing I tried is the official example available here.

But when I try to execute it(with some small changes, Post instead of the the Get method) I get a

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

When this failed I tried using:

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

At first I have only overridden "realm" and "nonce" DigestScheme parameters. But it turned out that PHP script running on the server requires all other params, but no matter if I specify them or not DigestScheme doesn't generate them in the Authorization RequestPreperty when I call its authenticate() method. And PHP script returns HTTP response code 200 with a message that PHP script requires cnonce, nc and qop parameters.

View 1 Replies View Related

Android :: StrinUtils Apache Class Is Not Recognized ?

May 11, 2010

Why import org.apache.commons.lang.StringUtils cannot be imported in android by default.

Do i have to include an external library? Then where can i find that library on the web?

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

View 1 Replies View Related

Android :: Installing Mysql - Apache Servers?

May 21, 2010

Is it possible to install MySQL and Apache servers on an Android device?

One of the requirement was that the Android app has to communicate with a local server via Wifi (via browser for accessing PHP pages).

Instead of that, the whole server side (including MySQL, Apache), has to be transferred and hosted on the Android device, so that the device doesn't have to use the Wifi.

View 2 Replies View Related

Android :: Sending Email With Apache Commons

Sep 16, 2009

I am trying a simple send mail application using apache commons library.

Here is the code.

The email sending code is working fine in a standalone application.However when I try to run it as android application

It gave following error message. trouble processing "javax/naming/AuthenticationException.class": [2009-09-17 05:33:20 - Commons]

Attempt to include a core VM class in something other than a core library. It is likely that you have attempted to include the core library from a desktop virtual machine into an application, which will most assuredly not work. If you really intend to build a core library -- which is only appropriate as part of creating a full virtual machine binary, as opposed to compiling an application -- then use the "--core-library" option to suppress this error message. If you go ahead and use "--core-library" but are in fact building an application, then please be aware that your build will still fail at some point; you will simply be denied the pleasure of reading this helpful error message. [2009-09-17 05:33:20 - Commons] 1 error; aborting [2009-09-17 05:33:20 - Commons] Conversion to Dalvik format failed with error 1

I have added mail.jar,commons jars and jndi.jar to the references of eclipse If anybody know a resolution let me know.

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

View 2 Replies View Related

Android :: Org.apache.commons.net.nntp Crashing

Jan 27, 2010

I'm using org.apache.commons.net.nntp to connect to a nntp server, however running a simple nntp.connect(host, port) crashes the android.

Anyone got any ideas? Do java packages work with android straight out of the box? or do they need editing?

View 2 Replies View Related

Android :: Can't Install APK Hosted My Own Apache Server / Fix It?

Aug 25, 2010

I've exported an apk from eclipse. I am able to install it without any problem if I copy it to the phone's sd card.

When trying to download via phone's (Galaxy S) browser I get:
"Download unsuccessful".

I have set mime type application/vnd.android.package-archive in the mime.types, restarted apache, still same result.
Also tried code...

Still no luck.

I am able to download and install applications from android market. I suspect that apache is not sending the mime type but this is just a shot in the dark.
How can I fix the problem and be able to install APKs from my web server? (or at least to check if apache sends correct header with mime type)

View 2 Replies View Related

Android :: No Files Return From Apache Commons Net FTPClient

Dec 6, 2009

I am writing a ftp client on android sdk 1.5 with apache-commons-net- ftp-2.0. I can successfully connect to my testing ftp server but with I use listFiles() it return an empty FTPFile[].

I put the same code in a normal java program and it works fine. I don't know where is wrong. Any compatible problem when apache-commons- net-ftp-2.0 and android works together?

Here is my test code:

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

It is actually 4 files and 1 directory in the ftp root!

View 2 Replies View Related

Android :: How To Enable Logging For Apache Commons HttpClient

Jul 14, 2010

To enable logging for apache commons HttpClient in normal Java application I used:

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

But on android I don't see logs in LogCat.

View 2 Replies View Related

Android :: Make An Array Of Org.apache.http.Header?

Aug 11, 2010

I'm new in Java.

I'm trying to do code...

but said

The type Header is not generic; it cannot be parameterized with arguments <NameValuePair>

how I can do it?

View 2 Replies View Related

Android :: Upload File On Apache Server In Phone?

Jul 20, 2010

Is possible to upload a file on apache server using commons-fileuploader jar file in android.

View 1 Replies View Related

Android :: Edit Remote Files On An Apache Server With Droid App?

Aug 29, 2010

I need my app to be able to go to a specified URL and access a file, then insert text at a specific line of said file. Is this at all possible?I

View 1 Replies View Related

Android :: Projects Classhpath - Org.apache.http.httpclient Package?

Aug 19, 2010

I am trying to import the code from this tutorial http://www.anddev.org/bbc_download.php?p=777&item=7

Into my eclipse,the tutorial is oldand I have trouble importing the packages that it referes.

Are those packages deprecated? or I have to manually download and install them into my projects classhpath? if so can someone give me a link on where to find them?

View 1 Replies View Related

Android :: Concise Example Of File Upload Via Java Lib Apache Commons

Sep 13, 2010

I've removed my convoluted and badly malformed question so that it doesn't detract from the very neat and correct answer beneath. Given the (surprising) difficulty of finding an on-line example for doing this incredibly common task, I hope Yoni gets a few more up-ticks for his response.

So the question...How do I use Apache.Commons to upload a file to some destination. I'm using it in Android and uploading to a PHP script, but obviously it can work from any Java program and to any HTTP based listener.

View 1 Replies View Related







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