CURLE_PARTIAL_FILE error for large files with libcurl - android

I have linked libcurl library (v7.38.0) statically with my C++
application. Using curl, we upload & download files to/from server https. I Have
download fails with the error CURLE_PARTIAL_FILE. This issue occurs
randomly ie., some times the file was downloaded successfully without
issue and some times, the same file fails with the error.
This issue occurs in android platforms. Anyone can show me how to fix that

CURLE_PARTIAL_FILE means that the transfer was aborted before the full contents arrived. That typically means a bad server or a network problem, not a client-side problem.
If you cannot affect the network or server conditions, you probably need to consider ignoring this particular error.

Related

Regarding sending a file to Websocket via android application

I want to upload a mp3 file via Websocket in Android Application.
I was using the external library
http://autobahn.ws/android/
But the problem is that through this library,I cannot upload a big file.say 5 Mb.
I tried researching on similar types of libraries.But could not found a suitable one.
Has anyone tried to upload file on WebSocket in Android Application.
Thanks
As per the mentioned error you are receiving "WebSocketException: frame payload too large", if you go to the source code of the library you are using and search for error you will find out the limitation imposed by the library itself.
// immediately bail out on frame too large
if (payload_len > mOptions.getMaxFramePayloadSize()) {
throw new WebSocketException("frame payload too large");
}
You'll find the this limitation in WebSocketOptions.java
mMaxFramePayloadSize = 128 * 1024;

Downloading fails much more frequently on iOS than on Android?

In my iOS project, I use NSURLConnection to download files. My code is just like the http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html document.
In my team's Android project, we use Android's API to download the same files. Nothing special either.
Both the iOS and Android project have the same fail-retry mechanism, and both of them send the same statistic data to server.
The files they trying to download is between 1M to 10M.
The statistic server shows that for the same URL, download failure is 2% on android, but 20% on iOS! Since they are trying to download the same URL, it seems not the server's problem but more like a client issue.
Why iOS download would fail so frequently? Is there any special APIs I should use for iOS, to make the download robust? Currently I'm using NSURLConnection, and I've just found NSURLDownloader which is more convenient to write files. Will they be different for download success percentage?
P.S. the error I got by -
(void) connection: (NSURLConnection *) connection didFailWithError: (NSError *) , is usually -1005, NSURLErrorNetworkConnectionLost.
I'd suggest looking more into why you're getting NSURLErrorNetworkConnectionLost. Even if your device says it's connected, sometimes it could lose the connection and be attempting to regain it before the indicators update accordingly.
This is a good starting point for more information on better dealing with reachability. Checking For Internet Connectivity in Objective C
Otherwise, I recommend you post your download-related code so others can look for possible issues.

BIRT, Android and reports

We have an IBM Maximo system that has BIRT reports built in. We are also in the process of writing an Andriod app that needs to be able to run a report (on the server) and get the PDF version back into the app (or at bare minimum, the HTML version of the report). Is there any built-in functionality for this with BIRT or Maximo??
My team have something similar, but we scrapped the idea of using the .rptdesign files stored on the maximo server, and solved it by setting up the BIRT runtime: (Download here).
If you have direct access to the DB you can setup the runtime with the report(s) you need and play around with the parameters.
Say that one have a report called "report1" stored on "localhost:8080" and the report contained 2 parameters called "StartDate" and "EndDate" this is how one would do it:
Instead of using the standard URL with the frameset servlet mapping: "localhost:8080/birt/frameset?__report=report1.rptdesign" and let the user run the report them self, change the servlet mapping to run.
To just run the report, without getting the parameter dialog to provide values for the two parameters, one just have to parse the parameters to the end of the URL - &StartDate=2011-01-01&EndDate=2011-01-02.
To download the file in PDF format append the viewer command option "__format=PDF" to the end of the URL.
So the end result will look like this:
localhost:8080/birt/run?_report=report1.rptdesign&StartDate=2011-01-01&EndDate=2011-01-02&_format=PDF
This will download the file in PDF format without any interactions to the actual BIRT runtime.
Hope this gives you some ideas anyways, I know it's not an optimal solution. But at least it's something.

OptionalDataException while receiving large files using Apache Mina library on Android

I am using Apache Mina to transfer objects between Java server and Android client. I am receiving the following error when transferring large files.
org.apache.mina.filter.codec.ProtocolDecoderException:
org.apache.mina.core.buffer.BufferDataException: java.io.OptionalDataException
(Hexdump: .........)
The same thing works perfectly with just Java client. But on Android I can only receive
small objects. Bigger will throw the exception.
I notice in my logs that Android is processing the object in three pieces. I see
Processing a MESSAGE_RECEIVED for session 1 three times.
Can anybody help me find a workaround/solution for this?

How to find Bonjour in local wifi in Android

I have a problem that I want to get an Ip of remote computer via Bonjour which is preinstalled . But I unable to connect with that, I don't know why because I have download an example code from Git Hub and also download the jmdns3.4.1 Jar. But the sample contains the error as Conversion to Dalvik format failed with error 1. Then I have written this question to get the exact answer.
Thanks is advance.
First off you need to use a special version of jmdns compiled for Android found here. The reason is Android cannot actually execute Java class files, but rather executes Java dex files since it uses Dalvik.
It may also be a jar-conflict if you are 100% sure you're using the right jar-file. See this question for more information.

Categories

Resources