Getting ANR In Concurrent DB Access
Mar 14, 2014
I have used content resolver in my project and override the applyBatch() for writting data into the database :
@Override
public ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> operations)
throws OperationApplicationException {
final Context context = getContext();
final SQLiteDatabase db = getDatabase(context);
db.beginTransaction();
[Code]...
If there is any writing operation to the database, applyBatch() method get called and in same time if I will make query from database(using CursorLoader), ANR comes and the following exception will also comes :
W/SQLiteConnectionPool(18025): The connection pool for database '+data+data+com.abc.xyz+databases+XYZ' has been unable to grant a connection to thread 8073 (pool-17-thread-3) with flags 0x2 for 64.105 seconds.
W/SQLiteConnectionPool(18025): Connections: 0 active, 1 idle, 0 available.
The above issue will not come if I remove the methode db.beginTrasaction() and db.endTrasaction() from applyBatch(). But in that case reading/writing time becomes large. I have used methods db.beginTrasaction() and db.endTrasaction() which reduces database access time to ten times.
Is there any approach, so that SQLite DataBse response quickly and there is no ANR ?
View 1 Replies
May 8, 2010
I have an application with several tables, each being updated by AsyncTask fired by different Activities and used by UI with SimpleCursorAdapter. Though i am not developping a game, I would like to avoid to interrupt the user as mush as possible. Has SQLite is not multiaccess proof, what is the best way of handling such situation?
- I consider adding lock from each DB open and to each close sequence but this seems quite subject to bugs - The solution i am using now is that each DB access (read/write) is done in UI thread (when AsyncTask completes, DB write is done typically in onPostExecute), but that means user is blocked for several seconds during the DB write.
Is there any better solution for that? Should i use a ContentProvider? when i read "Content providers store and retrieve data and make it accessible to all applications", this does not seems to be what i need. Any idea?
View 4 Replies
View Related
Sep 14, 2010
For the buzzer round, I was thinking of writing 2 app for android (we have a few handsets), one for the quiz master and the other for the contestants.The contestants will be connected to the quiz master through bluetooth.After reading the question, the quiz-master clicks a button in his/her app, the button in the contestant apps will be enabled for X seconds. As soon as a contestant clicks his/her button, the quiz master's app will flash the name of that contestant.Is it even possible to have multiple connections and accept concurrent (or multiplexed) messages from them in bluetooth (something similar to select() in unix/c)?If possible, where should I look for any examples? What kind of problems will I face trying to develop this (I know reliability is an issue here) and how to avoid them?
View 2 Replies
View Related
Apr 14, 2010
I want to use ConcurrentLinkedQueue in an android application, have written the code, but now I'm getting an error when the project builds:
Conversion to Dalvik format failed with error 2
I'm using Eclipse with the lastest version of the ADT plugin.
View 1 Replies
View Related
Oct 19, 2010
I'm doing some stress testing of my SQLite database using the testing monkey and I got the following exception, which appears to be from inside SQLite. My app has many threads accessing the database but all of them do so in locking mode so I don't think this exception is my fault. Any opinions on whether I should worry about this exception or if it's just an artifact of the extremely fast monkey keyboard access? Code...
View 9 Replies
View Related
Mar 3, 2013
My company is importing some Android-based TV boxes from China, and we're experiencing a strange bug with some apps we are developing to run on them. I'm trying to find a specific solution that I can tell them to implement in a firmware upgrade, but I am not sure where to look.
In some apps (especially Adobe AIR-based ones), there seems to be a limit to concurrent HTTP requests to a web server. On an earlier ICS 4.0.4 firmware for these devices, this did not cause any problems. But they recently released a JB 4.1.1 firmware, and this problem occurs.
Let's say an app requests 20 items by HTTP from a web server (XML files, PNG or JPG images). What will happen is about 2/3 of these will be sent back, and the rest just remains blank, as if in a perpetual waiting status.
Looking at the web server's logs, there is no requests at all for these missing items.
And, it's totally random. If you re-launch the app, the missing items will be different ones.
So, I am guessing the app can only request so many things at the same time. Any system property that could be adjusted to solve this?
BTW I am unable to replicate this bug on any other device. The TV boxes in question are based on Rockchip 3066 SoC's
View 5 Replies
View Related
Apr 7, 2010
I'm trying to launch a lot of remote connection retrieve picture on a server. To do this, I use AsyncTask.
This pics are displayed in a listview using adapter.
If I implement this in my adapter, images are retrieved but the display is bad (problem with index or something like that).
If I try to retrieve image when I build my object list (contained in my listview), I get the exception 04-07 13:35:57.744: ERROR/AndroidRuntime(4132):
CODE:.................
What is this exception ? Why I can launch multiple asynctask in my listview (giving to me a bad result) and not in a simple object without having this issue ?
View 6 Replies
View Related
Jul 30, 2010
I have an app on Android Market right now with a minSdkVersion corresponding to Android 1.6. I'd like to make an update that is only visible to users of Android 2.2 and higher (there is a good reason for this, which I will explain below). So I have two questions:
- First, if I publish an update with a higher minSdkVersion than the one it replaces, will existing users still be able to see and download the old version if their device is not >= that minSdkVersion? - Secondly, if so, would it be possible to publish updates to that older version branch? Or would it become a fossil relic, but at least always there for downlevel users? Now for the background. My apps use a large amount of resource files-- about 15MB for the Lite version, and about 55 for the Full version. Prior to Android 2.2, it was not possible to install an app on the SD card, so my solution to this was to have the app contain the bare essentials, and simply download the other resources from my web servers at first-run. However, this means that I must maintain external infrastructure, and it's also a bad experience for users who must download the app, then start another download sequence (I already have had several complaints about this in my user comments). What I would like to do is to keep the app as it is for users with Android OS < 2.2. I'd like to publish an update that is only visible to users with Android OS >= 2.2 which packages everything into the app and allows it to be stored on the SD card. And I'd like to be able to perform maintenance on both versions as needed. Why can't I just do the update as described above to a single branch of the app? Because it would mean that users with Android OS < 2.2 would have to download a massive application to their internal memory, which could be a deal-breaker for devices with only 128MB or 256MB, which is shared with the OS. Since I already have paying customers, I don't think I can ethically create an update that would potentially consume most of a user's internal memory, when the version they purchased was only a couple MB.
View 9 Replies
View Related
Mar 10, 2010
I am testing my multiplayer game by running several instances of the emulator (which is, sadly, extremely slow and dis-satisfying). I depend on a little trick using currentTimeMillis() to keep a synchronized clock between the players (but NOT the absolute value of currentTimeMillis() since no two phones are probably set exactly the same)Anyway, I *do* naively assume that two emulators, running on the same PC would return near identical values for calls to currentTimeMillis(), and what I find is that they start off the same, but pull rapidly apart.Which makes me think the underlying implementation of currentTimeMillis() in the emulator is not at all based on the host PC's calendar, and rquires the emulator to get enough Windows compute cycles to be anything close to accurate. (and one emulator is always running at a lower priority to the other, depending on which one is on top)
If this is just an artifact of the emulator, then I can deal with it, but if it implies I have a fundamental misunderstanding of currentTimeMillis(), then that would be something i need to deal with. Part two of the question is: any way I can speed up the emulator? When I run two, are they sharing one of my cores? Can I split them onto separate cores?
View 10 Replies
View Related
Aug 27, 2009
This post is in addition to: http://groups.google.com/group/android-developers/browse_thread/threa. I have exactly the same problem and Doug pinpointed what's probably the issue in my case exactly: So here's the deal: I have a Vector containing traffic messages (received from a server via UDP in an own thread). Each time a message is received, I create a new overlay object and populate it with the traffic messages: Code...
View 4 Replies
View Related
Jun 23, 2010
I even tried flashing a custom rom (Fresh) on the last attempt and it just seems like it is giving me the Sprint stock Rom. Shouldn't the custom Rom look different? Once rooted do I still need to use Unrevoked method to grant superuser access for Apps?
View 9 Replies
View Related
May 8, 2014
So I cancelled my all access trial, I don't find it useful to me, even though I cancelled it, I'm still seeing radios, and other all access features. Will it disappear from my Google Play Music after it's supposed to expire (06-07-2014)? My account type still lists as All Access...
View 1 Replies
View Related
Oct 22, 2010
I want to access a web service in android web application.But I don't have any idea.
View 3 Replies
View Related
May 18, 2010
Tried searching, but didn't find any existing threads that addressed whether or not the EVO would have access to Outlook Web Access (OWA) through it's mail app. Does anyone know if OWA Access will be a feature? I'm upgrading from the Instinct and, while the EVO kills it in nearly every way, this is the one thing that I'm nervous about giving up because it makes my life so convenient - my work won't let me tap into their exchange environment.
View 11 Replies
View Related
Jun 18, 2010
Does anyone know if there is a simpler way to access SD card info from the phone, other than using the Astro app? I would like to open the SD card from the phone without seeing all the other files on the phone. I simply want to see files on the card.....pics, music, ringtones, movies, etc......not every file and program on the damn phone. I love my EVO, but this issue really annoys me.
View 2 Replies
View Related
Jun 4, 2010
Does anyone have access to Qik on EVO?I tried to sign in but it keeps saying that " You are not currently connected to the network. Please check your connectivity settings."But I already turn on 4G or Wifi, and I can surf the net. So i don't get what it means. Anybody has idea?
View 14 Replies
View Related
Jul 10, 2010
I've been hearing a lot about adb shell, how do i access it? what can be found in adb shell?
View 1 Replies
View Related
Jul 11, 2010
Is there an app to access my pc through my driod? Ive searched the forum and cant seem to find a straight answer.
View 7 Replies
View Related
Nov 5, 2010
I have the desire but do not use the VPN feature. My old man is looking at getting a Desire but needs good VPN access. Has anyone had any experience in using it as he has heard from one of his friends he has difficulty in accessing it!
View 2 Replies
View Related
Apr 6, 2014
I'm working on a project where in I need my android phone to control my pc just like remote desktop. I'm aware of various apps(2x Client , RD Client) and softwares(VNC) already available. But what I want is to build it from scratch. Can I use RTP or something else?
View 4 Replies
View Related
Sep 13, 2010
For some reason on my HTC desire, I cannot access my SD card. It says 'Blank SD card' in the notifications section. For this to happen on a phone is completely unacceptable. Before my SD card was rendered unusable, I used to get problems like whenever I try to take a photo, it would not allow me to because of an SD card issue. Restarting would solve that. That is also unacceptable. Where do I go from here? Have i lost all my data? What is to sat that this wont happen again?
View 2 Replies
View Related
Jun 10, 2010
Why when I'm on a phone call (blue tooth) I can't access other apps:like Mail
View 7 Replies
View Related
Jul 5, 2010
I have set the phone for USB debugging. I will select it as a hard drive and yet my computer will still not recognize it and I would love to be able to just click and drag files and folders onto my phone.What am I doing wrong?
View 8 Replies
View Related
Jun 4, 2010
I can format the card from the phone. I can save pictures to the card from the camera app. The phone sees the card properly. When I plug in the pc usb cable I select "disk drive" but the drive doesn't show up on the computer. Sometimes I see the drive (Drive G) pop up for a split second then disappear. Sometimes it never appears. I always get the "choose a connection type" message and select disk drive. The notification bar shows "USB DEBUGGING." I have tried it with USB debugging off or on. I have also installed HTC SYnc but that didn't help (and doesn't connect). Computer says "USB device not recognized." It always worked fine with my MyTouch 3G. There is nothing amiss in device manager.
View 18 Replies
View Related
Jul 1, 2010
I have an EVO and a Hero on my account, can't access EPST on either one anymore. I have the MSL's for both, I type ##data# into the dialer, it brings up EPST, I choose edit and type in MSL. Always get a check password error on both phones. Used same procedure with MSL on Hero before 2.1 update, but not since. Used it to change cycle slot index to receive calls faster on my old Hero, went from 2.5-3.5 rings to 2 rings with a change to just 1 (default is 2, lowest is 0.) My EVO seems to be ringing on 1.5-2 rings, not too bad, but if it can get better I want to try it. Anyone else unable to access EPST with their MSL #? Anyone else able to with a different method? Both Best Buy and Sprint customer service have given me the same MSL #, and both have confirmed it is not the other 1 time use password (I forget that acronym)
View 2 Replies
View Related
Dec 7, 2009
I would like to ask you smart people if anyone has seen any documentation regarding web access to a database from within an Android application. I would like to create a (FREE) application where the users can share information (rants/complains) around the globe. Each user will be able to see a little globe in his phone with locations of other users and some specific information about them.
Architecturally, I am thinking "database in my GoDaddy host, exposing a web service", and the web service accessed from the Android application. But I see no documentation about accessing web services. I can also go XML, maybe, but I am not seeing what mechanisms exist in the Android for over-the-web XML access.
I have a feeling I am mis-understanding something big in the picture. Can someone point me to docs, or knows something about this topic? (the iPhone has a Lighter app where you can see people lighting around the globe. Mine is similar, but people would not be lighting, instead they will be "complaining/ranting").
View 1 Replies
View Related
May 26, 2010
I am working on a Android app and I have a dilemma. I have a list of Objects. I have to update each of these objects with a database. I have 2 methods:
Method 1:I can loop through the Objects. For each object I can connect to the server, update it, and then move on to the next Object, and so forth.
Method 2:I can store the Objects in a list, send the whole list to the server, update it on the server side, then return a list of updated objects.
My questions are:
Which method is faster?
Which method is easier on the phone's battery?
View 2 Replies
View Related
Jul 14, 2010
I understand that to access a SQL database from Android I need to create a web service that will run on the SQL server and will process requests from the Android application, what I need to know is how to create this web service and how to access it from Android.
View 1 Replies
View Related
Jul 27, 2010
I'm using an sqlite database in my app.
I have this dbhelper class in a services class like so.
CODE:............
In my activity classes I access and keep this application as a local variable like so:
CODE:..............
And my service call looks like this:
CODE:.............
I've added these overrides in to try to get rid of my memory leaks.
CODE:.............
But I can't get my memory leaks to stop.
How to rid myself of these memory leaks? These leaks are of the type:
CODE:..................
View 2 Replies
View Related
Jun 18, 2010
I am new to android platform. I am testing one android phone application. I want to see the database entries for that.
View 2 Replies
View Related