Android :: Packaging SQLite DB For Deployment?
Jul 10, 2009I have an SQLite DB file. I wish to include the sqlite file with my apk. How do i do that?
View 4 RepliesI have an SQLite DB file. I wish to include the sqlite file with my apk. How do i do that?
View 4 RepliesI have created a SQLite database on my PC. I have imported it into my assets folder in the project directory. How do I access it from my Android application?
View 1 Replies View RelatedI have developed an application in Rhodes framework and deployed the application in an Android emulator. When I try to access the application i get the following error, SD card error, Application can't access the SD card while it's mounted.Please unmount the device and stop the adb server before launching the application. I have tried to unmount the SD card in the emulator but I am unable to do that.
View 1 Replies View RelatedIn college, my senior project was to create a simple 2D game engine complete with a scripting language which compiled to bytecode, which was interpreted. For fun, I'd like to port the engine to android. I'm new to android development, so I'm not sure which way to go as far as deploying the engine on the phone. The easiest way I suppose would be to require the engine/interpreter to be bundled with every game that uses it. This solves any versioning issues. There are two problems with this. One: this makes each game app larger and two: I originally released the engine under the LGPL license (unfortunately), but this deployment strategy makes it difficult to conform to the rules of that license, particularly with respect to allowing users to replace the lib easily with another version. So, my other option is to somehow have the engine stand alone as an Activity or service that somehow responds to intents raised by game apps, and somehow give the engine app permissions to read the scripts and other assets to "run" the game. The user could then be able to replace the engine app with a different version (possibly one they made themselves). Is this even possible? What would you recommend? How could I handle it in a secure way?
View 1 Replies View RelatedI've noticed that the PNGs of my application with some gradients effects looked terribly bad at the device (a Samsung Galaxy) and at the emulator, and I've found the following note at the documentation (http://developer.android.com/guide/topics/graphics/2d- graphics.html):
Image resources placed in res/drawable/ may be automatically optimized with lossless image compression by the aapt tool. For example, a true-color PNG that does not require more than 256 colors may be converted to an 8-bit PNG with a color palette. This will result in an image of equal quality but which requires less memory. So be aware that the image binaries placed in this directory can change during the build. If you plan on reading an image as a bit stream in order to convert it to a bitmap, put your images in the res/raw/ folder instead, where they will not be optimized."
I've tried the res/raw suggestion, but it didn't worked.
I've tried to use the image as JPEG as a workaround, but I couldn't use 9-patch.
I've uploaded a comparison between the original png and the "optimized" png that is shown on the emulator or devices: [url]
One workaround would be put the images at /assets/ and manually load and set the image on the ImageViews, but it requires a lot of code changes.
I've got ~200 png files in the /res/drawable folder, mostly interface and sprite sheet stuff. They're all indexed pngs, and weigh in at a grand total of a bit over 400kb.
When I run aapt to package them into the apk, their filesize nearly doubles. Opening the apk up with 7zip and extracting the drawables confirms it: 790kb.
Does anyone have any idea why this would be happening? I thought the packaging process was meant to compress the pngs, not inflate them!
I'm placing the file '.nomedia' into a folder in order to avoid Android's MediaScanner from detecting the media files in the folder. I need to copy this folder (including '.nomedia') from the APK's assets to the SD card (so other apps can make use of these media files, etc.). When I package the APK in Eclipse, it doesn't package the '.nomedia' file. Presumably it's detecting it as a hidden file. Any ideas how to fix this? Is there a secret aapt flag I can use? I'd like to avoid copying the folder and then manually creating a '.nomedia' folder, if possible.
View 1 Replies View RelatedIn Windows, we write "installer script", and user an "installer compiler" to generate an installer, let's say .inf for .msi/.cab and .nsi for NSIS.
But when it comes to Android, is there a similar method?
If I create an application for Android, how do you package extra items in with it like a live wallpaper or widgets? For example, google maps does this by including a live wallpaper with the download of the latest version.
On a related note, with google maps, it's available for, I believe, 1.6 and up, but it seems that it is all the same download. So how do you ensure that, even though there may be a 2.x only feature included, it still shows up for lower OS phones? Or is the marketplace maybe actually holding onto two separate APKs for each OS?
I am getting an error in my Problems tab for my Android Project in Eclipse. The error is "Android Packaging Problem" with an Unknown location. Unknown Error NullPointerException
I cannot determine what this problem is. My project was working a few hours ago. The only change I made was to add a public interface ITrackDao to my project and implement it. There are no errors associated with this. I am not even sure where to begin to look. I cannot launch the application.
I'm getting this crazy error on multiple projects, even when I revert back to prior versions that compiled just fine. Unknown Error - java.lang.NullPointerException Android Packaging Problem Path is blank Location is Unknown. 1 - Project -> Clean -> All 2 - Deleting .metadata folder 3 - reimporting projects into the eclipse 4 - reverting my projects back to prior working versions using git. I just can't get anything to compile now, and I've searched for solutions here and on eclipse forums.
View 3 Replies View RelatedMy team is currently trying to package a native .so library within an AIR APK. This native library is used by a native extension we've built, but the library is not the extension itself, therefore the standard process of creating an AIR APK with an extension does not include these libraries. We have to, somehow, instruct AIR to include the native libs in the packaging process.
The real headache is that for Android to link to these libraries, it appears that they must sit in the following directories (we have 2 .so files):
/lib
/armeabi
mynativelib.so
/armeabi-v7a
mynativelib.so
When using ADT we can include the /lib directory in the APK, but AIR sticks the /lib directory in the APK's /assets directory with the rest of the AIR files....but this does not work because Android does not appear to find the native libs.
how we can get this lib directory sitting at the root of the APK?
Comes with everything.... Chance
View 4 Replies View RelatedAnyone know where to find the "SHARK" wallpaper from the EVO box? Been trying to find that damn thing for the longest.
View 3 Replies View RelatedI 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 RelatedI 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+" .
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 RelatedI 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...
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 RelatedI 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 RelatedI 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.
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.
I've been using my Activity class to access my DB which made my program freeze sometimes.
So I decided to use AsyncTask instead to handle the DB.
My problem is I don't know how to instantiate my SQLite DB "TheDB" from AsyncTask's class
CODE:.............
This worked fine on the Activity class, but it I dont know how to use it here
TheDB's constructor is TheDB(Context context) but this class is not a "context" so how can i use my DB here?
I wanna set a textview as the values from SQLite when I click the ListView Here is my way...
View 1 Replies View RelatedCan any one tell me how to store and retrieve arraylist in/from sqlite.
ArrayList<Double> results = new ArrayList<Double>();
i have the critical situation.i want to store the image in DB in android. but i don't know how to store image in db and how to get from db.i novice to android platform.so anyone give me the samplecode to develop my application.i tried more time but not i get the correct output.how to create the image field in SQLite db and how to insert the image within db.
View 2 Replies View RelatedI execute this async task in my application, I don't understand why my progress dialog and all application freeze. Insert in doInBackground put one hundred or so entity in database.
In other case (but it's fisrt time with sqlite).
I use AsyncTask and I have no problem.
CODE:.................
I have a library written in C which implements some complicated algorithm over two databases and as a result produce new one. I am trying to import it in android using android-ndk. What is the correct wat to use sqlite in you native libraries, i was able to build the sqlite manually using the ndk but when i use it gives some strange errors when trying to fetch rows from db which is on phone storate - after i fetch some data i got SQL:database not opened. how can use sqlite in native code on android.
View 2 Replies View RelatedI am trying to adapt my application from a confirmation model to an undo model. For those of you who don't know, this is where you can delete something with one click but if it was a mistake you can undo it just as easily, as opposed to interrupting the user every time he/she wants to do something to ask the annoying "Are you sure you want to...?" question via dialog.
My app is backed by the Android SQLite DB and I want to be able to undo a limited set of delete and update operations. Also, I only need to be able to undo one sequential change and the information does not have to stick arround for very long.
Everything I read on undo/redo says to use a command model to store the data. My question is how can I store the database changes in a lightweight restorable way?
I have a class like class My data{ String name; int data; Location[] locality.
View 8 Replies View Related