Android :: Simultaneous Http Requests

Jan 13, 2010

Is there a limit on the number of simultaneous http requests of the form:

HttpResponse response = client.execute(request);

I'm interested in any official limit as well as practical ones.

(In a previous life, you had to dig deep to discover that WinMo only allowed three WebRequests to be open at a time.)

Let's say I have a list of 20 files to download on a background thread.

Should I: Download them one at a time, blocking the thread (but not the UI thread) to wait for each one? Start 20 threads each downloading one of the files?

I expect the answer may be somewhere in between, where I create C threads and work on the queue of N files, where C is a number like 3 or 4.

I suspect some of you here have already done some experimentation and know the magic number. In addition, I suspect there may be more efficient ways of doing what I'm doing than creating a new DefaultHttpClient for each request.

Android :: Simultaneous Http Requests


Android :: How To Do Async HTTP Requests?

Feb 23, 2010

Im using a web service, so I want to use an async thread for the HTTP authentication request and another thread later to make additional service requests while my main thread runs.Would like to see a good example of how to do this and how to show busy messages somehow in main app. How does the main app know when the thread finished? And what if my thread encounters exceptions, how do I deal with that?HTTP requests are sent later, use the same cookies setup up by the first auth request, so will the later requests pick up the same cookies and just work?

View 2 Replies View Related

Android :: Something That Will Log All HTTP Requests Phone Makes?

Aug 29, 2010

I saw an message "page could not be loaded" in an app that I was using which made me realize that it's UI may be HTTP based somehow. Is there a way that I can find out where it is sending its requests?

View 4 Replies View Related

Android :: How To Trace HTTP Requests / Responses?

Jul 22, 2009

How to trace the HTTP requests/responses e.g. by using Wireshark? I am using soap web services i want tocheck wheather the soap request from the web service sis going properly.I neee the Xml response from the server but non xml format i am getting how to check this request and response using Wireahark or any other process.

View 2 Replies View Related

Android :: Multi Threaded Http Requests Cause Exception

Jan 27, 2010

I have an app making an https post on one thread while performing a file download on another thread. For some odd reason, I am getting a ClientProtocolException saying that "The server failed to respond with a valid HTTP response". The error goes away if everything is run on a separate thread. Oddly if I run the two server requests in serial, the error goes away. It seems there's a bug that happens when two requests are made at the same time.

Important note: The post occurs to a different server than the download so the servers themselves should not be causing the problem. The code is simple. Here's the file download code:.............

View 9 Replies View Related

Android :: How To Use Separate Thread To Perform Http Requests?

Aug 2, 2010

I have an application that is performing HTTP Requests (specifically calling the FogBugz API) when the user clicks certain buttons. Right now, I am just creating a service when the application starts, and then calling different methods in that service to complete requests. However, when I do this, there is the usual hang in the UI thread. I have looked at AsyncTask, but am not sure it will do what I want to accomplish. Because I need to instantly parse the XML that the HTTP Request returns, I need to have a process that is able to return this data to the UI thread. Will ASyncTask be able to accomplish this, or is there some other way.

View 1 Replies View Related

Android :: Injecting HTTP Header Into All Requests By Emulator

Mar 17, 2009

Is there an easy way to inject a header into all HTTP request sent from the emulator, including HTTP requests made by my app and also by the built-in web browser? I need this ability to model the behavior of a carrier gateway. I tried running the emulator through Fiddler as a proxy because I know how to manipulate HTTP requests in Fiddler, but that that didn't work. The emulator was successfully able to make the first HTTP request, but choked on subsequent ones. Reading this list, it seems that getting the emulator to use a proxy is not is not that easy. If this is the only way to do what I need, then I'll certainly give it another shot and post details about any problems I encounter. I am just wondering if perhaps there is an easier way to inject a header.

View 3 Replies View Related

Android :: Sending Multiple Http Requests To Django

May 19, 2010

I am developing a microblogging platform in which I need to populate the page with Post (user defined class with fields) obtained from the Django server using HttpGet.In the client side(Android) I am using GSON to parse the responses from server to the type Post. So I require that server should send Post's one by one so as to add each of them to a list of Posts after parsing and then finally notifying the list adapter of changes in the data set after all Post's have been added.But the problem coming when intially loading the application, the page has to be populated with 10 latest Post's from the server. So I thought of a rather dirty way of sending 10 httpget requests to the server one after the other to the server. The code looks like this.I was thinking of executing it 10 times in a loop to get the 10 Post's I require. But in Django as far I know (correct me if I am wrong) there's no way to keep an index of the last sent Post to the client and so no way to send the 'next' Post on the next HttpGet request. So I am out of ideas.I feel there's a better way to do this efficiently.

View 1 Replies View Related

Caching Of HTTP Requests (HttpResponseCache)

Jan 14, 2014

I'm trying to employ HttpResponseCache to cache each HTTP-request sent with HttpURLConnection.

why I get hit count always zero?

Code:

HttpResponseCache.getInstalled().getHitCount()
Usage:

Code:
for(int i = 0; i < 2; i++){
try {
HttpURLConnection connection = (HttpURLConnection) new URL("http://www.google.com").openConnection();
connection.setUseCaches(true);
if(i == 1){
try {

[code]....

On 2'nd run I have "NOT cached" in console and hit count == 0.

View 2 Replies View Related

Sending And Receiving Asynchronous HTTP Requests?

Jul 20, 2012

I developed a game for Android called Jumping Bird, it writes the score obtained by the player in the database on my web server, but it does so synchronized. While it tries to write data in the database on the web, the entire game is stopped , and worse, when the server is slow, the request takes more than 5 or 10 seconds, an ANR(application not respond) error occurs and the OS tries to close the app.

I wonder how I can make that request asynchronous.There is any library that does it?

View 1 Replies View Related

Android :: More AsyncTask - Simultaneous Downloads

Sep 10, 2010

Implementing a service to handle connection changes and downloads. The service handles a queue of AsyncTasks, each representing a "download task". This way, we can cancel/pause tasks when connection drops, and also restore them when connection is reestablished. Since the threads AsyncTasks are run are not deterministic, how many ATs should I execute() at the same time?

I've read that I shouldn't reuse tasks. How can I achieve this pause->resume functionality then? Should I tell the thread to sleep? Should I make a no-op while if connection is down? I was trusting the cancel(true) method, which I've read is not reliable either.

My main DownloadTask is a subclass of AsyncTask that returns a new AsyncTask to be called when the connection is restored.

View 3 Replies View Related

Android :: Handle Simultaneous Key Press

Dec 14, 2009

I was wondering whether Androd can catch simultaneous Key Press. For example, a application does something when a user press HOME and MENU key simultaneously. Is it a possible scenario?

View 4 Replies View Related

Android :: Simultaneous Photography Using Andriod

Jan 28, 2009

I am working on an art project with several other people that involves simultaneity and photography. We want to coordinate a series of events involving simultaneous photographs based on the Android system.

In simple terms, here is what we are proposing. Someone writes an app for Android Phone/Camera that makes the camera take a photograph at a predetermined time so that many thousands of people all take a simultaneous photograph. The art involved here is not only the synchronizing of the event to approximate simultaneity but also making "social networking" into an element of an art project.

View 3 Replies View Related

Android :: MediaRecorder - MediaPlayer Simultaneous Use

Apr 16, 2010

With reference to this discussion, does this mean that simultaneous Record and Playback with Mediarecorder and Mediaplayer is not possible at this point?

View 3 Replies View Related

Android :: AsyncTask And Simultaneous Network Downloads

Jan 28, 2010

I am performing several https posts and http downloads from two different servers using AsyncTasks. The connections are fairly quick but I'm surprised to see that they are running synchronously instead of in parallel.

To be more explicit, here is pseudo-code for what's happening when I initiate a call to AsyncTask1():

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

View 19 Replies View Related

Android :: Writing - Reading From A File Simultaneous

Oct 27, 2010

I'm trying to read from a file while it still opened for witing.

View 2 Replies View Related

Android :: Disable Simultaneous Search On Call Log & Contacts?

Oct 10, 2010

I just installed the latest DialerOne (1.2.7.1) from the Market and find that the new simultaneous search of the call log and contacts is annoying in that it places call log entries at the top of the list, and tapping on them brings up the call history for that contact instead of listing their numbers so you can choose one to dial. I don't see any way to turn this off.Am I missing something?It would seem natural to have the ability to limit the search to the screen presented (search only the call log when the call log is displayed, or search only the contacts when contacts are displayed), but I have Dialer One display the call log by default, so that I can quickly call a recently called contact, or just start dialing to search, so this wouldn't work for me either.I would much rather go back to the way it used to be. Of course, I figured I didn't need to backup the previous version because after all, what could change? Now I have this, and the coloring of the digits on the keypad is weird, even after adjusting it as much as possible.

View 5 Replies View Related

Android : How Many Simultaneous Threads Can A Single App Execute In Parallel?

Oct 14, 2010

I have an android app, where in a list view for each element in list, I load an image from web in a separate thread. So if there are 8 items displayed in list view, activity will try to fire 8 different threads, one for each list item to load an image. As you scroll down the list, the number of threads may increase if the previous threads haven't finished executing.

I am curious to know how many simultaneous threads can a single android app execute in parallel? Is there a limit? I wouldn't expect these threads to cause a ANR over slow internet connection as they are independent? But it seems that ANR does happen and may be it's because app/device run low on resources, so spawning a new activity in UI takes more than 5 seconds which results in an ANR?

Any clues to how I can make responsiveness better on a slow internet connection will be appreciated.

View 2 Replies View Related

Android - How To Run Code Depending On Simultaneous Hard Key Press

Mar 19, 2014

I am trying to implement a functionality when i press the VOLUME DOWN and POWER BUTTON simultaneously; i must be able to run a method code inside my Activity.

public boolean onKeyUp(int keyCode, KeyEvent event)
{
}

From my initial search; it seems that only one such key press event is acknowledged at a time in Android usng the onKeyUp method. Is it true?

In my Android phone, on simultaneously pressing POWER BUTTON as well as MENU BUTTON i am able to capture a screen shot.

Does this feature not acknowledge simultaneous key presses?

View 2 Replies View Related

HTC EVO 4G :: Simultaneous Voice And Data

Nov 25, 2010

If you don't need 3G on to do voice calls, then why would having it on not allow you to use your data connection while on a voice call?

View 9 Replies View Related

HTC EVO 4G :: Simultaneous Update Of All The Apps

Aug 4, 2010

I just saw a video of a Verizon guy that got FROYO already. They were showing the changes included in 2.2 and it had the option to update all the apps at the same time or something similar. I thought that was art of 2.2.

View 2 Replies View Related

HTC EVO 4G :: Simultaneous Data And Voice

Mar 29, 2010

I probably don't need it persay...But! I want it! Just to have the peace of mind that phone calls won't interupt stuff. There have been times that I could both at the same time. Anyone think it might be implementef later? This is a real dream killer for me.

View 35 Replies View Related

HTC EVO 4G :: Simultaneous Talk And Data

Jun 18, 2010

Is this suppose to work only with 4G or am I missing something?

View 3 Replies View Related

Android :: Viewing Requests Made By Another App

Sep 16, 2009

Is it possible to view what requests are made to external sites/ servers by an app? Basically I'd kind of like to throw an application (I did not make) into a debugging type thing to see what requests (to where and what data) it makes. This is to kind of ensure a third party app does what it is saying, and isn't sending data elsewhere.

View 2 Replies View Related

Android :: How To Track All Https Requests?

Apr 12, 2010

How to collect URLs of all http/https requests made by the phone as well as well as the return status code and user agent from the headers. This information should be coming for all browser requests and other applications too.Please let me know this information can be retrieved on App level or we have to go to system level for this.

View 5 Replies View Related

HTC Desire :: Simultaneous Call And Data

Apr 1, 2010

Just started using my Desire last night! Feeling good.

However...

Was just on a call, tried to use the Android Marketplace. Couldn't. Got curious, and tried to use Google Maps mid call. Couldn't. Tried to use the internet during the call. Couldn't. Now, I'm on T-Mobile (UK) and have just come from a Nokia E71. With my E71 I could make a call and use Google Maps. Am I missing something or is this bit of multitasking somehow not possible?

View 6 Replies View Related

HTC Hero :: IPhone Cant Run Simultaneous Apps

Oct 19, 2009

I just wanted to check, e.g. on my Hero I can run GPS Tracker and press home and it will run in the background, play some music and press home and it will run in the background and go and do something else.

Are you saying the iPhone would have to completely exit the GPS Tracker to use another app or leave the GPS Tracker open and not do anything else for it to work?

View 4 Replies View Related

Android :: How AJAX Requests Work On 2.0 / 2.2 Emulators?

Jul 22, 2010

I'm testing out a web page on the Android 2.0 and 2.2 emulators, and the jQuery.ajax() requests that the app makes have slightly different behaviors regarding HTTP Authentication Headers. The server I'm making requests to requires basic authentication, and the ajax requests in 2.2 send the proper auth header. In 2.0, I am debugging with Fiddler, and it seems that the requests do not include the auth header, and the server rejects the request with a 401.2 error. I don't think it matters, but the server is running IIS 7. One interesting thing I noticed while debugging the web requests is that Android 2.2 makes two requests for each resource, whether or not it's an XHR. One does not contain the Auth header, and the second one does. In 2.0, it seems to make 2 requests for everything but XHR's:

Here is the 2.2 header for the first XHR:
GET http://192.168.1.111/sonar/mobileweb/sonar/views/week/init.ejs HTTP/1.1
Host: 192.168.1.111
Accept-Encoding: gzip
Referer: http://192.168.1.111/sonar/mobileweb/sonar/sonar.html
Accept-Language: en-US
User-Agent: Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
Accept: text/plain, */*
X-Requested-With: XMLHttpRequest
Accept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.7

The 2.2 header for the second XHR:
GET http://192.168.1.111/sonar/mobileweb/sonar/views/week/init.ejs HTTP/1.1
Host: 192.168.1.111
Accept-Encoding: gzip
Referer: http://192.168.1.111/sonar/mobileweb/sonar/sonar.html
Accept-Language: en-US
User-Agent: Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
Authorization: Basic cGFyaXZlZGFcZGF2aWQubW9ycmlzOjIzbkx2ZWxsbGw=
Accept: text/plain, */*
X-Requested-With: XMLHttpRequest
Accept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.7

And the 2.0 header:
GET http://192.168.1.111/app/views/week/init.ejs HTTP/1.1
Host: 192.168.1.111
Accept-Encoding: gzip
Referer: http://192.168.1.111/app/app.html
Accept-Language: en-US
User-Agent: Mozilla/5.0 (Linux; U; Android 2.0; en-us; sdk Build/ECLAIR) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
Accept: text/plain, */*
X-Requested-With: XMLHttpRequest
Accept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.7

Has anyone experienced this behavior before? It is basically causing my app to not work at all in version 2.0. Version 2.1 seems to act the same as 2.0.

View 2 Replies View Related

Android :: Load Https Requests With Webview

Jun 2, 2010

I'm trying to load https requests with a Webkit object but It shows only a blank page, with http requests I don't have problems, It shows the page correctly. I have look the source code of the browser, in http://android.git.kernel.org/?p=platform/packages/apps/Browser.git;a... but I don't understand how the browser process the https requests. I think that the class BrowserActivity process the http and https requests but I don't see how to do it. Somebody could explain how the browser process the https request? It uses a Webview object to show the response of the https requests?

View 5 Replies View Related

Android :: Ajax Cross Domain Requests

Nov 7, 2010

The behavior of XMLHttpRequests in Android is very odd when doing cross domain requests. The browser should either fail with an error and not perform the request, or it should follow CORS (http:// www.w3.org/TR/access-control/) and start with an OPTIONS request to the remote domain. The Android browser (2.1 and 2.2) instead performs the request, which is received by the remote server (and this is the dangerous part both for data leaking and remote attacks), but the response is not set in the javascript (status of 0 and responseText null)

View 4 Replies View Related







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