Android :: Concurrent Modification Exceptio要 In SQLite
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
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
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
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
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
View Related
Apr 15, 2013
Is there any way to add new words automatically to the 4.2.2 keyboard dictionary?
It's really annoying to agree three times and then the keyboard closes in some apps.
SwiftKey adds them as you write them down without Flow/Swype for one time.
However I didn't stay by SwiftKey because I love the stock keyboard too much.
Any modification? I would be ok with an "one-click-add" as well.
View 1 Replies
View Related
May 12, 2010
I wanted to know if it is even possible to either set up or modify email account settings programmatically. I do not believe it is, due to email applications controlling their own settings (and thus would depend upon a ContentProvider from that specific client), but I have not yet found a definitive "no", either.
Further, I was wondering about the email account support on Android in general. It appears that Android 2.0 and above will allow for multiple ActiveSync/Exchange accounts and mulitple IMAP/POP3 accounts, and displays these in the same inbox. Is this claim true? Also, how is this different from the other major Android releases (Android 1.5 and 1.6)?
View 1 Replies
View Related
Mar 10, 2010
I was thinking about this earlier and figured I'd ask.If I made an application that has lots of resources, what would stop someone from extracting and adding/modifying the resources I ship with it?Does an application that doesn't want its data manipulated have any sort of option to protect itself?
View 1 Replies
View Related
May 17, 2013
Today i want talk with you about a Software "Problem" i have with my Android Car Stereo. For a good overview i write a short briefing.
- Android Car Stereo: icartech Alpha v800
- Android 2.2 Froyo
- root access (with z4root)
- adb access only with wifi
- no recovery Menu
- i got the original Stock Rom, which can flash on the System
The Problem:
The Launcher has a Dock with several system App Shortcuts. The Dock is fix, so i can't delete icons, can't change Icon Order, can't add Icons. No new installed app can add a shortcut to the Dock. Except iGO Primo, it's the only app, that has automaticly add a shortcut to the Dock.
I want delete some shortcuts, cause i don't need them and i want add some shortcuts that i daily need.
My Question is: how can i unlock the Dock that i can change thins? Or modify non system apps to add a shortcut to the dock? Is it possible that the launcher has a app list, which controlls, what app can add a shortcut and what can't? And when a decompile the Launcher in which .smali i can possible find the "permissions"?
View 9 Replies
View Related
Aug 20, 2013
I have a RikoMagic android TV stick. I want this functionality:
- I power up the stick
- the stick loads with wifi internet connection preset
- the system automaticaly opens browser in full screen mode with predefined starting page
- the user cannot change settings
Is it posible to make this with some aps (I hope free) or is it better to get some modified ROM (which?). I know this functionality is used in so called KIOSK modes, but as I can see all this software is very expensive.
View 1 Replies
View Related
Dec 17, 2009
But is there an app that will only allow the auto bright to go up to max 50%?
View 8 Replies
View Related
May 20, 2010
I cannot figure out the origin of the ConcurrentModificationException. In my activity I'm calling
updateMapOverlay(). I'm also calling updateMapOverlay() inside another Thread (a TimerTask) that is invoked on regular intervals. I'm taking the appropriate locks when invoking updateMapOverlay() from both the threads. Is this problem being caused because I'm invoking updateMapOverlay from inside a non-UI thread (i.e., TimerTask).
private void updateMapOverlay() { this.itemizedOverlay.refreshItems(createOverlayItemsList());
List<Overlay> overlays = mapView.getOverlays(); overlays.clear();
overlays.add(cotItemizedOverlay); this.mapview.invalidate(); }
Exception:
W/dalvikvm(10641): threadid=3: thread exiting with uncaught exception (group=0x4001b180)
E/AndroidRuntime(10641): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime(10641): java.util.ConcurrentModificationException....
View 3 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
Sep 15, 2009
I would like to the get the last modification time for each Contact in android.provider.Contacts.People table. I have the following queries, a) Is there any column to notify that this contact record is updated. b) Is any column is available like last modification time or revision time to indicate the changes in each record(Each row in table).
View 4 Replies
View Related
Sep 12, 2010
What I wanted to do was change the lg default background during a phone call to the android stock gradient as i prefer the look of it better. I extracted the phone.apk out of the /system/app directory and found that the gradient images are already there. so my question is, why is the phone not using these images and how do i change it so it does. My first thought was a meta morph theme that only changed the phone app but seeing as the images are already there i guess there's no point.
View 4 Replies
View Related
Nov 19, 2010
Probably a simple and already covered topic, but I have searched and found nothing.So, what can I do to make my notification bar look a bit spiffier
View 2 Replies
View Related
Feb 14, 2010
I got my N1 a few days ago and am really liking it so far. One thing that bothers me is the color saturation of the screen and I'd like to tweak that if I can. Does anyone know of a screen adjustment tool that will perform global color modification?
View 3 Replies
View Related
May 25, 2012
I have source code from an appli running on android 3.2 with a WAMP Server and WowZa Server on my desktop. I have to make it accept the HLS (Http Live Streaming). I saw on the web that the Vitamio Library can do that so i used it. I know that natively, android 3.0+ do it well but i do not succeeded make it work successfully.
The player is successfully displayed but no video starts..After a reboot of my router (because my server didn't answer), the player crash each time.
Somestimes yes, sometimes no, i have some logs, they are as attachment.I think a buffer problem...
I think I have to implement this method (at the end of my code) but i know what type in it.public void onBufferingUpdate(MediaPlayer mPlayer, int percent)
IT WORKS VERY WELL WITH .MP4
Here's my code from the Player Activity :
Code:
package fr.niji.broadpeak.activity;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
/*import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnBufferingUpdateListener;
[code]....
Commented lines are the lines when i had still not used Vitamio.
View 4 Replies
View Related
May 6, 2009
I am seeing the exception in 'adb logcat'.But I don't know if it is caused by my application or android platform.Can you please give me any idea how to troubleshoot this exception?
View 3 Replies
View Related
Apr 1, 2010
I want to create a table whose primary key will be some other field and not _id . The below table gets created but the value of _id remains null :
"create table accounts ("+BaseColumns._ID+" integer , profile_name text primary key" +" name text not null);";
My doubt is wont _id get auto incremented if we do not place "+BaseColumns._ID integer primary key autoincrement+" .
View 3 Replies
View Related
Feb 13, 2009
I'm new to Android, I just finished the Notepad Tutorials, where we can create SQLite Databases to save notes. So I wanted to know if it was possible to "import" my own SQLite database (not created with my App but with a 3rd-party software) to my project, and if the answer is yes, where should I save my SQLite databse and how can I have access to it.
View 9 Replies
View Related
Apr 1, 2009
I read in the documentation for SQLite that there should be some core functions and aggregate functions available, but I can't seem to use them in my code.. Can anyone help? Here's the documentation ad: http://www.sqlite.org/lang_aggfunc.html http://www.sqlite.org/lang_corefunc.html There is for example the function count() but how do I use it? I have tried to use it as stated below, but none of the functions in the documentation is available that way (i.e when I type "db." the list that shows in Eclipse documentation doesn't include any of the functions from the SQLite doc except from execSQL):
Code...
View 7 Replies
View Related
Mar 25, 2010
I'm doing a application that will use a database with serialized object. The objects will be already serialized and the user will just display things. On a PC I would just make an XML but with android I'm not sure. Can I make an XML and "unpack" it when the user launch the application for the first time or should I do something else?
View 3 Replies
View Related
Mar 5, 2010
I put my database field in "assets" folder. And use the code from this blog to copy the database to "/data/data/my_packname/databases/", (This copy code i run it in the onCreate() method when i run this app) then use select * from ... to get data. But it gives me the exception: no such table. Someone told me that if i am attempting to copy the file in SQLiteOpenHelper's onCreate(), it's too late. So the copy file code can not copy the complete file. So i need to use adb or ddms to pull the database first? So, Anyone can teach me how to use my own databse?
View 3 Replies
View Related
Jun 9, 2010
I have a SQLite database, and several tables within that datbase. I am developing a DBAdapter for each table within the database. (reference Reto Meier's Professional Android 2 Application Development, Listing 7.1).
I am using the adb shell to interface with the database from the command line and see that the database is being populated as I expect. Occasionally, I want to drop a table so that I can ensure it's being built properly, from scratch.
The problem is that SQLiteOpenHelper only checks to see if the database exists. Is there a typical solution to writing a helper to also see that the table(s) exists? Basically once I drop a table, the helper checks to see that the database exists and assumes all is well.
Also, the CREATE_DATABASE string used in the reference above only creates the one table. Should I consider using the DBAdapter for an adapter to ALL of my tables? That doesn't seem as clean to me.
View 1 Replies
View Related
Nov 18, 2009
Firstly, I have found many examples of how to grab data from a db and place it into a list, however this seems to be all for ListActivites.
My list is part of the UI and therefore I can't use a ListActivity because it does not consume the whole screen (or can I?).
This is the UI:
CODE:........
So, from what ive read I need to grab the data from the db, then place it into some sort of array then use an array adapter to fill the list view. Is that correct? If so, is there some sample code because all I can find is code releated to ListActivites.
View 2 Replies
View Related