This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to use my own sqlite database?
Full Android Database Helper class for existing SQLite database?
I am new to android, i have created database using sqlite database browser now i want to use this database in my application so what are the step to do so any example code or any help will be appriciated
Follow the instructions from this blog
It will walk you through all the steps you need to use to get a pre-created db into your app.
EDIT
You didn't mention that your db was large in the initial post. In that case you might want to try android-sqlite-asset-helper
I don't see where it says it, but I know I've seen Mark from CommonsWare comment that it will transfer any size file for you. You zip up the db, put it in your assets/databases folder, and follow their directions to code your db class and you should be good to go.
Related
This question already has answers here:
Java Embedded Databases Comparison [closed]
(18 answers)
Closed 6 years ago.
Good day, I have a potentially easy question. I am in the process of developing an application for my mother. She teaches a Sunday-school class, has been teaching it for many years now, and as you can guess, has a ton of information kept hard copy. She also has complex grading styles, a store where kids can buy stuff with their good grade points (called talents).
Anyway, I come from a background where I used a database to store massive amounts of information, but the database was always static. Meaning I would open MySQL, add an instance of our local DB, and then just connect to it whenever I need to. But the problem arises, how do I distribute an application that exists statically (ie you have to put all connection details into the program) be flexible enough to where I can install my App onto any computer and it would work without a specific database connection. In other words, is there a lightweight database that can be attached to a program that will be distributed?
I don't want to store information like Students in an array list, I am bent on using a database, unless someone can convince me. (also because with a database, it is easier to make the data persistent, it seems to me)
SO the question again, how do I develop an application that will use a database, but will also exist when you distribute the application to other computers without having a network database that has to be connected to every time the app is run?
I'm sorry if it is a basic question, I come from an HMI/SCADA background, things work a little differently...
You can use H2. It is a Java database.
http://www.h2database.com/html/main.html
This question already has answers here:
webservices on android eclipse
(2 answers)
How to connect Android App connecting to a web service
(4 answers)
Closed 8 years ago.
This is a rookie question at best but here goes anyway,
I developed an android mobile application with eclipse, and my task now is to create a database (quite large) to complete my project,
I spoke to my boss about it because i found a lot of links on the web talking about sqlite databases, but this isnt what's required for this app, the data is not to be stored on the device.
My question is, in the of a android mobile app, what database should i use, which tool, how to access it? I really need help understanding, so if any of you guys has experience in this matter i could use some.
Thanks
As you say Sqlite is about storing in the device. .
It does depend on the complexity/scale of your database.. and also the expertise and learning curve that you or moreover your company are prepared to invest in.
Also where is it to be located? I have just been and am going through this myself and chose Microsoft Azure to host it. There you can choose what you want to do whether you choose a NodeJS approach and then go with something like Mongo DB or set up a 'website' with sql and all those good things.
If I were implementing a simple mobile only app with simple ie not complex storage I would take the former approach. The project I am doing also needs a website and my expertise happens to be sql so I chose the latter. That doesn't mean I couldn't have done the former if I had the time to invest in learning Mongo and node.. which is why it depends:-) Hope that helps.
Ps. Azure is worth a look though as you can get going really easy and it looks like it scales well. Of course there are others to consider.
This question already has answers here:
Java - Storing SQL statements in an external file [closed]
(12 answers)
Closed 9 years ago.
I need to install a DDL, preferably saved in a file, into a DB using JDBC. I have seen the addBatch() and executeBatch() methods in 'Statement' API but they seem to require adding individual statements one at a time. I am trying to find a way to add a big bulk of statements (DDL) that I can store in a file and pass as a paramter into a java app that will then use JDBC to install.
I'm going to give an answer that I think will help you maintainability wise, but it may not be what you're looking for. Here are two libraries that help with database migrations:
http://www.liquibase.org/
http://flywaydb.org/
Not only will these help you execute DDL in a file, they bring lots of other features you don't want to have to reinvent. EG, they'll make sure they only get run once if they succeed.
If these aren't the right tool for the job, I think the comment #Alpesh Gediya made is what you're looking for.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I read SMS messages from the inbox programmatically in Android?
I'm trying to build a program that extracts SMS from android devices through a java program. Does anyone know an API that does this?
I'm aware the SMS (the backups anyway) are stored in a database so I was hoping to find this database on the phone, extract it and then load it into a database.
Check the following link.
http://www.apriorit.com/our-company/dev-blog/227-handle-sms-on-android
Manas provided a good link.
Here is another one that I used.
http://www.androidcompetencycenter.com/2008/12/android-api-sms-handling/
is broken => try via archive.org
I think you are referring to reading the database. If so,then this question is a repost, see here:
How can I read SMS messages from the device programmatically in Android?
This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
SQLite DB for GWT?
I know how to use SQLite with Android applications but I can't seem to figure out how to get started using SQLite with GWT for use in building a Packaged App for Chrome. What do I need? I've been searching for days and found nothing, so I think I'm off track. Any guidance would be greatly appreciated.
I'd check out gwt-jdbc-html5, since HTML5 now provides built-in SQLite support. There are plenty of other, heavier weight wrappers, but this is the best and easiest I've seen around.