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
Apr 13, 2010
What are the advantages/disadvantages in placing a lengthy network access code in a thread in an activity or a thread in a service? How would it affect the application? I am writing a streaming audio player and from what I've read so far putting the code in a service will still end up blocking the application so a new thread is needed, does anyone know if it makes more sense to put this piece of code in a service.
View 1 Replies
View Related
Sep 27, 2010
Are we able to establish both WiFi and 3G connections at the same time on Android 2.1? We are implementing a "make-before-break", so that WiFi can be switched to 3G before tearing the WiFi connection down. Please guide if you have come across this.
View 2 Replies
View Related
Apr 14, 2012
I need a time tracking app. There is a lot of time trackers on Google Play and I've tried a lot of them, but in every app I missed one important feature: parallel timers for different clients and jobs.
I need:
- to define my clients, to define my jobs I do for the clients, to define projects.
- to simply choose client, project and kind of job and then start the timer
- to simply start and stop MULTIPLE timers (start and stop one timer, while second timer is still running)
- to export all data in usable form (for billing my clients)
Example of what I mean:
- My job is phone support. I am sitting at home and answering phone calls. I am payed for hours, so I need to start timer and leave it running almost all day untouched (except of lunch time).
- Because I spent most of the time by waiting for calls, I simultaneously do other jobs. I write articles, compose music and do some other work for other clients. So I need to start and stop timers according to actual work - but the "phone support timer" has to be also running. When I am - for example - writing an article and someone calls me, I need to stop "writing article timer", pick up the phone and solve customer's problem. When I drop the phone, I need to start "writing article timer"... etc...
This kind of app with parallel timers I've used on my Psion PDA back in 1998, but I can't find similar app for Android phones.
View 8 Replies
View Related
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
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
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
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.
View 10 Replies
View Related
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
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
Oct 27, 2010
I'm trying to read from a file while it still opened for witing.
View 2 Replies
View Related
Nov 4, 2010
Often during my calls I can hear a call waiting tone (double beep) but when I look at the screen there is no parallell call? Am I hearing the other persons call waiting or is it a glitch in my phone? I had this issue on every ROM, 2.1, 2.2 and live in Sweden (if it makes a difference)
View 3 Replies
View Related
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
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
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
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
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
Jun 18, 2010
Is this suppose to work only with 4G or am I missing something?
View 3 Replies
View Related
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
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
Aug 31, 2009
Of course i don't know google's plan. i just hope it. through emulation though.
how about android-sdk for chrome application? the idea is just recompiling to make execution file for google chrome os.
how about the sdk for windows? it's for windows platform.
View 2 Replies
View Related
Aug 30, 2010
How can i improve the performance of simultaneous processes agains the time and space in androied?
View 1 Replies
View Related
Jan 12, 2010
I do a ((Context)thingy).bindService(...) from within the onCreate callback of an Activity. I've observed that the onServiceConnected() callback of my associated Service Connection does not execute immediately, but rather, is delayed until after the Activity resumes, or more precisely, after return from the onResume() callback of the Activity. I discovered this the hard way (through a null pointer exception) because I was unable to use the Service (I call a method in the Service to start a Thread) immediately upon return from the bindService () call.
I assume this is normal behavior, but I don't understand why, and I further assume that there is a good reason for it and that I would benefit from understanding it. I'm guessing that maybe the Service isn't eligible to run because there are fewer than 1 processes bound that are in an active state.(?) But once it starts, if I then start the Thread within, it continues to completion of its task, even if the Activity calls unbindService() and terminates first! I don't mind that behavior (it's what I want to happen), but I want to know whether I can generally rely on it. I'm seeking some wisdom from the forum. Please help me clear my fog on all these points.
View 3 Replies
View Related
Sep 1, 2010
There is a user input then on submit pass the search keywords to the db server and return the results (the db server has to be external by the way). Could i pass the search query to server side (php) and get the php script to execute the queries and return the scripts output?
View 3 Replies
View Related
Jun 1, 2009
I would like to execute opcodes directly against the running Dalvik VM instance from within my application on Android. I'm looking for something similar to the C asm function. I have a list of opcodes for dalvik, but I am unfamiliar with how to either execute them directly, or write them out to .class files and execute them against some sort of VM CLI command like dalvikvm from within a running application.
View 2 Replies
View Related
Nov 3, 2009
I've been doing Android application development for Android 1.5 on Debian etch (4.0), and things were going okay. I then tried upgrading the SDK to support more recent platforms. The problem is that the vast majority of the tools that are executables (I'm not counting shell scripts) seem to now depend on glibc >= 2.4. When trying to execute them, or passing them to ldd, I get an error like:
./aapt: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.4' not found (required by ./aapt)
On Debian, the file /lib/tls/i686/cmov/libc.so.6 is provided by the libc6-i686 package, which on etch is version 2.3.6.ds1-13etch7, but on lenny I see that the version has increased to 2.7-18.
I can think of a few workarounds: - Copy the required libraries from a supported platform and point to them with LD_LIBRARY_PATH when using the affected executables. - Download the sources for the tools (e.g. http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;...) and build my own local versions for Debian etch. - Give up using Debian etch and switch to another platform.
All of these are potentially viable alternatives for me, so this isn't a show stopper, and indeed http://developer.android.com/sdk/requirements.html says that it's only tested for GNU/Linux on Ubuntu Hardy Heron, which uses version 2.7-10ubuntu5. Nevertheless, it's somewhat annoying, and I'm wondering if anyone has any thoughts, or if the Android team even knows of the issue. I'm guessing that sometime in the transition from 1.5 to 1.6, they switched from an earlier Ubuntu version (I have to go back to Dapper, which uses 2.3.6-0ubuntu20.5, to find a pre-2.4 version) to Hardy, and this was just a side effect. But I'd be surprised if there was anything specific in the source that really required libc 2.4, and it's possible that if they were just building with an appropriate compiler flag that backwards compatibility could be maintained.
This affects all platform-specific tools for platforms >= android-1.6 (so aapt, aidl, and dexdump), and it affects all platform-agnostic tools (except for hprof-conf and mksdcard; so adb, dmtracedump, emulator, sqlite3, and zipalign) installed with the new modular sdk download (android-sdk_r3-linux.tgz) available starting in the android 1.6 timeframe (the corresponding tools from the android 1.5 timeframe in the monolithic SDK download of android-sdk-linux_x86-1.5_r3.zip work fine).
View 2 Replies
View Related
Jul 28, 2010
I have a service MyService.java in Application "ServiceDemo". The manifest of this application looks like this
CODE:.............
I have another application "CallerService" manifest looks like this
CODE:................
I have an activity from where I m trying to start the service on the click of the button
CODE:................
This fails to work. Says "unable to start service intent"
View 1 Replies
View Related
Aug 24, 2010
So basically I would like my app to read info from a database, this info would be a string that is valid java code. Once read, I would like my app to execute this string as if it were code. Is there any functionality packaged with the android sdk that supports this?
Essentially I want the phone to populate some data with information queried from a database. One of these pieces of information would be a statement like: "return data.ZombieKillTotal >= 100000;"
Which would be used inside a statement like:
CODE:......
I just don't know what to use for 'ExecStringAsCode':
View 3 Replies
View Related
Feb 9, 2009
I need to customize the launcher application. I built it from the android source, and installed it to the emulator successfully(By renaming its package name to solve signing conflicts). When I tried to run my build, an exception occurred, and I can't find where it actually from because it seems to be from an internal thread.After an whole day trying, I found that the exception is thrown by the line in Launcher.java possibly: setContentView(R.layout.launcher)Does anyone have any suggestion?
View 9 Replies
View Related
Apr 2, 2013
I need to execute following command in my app.
command: echo "1" > /sys/manager0/enable
I tried this with following code in my app.
Process p = Runtime.getRuntime().exec("su");
DataOutputStream stdin = new DataOutputStream(p.getOutputStream());
String cmd = "echo "1" /sys/manager0/enable";
stdin.writeBytes(cmd+"
");
There is no error and app executed perfectly but there is no change in the /sys/manager0/enable
View 2 Replies
View Related