work with database in android? - android

I wish to use database for my application.How to use the database in android.I use eclipse ide.Is there any requirements need for create database.Give some basic ideas about it.I am android beginner.Help me to know about it.

Since this question is worded almost exactly like how to use database in android? I would say you created a duplicate question. if not, see that question. If you need more, supply the info you would like to the initial answerers.

I think you should see Notepad sample project. There are a lot of common android practices there including database stuff.

Related

How to add more pages to android app?

I am a bit confused as I am new to android development. Let me put a scenario:
My app has 2 activities
SQL Lite DB related
List view
How should I use Android studio to combine both of the above? I cannot find a conclusive answer on the internet so that's why I am asking all the professionals out there.
Are you looking to have both in one page? In that case I would consider using Fragments, in which multiple to could housed into one activity and can run there. Could you elaborate more on what you are trying to do?
If you want to connect a ListView to some SQL database, there are many ways you can display that, but it depends on how the database is laid out.

Graphs/Charts in Android

I'm a beginner in android application development. I got a requirement where I have to show some statistics in the form of graphs/charts. I would like to if there is any API as such which would suffice this requirement in android. Else, I would like to the means the other best means that would make this easy. I referred other questions regarding this, but I'm unable to decide basing on them. Help needed as soon as possible.
This is good , easy to use and if You have problem PhilJay or someone else will help you on stack:
https://github.com/PhilJay/MPAndroidChart

Android SQLite Best Practice Advice

This might be a bit cheeky but I would like some advice. I'm new to Android and have started to create my first app. I'm coming to the section where I need to create an SQLite DB with multiple tables and have been looking for best practices but have been unable to find my answer, this helped a little but not a lot What are the best practices for SQLite on Android?. I need about 6 tables in total.
Should I use one "constants" class to keep all of my table names, field names and database name in?
Should I create one "DBHelper" class to run all my SQL SELECT, UPDATE, DELETE in or create one per table?
Any other advice around best practices around maintaining the data or any other classes I need?
Bonus question :) If any one has any good examples they could point me towards as the Android documentation example is not in depth enough.
It's appreciated, I'm thinking about creating a blog with some simple examples for newbies to use as some of what I have read is a bit complex for small brains like mine.
I found this which answers what I'm looking for. Not sure how I didn't find this before with all the searching! Thanks for all your help guys/girls!
Multiple Table SQLite DB Adapter(s) in Android?

Where to find Android Development Homework Problems

Ok so I am starting off with android development and I have found a bunch of useful tutorials so I am set there. What I am looking for is a resource that provides homework style problems to do and has the answers downloadable so I can check my solution against the "official" solution.
So for example instead of the notepad tutorial it would be: "Build an application that you can create, edit, delete notes, ...etc.". Ideally the "official" solution would have some explanation as to why they built it the way they did. (so a tutorial at the tail end)
Anyone know of any resources that provide their tutorials in this format?
Thanks.
Okay, here's one: build me an app that allows the user to make, modify, and store notes. The 'official' answer is the Notepad app in the 9th level of the api. (Note that this is different from the notepad tutorial).
The point is that asking questions is easy, the harder part is actually making a program that does the job. And #Roflecoptr is right, at this level it can be implemented very differently. But if you want that mindset, you can write your own 'homework' easily. Just think up a few things you want that are simple, build it, does it do what you want well? Then you pass.
Despite for very trivial problems I dont think this is possible, because there are way to much possible implementation possibilites so that you can't compare your solution to the "official" solution.
But why do you need something like that? If you want to learn to program on Android, you can just follow some tutorials you've already found and then modify them, adapt them to your needs. When you get more used to the development of Android apps you can just get some ideas on tutorials/android development sites and then implement your own solution. There is plenty of help available here on SO and on other development sites, which will help you if you really get stuck.
You could always go to the Android Samples page, and without looking at their implementations, do your own and compare. The samples page is here:
http://developer.android.com/resources/samples/index.html

How to insert rows/info into Android SQL DB with EditText and Buttons?

im working on a simple Android app, it is much like any other simple Database app. I have 4 EditText fields where the user inputs 4 different small pieces of text. I want this text to be inserted in to my Database table in the corrects rows for my columns. I am not really sure how to go about doing this. I know onClickListener needs to be used but not sure how to use it.
What you are looking for is the glue to make it work, as you have a storage ( your database ) and the user interface. But, as you pointed out just right, your onClick actions, or more widely spoken, your whole user-interaction needs to be filled with action.
I won't give you a specific advice here as I think you should read a bit about the Model-View-Controller Pattern here, as well as about how Android handles all that stuff. A good entrypoint for gaining knowledge is, as always, Wikipedia.
Don't get me wrong, I don't mean to offend you by not answering the specific question: I just think it's more valuable for you to first learn the basics required for building great apps instead of reading a step-by-step manual!
On my phone right now, but you are correct about setting up an onClick method for, let's just say, a Submit button.
I would look at the Developers Guide on the SQLiteDatabase on ways to insert values by executing a SQL statement or check into using ContentValues to insert values when the button's pressed, both could help you out.
Also, with a fair share of knowledge on databases the Developer Guide should be all you need, but if you need further help search for related questions.
NOTE
A good practice is getting used to debugging your code using LogCat. It helps when things go astray, especially when working with databases.
Tne Notepad Tutorial in the Android Developer Documentation takes you through creating an application which stores data from fields in an SQLite database.
You could work through this, or if you didn't want to do that it would be a good source of sample code.

Categories

Resources