Android Tutorial For Beginners : Android SQLite Database Example Tutorial
In many occasions you will need a way to maintain your application data, which can be later accessed or altered. In that situation you possibly can make use of SQLiteDatabase in your application. Lets check out this in this Android SQLite Database Example of Android Tutorial For Beginners Series.
Take a Look at this Advanced Tutorial on Android SQLite Database using Custom Cursor Adapter ListView
Contact List View
Android SQLite Database : Why SQLite for Android?
SQLite is really a quick and compact android database technology which incorporates SQL syntax to create queries and also handle data.
Android SDK by itself provides the SQLite support which without doubt making the setup as well as utilization process within our applications with no trouble.
Android SQLite Database : Need of SQLiteOpenHelper
Whenever we make use of an Android SQLite Database all of us undoubtedly require the help of SQLiteOpenHelper to handle our data.SQLiteOpenHelper is surely an superb destination to place some initial values right into the android sqlite database when it is built.
The important bits of details, you simply must provide for the android sqlite database
name
version number
At any time when the particular android sqlite database is actually accessed, it is going to take a look at the version number, in case the version number within the storage is not really match up the existing version then the onUpgrade() process will likely be called.
Android SQLite Database : Create Database
Create a database named country with name, cap, code fields and _id field as primary key which is usually auto increment.
public void onCreate(SQLiteDatabase db) { String createQuery = "CREATE TABLE country (_id integer primary key autoincrement,name, cap, code);"; db.execSQL(createQuery); }
Android SQLite Database : Open a Database
public void open() throws SQLException { //open database in reading/writing mode database = dbOpenHelper.getWritableDatabase(); }
Android SQLite Database : Close a Database
public void close() { if (database != null) database.close(); }
Android SQLite Database : Insert Values to Database
Android SQLite Database Example : World Countries Information Book App
World Countries Information Book App – you can create countries by giving its name, capital, telephone code, currency, languages speaking, …
Pressing the actual device’s menu button while looking at a contact’s information shows a menu that contains Edit Country and Delete Country choices.
In case the user selects to modify the particular country item from the android sqlite database, the actual application starts an Activity which displays the existing details within EditTexts.
In case the user makes a decision to delete the particular country item from android sqlite database, a dialog which requires the user to ensure the remove operation.
Touching the device’s menu button when looking at the contact list shows a menu that contains an Add Country item option—touching which option begins an Activity intended for adding a brand new country item to android sqlite database.
Pressing the Save Country Button will save the new country item to our android sqlite database as well as return the user towards the main contact screen which displays the list of country items.
Adding a new Country Item
The country list will likely be empty when you run the application for the very first time. Then If you want to add a new country information press the menu button then the Add menu item.
Once you add the particular country details, then touch the save button to store the country item info in the android sqlite database. Then go back to the application’s main screen.
If you desire to add more country details then you can. Finally Press the back button to return the main screen of the application which displays the all country item details via android sqlite database.
Viewing a Country Item’s Information
By touching the existing country to see the country’s informations.
Android SQLite Database : Editing a Country Item’s Information
While seeing the country item’s detail, you can edit the country item’s details by touching the edit menu item. Then you can save the changes through the save button which insert the values to our android sqlite database.
Deleting a Country Item
While viewing the country item’s details, touch the Delete Country menu item to delete a particular country. Finally confirm this action in the dialog. Then the country item will be removed from the android sqlite database.
Creating Styles for the Country Item
You can write a style.xml file which can define GUI component style attribute. You can then apply these styles to the desire components. If you make changes to the style.xml file then it will be applied to the App GUI components automatically.
The following styles.xml is going to be used in the layout view_country.xml
Here we are going to define a border to the TextView, In android by default TextViews don’t have a border. We can use a drawable as the TextView’s android:background attribute. It can be an image or an XML representation of a shape. You can place these in the drawable folder.
To display the number of contact list items we are going to make use of ListView Item. It can be scrollable if the complete list is too large to be displayed on the screen.
Each menu resource XML file contains a root menu component along with every single MenuItem.
android:title and android:titleCondensed — all these specify the text to show within the MenuItem. In case the title text to display is actually long to show properly you need to use the condensed title.
android:icon — specifies a Drawable to show off within the MenuItem over a title text message. In this particular example’s MenuItems, we make use of three of the icons that I downloaded from the net. They’re found in res/drawable-hdpi folder.
android:alphabeticShortcut — specifies a shortcut letter which the user can certainly press to choose the actual menu item.
android:orderInCategory — Specifies the MenuItems actual order to show up.
World Countries Android SQlite Database Connector Class
Android SqliteDatabase names needs to be unique inside a particular application however do not need to be unique throughout apps. A SQLiteDatabase object offers read/write access to a Android SQLite database. DatabaseConnection’s constructor provides an impressive new object of class DatabaseOpenHelper, which is to be helpful to open up or even create the android sqlite database.
DatabaseConnector.java
package com.example.worldcountrybook;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
public class DatabaseConnector {
private static final String DB_NAME = "WorldCountries";
private SQLiteDatabase database;
private DatabaseOpenHelper dbOpenHelper;
public DatabaseConnector(Context context) {
dbOpenHelper = new DatabaseOpenHelper(context, DB_NAME, null, 1);
}
public void open() throws SQLException
{
//open database in reading/writing mode
database = dbOpenHelper.getWritableDatabase();
}
public void close()
{
if (database != null)
database.close();
}
Method insertContact inserts a brand new contact with the actual provided details inside the android sqlite database. We initially place each and every bit of contact information right into a new ContentValues object, which usually keeps a map of key–value pairs—the android sqlite database’s column names are definitely the keys. After that open up the android sqlite database, insert the brand new contact and even close the actual android sqlite database.
Method updateContact is identical to method insertContact, except that it calls Android SQLite Database’s update method to update an existing contact.
Method getAllContacts makes use of Android SqLite Database’s query method in order to obtain a Cursor which gives you access to the IDs and also names of all of the contacts within the android sqlite database table.
The Cursor returned through method query consists of all of the table rows which match the actual method’s arguments—the so-called result set. The actual Cursor lies prior to the very first row of the result set—Cursor’s various move methods enables you to move the Cursor with the result set with regard to processing.
Method getOneContact additionally uses SqLiteDatabase’s query strategy to query the database. In cases like this, all of us retrieve all of the columns within the android sqlite database for the contact with the desired ID.
Method deleteContact makes use of SqLiteDatabase’s delete approach to delete any contact from the android sqlite database.
<resources>
<string name="app_name">World Country Book
<string name="menu_settings">Settings
<string name="title">World Country Book
<string name="button_add_contact">Add Country
<string name="save_btn">Save Country
<string name="add_menu">Add Country
<string name="edit_menu">Edit Country
<string name="delete_menu">Delete Country
<string name="name_hint">Country
<string name="cap_hint">Capital
<string name="code_hint">Code
<string name="name_lbl">Country
<string name="cap_lbl">Capital
<string name="code_lbl">Code
<string name="confirmTitle">Are You Sure?
<string name="confirmMessage">This will permanently Delete the Entry
<string name="errorButton">OK
<string name="errorTitle">Country Name is Required
<string name="errorMessage">You Need to Enter Country Name
<string name="cancel_btn">Cancel
<string name="delete_btn">Delete
</resources>
Finally we have learnt how to use SQLite and Built application using SQLite database in android through this Android SQLite Database Tutorial Example of Android Tutorial For Beginners Series.
Take a Look at this Advanced Tutorial on Android SQLite Database using Custom Cursor Adapter ListView
@VimalRick Thanks for the tutorial, it really helps. But there are things that i don’t understand why do you need to use Async to save the countries if i understand the code correctly.
And please sir send me the project. Thanks in advance
@Override public void onClick (View v){ if (v == signup) { Intent addContact = new Intent(UserList.this, AddEditUser.class); startActivity(addContact); }
conListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView arg0, View arg1, int arg2, long arg3) {
i am trying to download source code but i cant. it always shows advertisement whenever i clicked on. and i tried to go along with your code but it is not successfully giving output without any error. i tried to figure it out but not success ed. can you pls mail me full source code. it could help me.. my email id is : oct29shweta@gmail.com
i am trying to download source code but i cant. it always shows advertisement whenever i clicked on. would you please send me the full source code my email id is : namrata.swity@gmail.com
i am trying to download source code but i cant. it always shows advertisement whenever i clicked on. would you please send me the full source code as soon as possible. Please! my email id is : abhiporval@gmail.com
Hai Swapnil, I have also updated it in my post. And tell me whether you can download the code or not. If you can download the code, then you can find it inside the res/layout folder.
Thank you for your comment Vivek, I have updated the Code now. Please do download the updated project file. If any issues you can inform me. Keep visiting my blog
hi vimal i just download your project .in that oly 3 edittext feild is thr,if i add 4th one it take it.when add 5th it seems error .it say no string refrence database connector but i add string thr .please help me vimal by anand. if u found mail to anandkiot@gmail.com.ex.i need to add 6 edittext in that .if u can means help me . i am in helpless position
right click the project folder select properties–>select Android from the left portion of the window. Now you will see a list of available platform. Select your desire platform ex:android 2.2 and click apply and ok.
Now you will see android2.2 jar inside your project folder below gen folder.
Thank you. But I have another problem, when I run your code, only a black blank screen appears. I tried to change the theme but nothing happened. Sorry, I’m still new with android programming and I don’t know the things to debug.
Sorry man, You need to press menu button. “Menu” button can be found in right side of your emulator. Or simply press F2 from your keyboard. Then “Add Country” Menu will be shown. From there you can proceed.
you using 3 edit text but i need to use 6 . i can create string in databaseconnector class and create database table in that class .but it seems error. i need to u r help
hey hi , can u please send me the link from where i can download this project ,for some reason , i cannot find the download link ,it would be a great thanks in advance
conAdapter = new SimpleCursorAdapter(CountryList.this, R.layout.country_list, null, from, to); SimpleCursorAdapter is deprecated, what is the alternative?
hai VimalRick, i am beginner of Android Applications development, So i developed one application useing Sqlite database for android app and i created a App file Like(Example.apk). And i install Android Tab App it’s runing fine then when i useing databse it’s not working, where i did mistake let me know plz…. it’s throwing Exception like (Application unfortunately stopped )
Hi I was just wondering how to add more than one table in the database using DBOpenhelper. I’m actually writing an app with same kind of your sample app ,but with 3 more options.I want to navigate the page according to the user choice.But I find it really hard and the menu doesn’t seem working when I add more than one item in the menu .Can you please help me with this.
I want to know more about How to fetch particular values of record from SQL databse stored on server and update that values in SQLite database of android?
i need ur help vimalRick i edit ur code and add imageview field but is not save iamge in database i modify ur code to add button which browse and take image from gellry and upload in database what is wrong in my code ? i posy my question also on stack overflow no one answer me please help me what do i do??
this is my code url which i post on stackover flow plz tel me how do i add image field in ur code? s o its browse and load image and save and retrieve from database give me ur email address so i can mail u my project
OK, I have already prepared a Tutorial on that. But it will took some more days to post, as I am developing some other students college projects. Any way I have sent you the code to your mail.
Like my Fanbook page. And add me to your google Circle.
hi vimal i couldnt understand how row_id taken when clicking the listview i understand how u pass the row_id from Country_List to View_country but how you get that row_id synchronous with databse id and listview id could u help me please Thanks a lot for your help and Magnificent Tutorial
OnItemClickListener viewConListener = new OnItemClickListener() { public void onItemClick(AdapterView arg0, View arg1, int arg2,long arg3) { Intent viewCon = new Intent(CountryList.this, ViewCountry.class); viewCon.putExtra(ROW_ID, arg3); startActivity(viewCon); } };
public void onItemClick(AdapterView arg0, View arg1, int arg2,long arg3)
Below you can see the more clear form of the above method.
public void onItemClick (AdapterView< ?> parent, View view, int position, long id)
parent ==> The AdapterView where the click happened.
view ==> The view within the AdapterView that was clicked
position==> The position of the view in the adapter.
id ==> The row id of the item that was clicked.
So here, you know, we want to pass the row position of the clicked item in the listview. I assigned a id to a String called ROW_ID. You can see at the beginning of this class, I have created this String variable. and pass to the next activity.
and how to display a Country with the same key world ? for example insead of displaying all countries it will display countries with the same world ? , key_world = United and it will display : United Arab Emirates United Kingdom United States of America etc etc
Please send me the full script for SQLiteOpenHelper class. I’m having trouble in naming the database = dbOpenHelper.getWritableDatabase(); It says that I have to create another class for database.
Nice code for sqlite database and also working correctly. i have some doubt, how to display this three values in list view like multiple column row listview not only single value. for example. Country Capital code India delhi 91
so please tell me how to create else give me code if already you created this code.
This is so very nice tutorial. You know what dude! I’m using it for my thesis project, You are a life saver. This Codes and Idea’s are so useful. Can I request? Can you post a 2-3 tables with relationship? Our thesis compose with 3 tables. Can you set an example? It is my honor to grant my request. More power to you dude.
Sir, I am very beginner in android I use Eclipse Galileo version. I have run some basic application in android now i want run database application using SQLite. I have try to run your provided Android SQLite Database Example code but it cant run why I dont know following are the 36 error occur during run so sir please help me how I can run this program because using this database program. I understand & implement my 8th semester android project so sir please help me.
Sir, I am very beginner in android I use Eclipse Galileo version. I have run some basic application in android now i want run database application using SQLite. I have try to download & run your provided Android SQLite Database Example code but it cant run why I dont know following are the error occur during run so sir please help me how I can run this program because using this database program. I understand & implement my 8th semester android project so sir please help me.
The errors are
Description Resource Path Location Type The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project WorldCountriesBooks Unknown Java Problem The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files ViewCountry.java /WorldCountriesBooks/src/com/example/worldcountriesbooks line 1 Java Problem Unable to resolve target ‘android-16′ WorldCountriesBooks Unknown Android Target Problem
Thanks for such nice example. When i try to download the source code, it is showing some add. could you send me the code to this id mpadmapriya89@gmail.com.
i am trying to download source code but i cant. it always shows advertisement whenever i clicked on. would you please send me the full source code as soon as possible. Please! my email id is : abhiporval@gmail.com
hi vimal i just send u a note via my wifes fb site regarding one thing about your database sample i like to add an image into the listview for each item – could u please reply with an idea how it will be done like a flag for the 3 samples (germany, india and malaysia). i changed the xml file and some code cause to compare the listview countrynames with a given word – but i stucked now for a couple of weeks. my e-mail adress is info@cargoonhand.com
hope u have a few minutes to i have a eye on my problem
i get error in ViewCountry.java. in line where i use Async. The error in The type new AsyncTask(){} must implement the inherited abstract method AsyncTask.doInBackground(Object…). So plz help me in resolve this error
Good tutorial. But however I found a little issue(it might not be an issue for others). When I press a delete button on the list item. It gives another activity as it started the same activity through intent in the delete contact method. Suppose if I press delete button on three items of the listview, it back stacks 3 activities. Can you please suggest how to avoid this?
Hello sir, in my project there are three classes Fist class is DatabaseHelper class Second Class is UserImage class (user image id (PK) ,user image name) Thrid Class is User class ( user id(PK) ,user name , user image id (FK) There is a relationship between second and third class When I called them in DatabaseHelper Class , two choices (Create field or create constant) are shown on DatabaseHelper page . I couldn’t this part please help me my mail address is deryaaltinoklar@gmail.com
hi vimal. this is awesome tutorial. i am a newbie in android and m working currently in a project using database. please can you send me the source code. it will of great help. this is great stuff. like it. my mail id is iyerkrtk@gmail.com please send me at earliest.
hi vimal. this is cool tutorial. i am a new in android and m working currently in a project using database. please can you send me the source code. it will of great help. this is great stuff. mail id:mangalpsingh@yahoo.com.plz as soon as possible
Great tutorial on Android and SQLite on the web.
@VimalRick
Thanks for the tutorial, it really helps. But there are things that i don’t understand why do you need to use Async to save the countries if i understand the code correctly.
And please sir send me the project. Thanks in advance
Good Work …Keep it up!
Thanks, keep visiting.
Coming in two days — Developing Web Apps
hi. What if I won’t be using the menu? What if I would only use button for add country? I get really confused and stuck. Thank you.
Yes, you can use button. Just place the code to the onclick listener of the respective button.
I couldn’t understand the onitemlistemer part when convert it to button… It keeps on giving debug error, who do I do this?
I don’t know what’s wrong with this,
@Override
public void onClick (View v){
if (v == signup)
{
Intent addContact = new Intent(UserList.this, AddEditUser.class);
startActivity(addContact);
}
conListView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView arg0, View arg1, int arg2,
long arg3) {
Intent viewCon = new Intent(UserList.this, ViewUser.class);
viewCon.putExtra(ROW_ID, arg3);
startActivity(viewCon);
} });
hi vimal..
i am trying to download source code but i cant. it always shows advertisement whenever i clicked on.
and i tried to go along with your code but it is not successfully giving output without any error. i tried to figure it out but not success ed.
can you pls mail me full source code. it could help me..
my email id is : oct29shweta@gmail.com
thank you very much , you are a life saver man keep it up , nice work
hi vimal,
i am trying to download source code but i cant. it always shows advertisement whenever i clicked on.
would you please send me the full source code
my email id is : namrata.swity@gmail.com
Hi Swity,
I have mailed you.
Feel free to ask any doubts
hello! vimal. Thank you for the tutorial, send me a source! Thank you! My gmail yongjinquanli@gmail.com.
hi vimal,
i am trying to download source code but i cant. it always shows advertisement whenever i clicked on.
would you please send me the full source code as soon as possible. Please!
my email id is : abhiporval@gmail.com
hello! vimal. Thank you for the tutorial, send me a source! Thank you! My gmail yongjinquanli@gmail.com.
can u send me view_country.xml file
Hai Swapnil, I have also updated it in my post. And tell me whether you can download the code or not. If you can download the code, then you can find it inside the res/layout folder.
view_country.xml
——————-
< ?xml version="1.0" encoding="utf-8"?>
android:layout_height="wrap_content"
android:stretchColumns="1"
android:layout_margin="5dp">
great tutorial but the example requires htc open sense sdk library .
please make it universal
Thank you for your comment Vivek, I have updated the Code now.
Please do download the updated project file.
If any issues you can inform me.
Keep visiting my blog
hi vimal i just download your project .in that oly 3 edittext feild is thr,if i add 4th one it take it.when add 5th it seems error .it say no string refrence database connector but i add string thr .please help me vimal by anand. if u found mail to anandkiot@gmail.com.ex.i need to add 6 edittext in that .if u can means help me . i am in helpless position
Hi. It can only be used in android 4.1 (API 16), how can I use this to android 2.2?
right click the project folder
select properties–>select Android from the left portion of the window.
Now you will see a list of available platform.
Select your desire platform ex:android 2.2 and click apply and ok.
Now you will see android2.2 jar inside your project folder below gen folder.
Thank you. But I have another problem, when I run your code, only a black blank screen appears. I tried to change the theme but nothing happened. Sorry, I’m still new with android programming and I don’t know the things to debug.
Sorry man,
You need to press menu button. “Menu” button can be found in right side of your emulator.
Or simply press F2 from your keyboard.
Then “Add Country” Menu will be shown. From there you can proceed.
you using 3 edit text but i need to use 6 . i can create string in databaseconnector class and create database table in that class .but it seems error. i need to u r help
Very useful. Finding good tutorial of data binding with list view is difficult.
hey hi , can u please send me the link from where i can download this project ,for some reason , i cannot find the download link ,it would be a great thanks in advance
please ,can you have some idea about to open a project..
Thanks for tutorial….
conAdapter = new SimpleCursorAdapter(CountryList.this, R.layout.country_list, null, from, to);
SimpleCursorAdapter is deprecated, what is the alternative?
Thanks! I fuckin’ love you!!!
hai VimalRick, i am beginner of Android Applications development, So i developed one application useing Sqlite database for android app and i created a App file Like(Example.apk). And i install Android Tab App it’s runing fine then when i useing databse it’s not working, where i did mistake let me know plz…. it’s throwing Exception like (Application unfortunately stopped )
Hi I was just wondering how to add more than one table in the database using DBOpenhelper.
I’m actually writing an app with same kind of your sample app ,but with 3 more options.I want to navigate the page according to the user choice.But I find it really hard and the menu doesn’t seem working when I add more than one item in the menu .Can you please help me with this.
Yeah sure, send me your project to vimalrick@gmail.com
@VimalRick
At first I want thanks for such a nice tutorial with clear picture showing interaction between android and Sqlite database, It helped me a lot.
But How can display the Country_List using Spinner drop down and respected textViews should be updated depending upon the country selected……
Thanks you in advance…..
I send your project to your mail.
Hi Vimal,
Please send me the the full scorce code of Android SQLite Database. i am getting a problem during download………….
Thank you……..
send me on d.nayak30@gmail.com
I have mailed you.
hi..
am getting an error while downloading the source code can uplz send to vadluri.ashok@gmail.com
Plz am waiting for u r reply
thank u
I didn’t got your mail yet waiting for your response……Thanks
Thanks I got your mail …….
I want to know more about How to fetch particular values of record from SQL databse stored on server and update that values in SQLite database of android?
VimalRick
i am gone need your help with my project
Ha Ha, Sure Rob, Send me more details.
Please send me the code of Android SQLite Database Example Tutorial i am getting a problem during download………….
Thank you……..
send me on sagarmane100@gmail.com
I have sent you email.
But For me the download is working correctly.
Feel Free To ask me any doubts.
Please send me the code of Android SQLite Database Example Tutorial i am getting a problem during download………….
Thank you……..
plz send to vadluri.ashok@gmail.com
Plz am waiting for u r reply
i found exact that what i need thanks for this great example and keep it up
code iws not download is show advertise and say download iLivid what is that? please sendme code on my email farhankhan0987@hotmail.com
I have Sent you.
Feel Free to mail me if any doubts.
Dear VimalRick can you sand me this full project od email: kapetanmikula@yahoo.com ??
Thank you
i need ur help vimalRick i edit ur code and add imageview field but is not save iamge in database i modify ur code to add button which browse and take image from gellry and upload in database what is wrong in my code ? i posy my question also on stack overflow no one answer me please help me what do i do??
http://stackoverflow.com/questions/13879011/please-tell-me-how-do-i-add-image-view-field-ins-qllite-database
this is my code url which i post on stackover flow plz tel me how do i add image field in ur code? s o its browse and load image and save and retrieve from database give me ur email address so i can mail u my project
Its very easy my friend. By the way send me the project to my mail. I will solve your problem.
And also I will surely post a tutorial on that.
i sent u my code plz check it
great tutorial…..please tell me how to store image …along with it like country flag
OK, I have already prepared a Tutorial on that. But it will took some more days to post, as I am developing some other students college projects. Any way I have sent you the code to your mail.
Like my Fanbook page. And add me to your google Circle.
I can chat with you, and will help you further.
hi vimal
i couldnt understand how row_id taken when clicking the listview
i understand how u pass the row_id from Country_List to View_country
but how you get that row_id synchronous with databse id and listview id
could u help me please
Thanks a lot for your help and Magnificent Tutorial
OnItemClickListener viewConListener = new OnItemClickListener()
{
public void onItemClick(AdapterView arg0, View arg1, int arg2,long arg3)
{
Intent viewCon = new Intent(CountryList.this, ViewCountry.class);
viewCon.putExtra(ROW_ID, arg3);
startActivity(viewCon);
}
};
public void onItemClick(AdapterView arg0, View arg1, int arg2,long arg3)
Below you can see the more clear form of the above method.
public void onItemClick (AdapterView< ?> parent, View view, int position, long id)
parent ==> The AdapterView where the click happened.
view ==> The view within the AdapterView that was clicked
position==> The position of the view in the adapter.
id ==> The row id of the item that was clicked.
So here, you know, we want to pass the row position of the clicked item in the listview.
I assigned a id to a String called ROW_ID. You can see at the beginning of this class, I have created this String variable.
and pass to the next activity.
Sir i want sqlite create ,view and updata source code,please send code on swarup.gosavi@gmail.com
I have Sent it
thank for email…..while saving country without loading image giving an error
well i used Boolean to overcome that…help me search function i am not able get search function work
Please can u post an example on SQL Lite Database using Foreign Keys in Android.. Thank You In Advance..
How to display more information from table ? not only Country name in this Country list ?
and how to read information not only from TextBoxes but also from spinners and time/date pickers ?
and how to display a Country with the same key world ? for example insead of displaying all countries it will display countries with the same world ? , key_world = United and it will display :
United Arab Emirates
United Kingdom
United States of America etc etc
Hi,
Please send me the full script for SQLiteOpenHelper class. I’m having trouble in naming the database = dbOpenHelper.getWritableDatabase();
It says that I have to create another class for database.
I cant download.. Its lock
After clicking either fb like (or) g+, the download button will be available.
Tried downloading code but advertisement showing up. can you send your code to me? norsk102@gmail.com
I find it’s great, dear.
Please, send your code to me
annv1990@gmail.com
I have sent
Hi Vimal,
Nice code for sqlite database and also working correctly. i have some doubt, how to display this three values in list view like multiple column row listview not only single value.
for example.
Country Capital code
India delhi 91
so please tell me how to create else give me code if already you created this code.
I have a some doubt about this example, so please send me your mail id.
This is so very nice tutorial. You know what dude! I’m using it for my thesis project, You are a life saver. This Codes and Idea’s are so useful. Can I request? Can you post a 2-3 tables with relationship? Our thesis compose with 3 tables. Can you set an example? It is my honor to grant my request. More power to you dude.
Thanks, I am glad that my post is useful to you. And about the requested project, I have mailed you.
Sir,
I am very beginner in android I use Eclipse Galileo version. I have run some basic application in android now i want run database application using SQLite. I have try to run your provided Android SQLite Database Example code but it cant run why I dont know following are the 36 error occur during run so sir please help me how I can run this program because using this database program. I understand & implement my 8th semester android project so sir please help me.
Sir,
I am very beginner in android I use Eclipse Galileo version. I have run some basic application in android now i want run database application using SQLite. I have try to download & run your provided Android SQLite Database Example code but it cant run why I dont know following are the error occur during run so sir please help me how I can run this program because using this database program. I understand & implement my 8th semester android project so sir please help me.
The errors are
Description Resource Path Location Type
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project WorldCountriesBooks Unknown Java Problem
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files ViewCountry.java /WorldCountriesBooks/src/com/example/worldcountriesbooks line 1 Java Problem
Unable to resolve target ‘android-16′ WorldCountriesBooks Unknown Android Target Problem
Hi vimal,
Thanks for such nice example. When i try to download the source code, it is showing some add. could you send me the code to this id mpadmapriya89@gmail.com.
Very nice work. Please send me the project.
Like my FB Fanpage it will help my site reach better.
hi vimal,
i am trying to download source code but i cant. it always shows advertisement whenever i clicked on.
would you please send me the full source code as soon as possible. Please!
my email id is : abhiporval@gmail.com
Please ! sent to me your project.
My email: minhlanhat@gmail.com
hi vimal
i just send u a note via my wifes fb site regarding one thing about your database sample
i like to add an image into the listview for each item – could u please reply with an idea how it will be done like a flag for the 3 samples (germany, india and malaysia).
i changed the xml file and some code cause to compare the listview countrynames with a given word – but i stucked now for a couple of weeks. my e-mail adress is info@cargoonhand.com
hope u have a few minutes to i have a eye on my problem
it is a bit tricky for all beginners, I have sent you to your mail.
Hey dude, thanks for the post. unable to get your source code, can u email it to pars_root@hotmail.co.uk
thanks in advance!
Hello sir,
i get error in ViewCountry.java. in line where i use Async. The error in The type new AsyncTask(){} must implement the inherited abstract method AsyncTask.doInBackground(Object…). So plz help me in resolve this error
Thank you
Vikram Raj
sir i am unable to download database code of country….plz send me.dat codes
on my email id…himanshukr403@gmail.come
how to know the speed of distant vehicle using android mobile?????????????
Hi vimal,
I want the entire project coding,could u send me that coding to my mail id:anwar.res@gmail.com
Good tutorial. But however I found a little issue(it might not be an issue for others). When I press a delete button on the list item. It gives another activity as it started the same activity through intent in the delete contact method. Suppose if I press delete button on three items of the listview, it back stacks 3 activities. Can you please suggest how to avoid this?
Hello sir,
in my project there are three classes
Fist class is DatabaseHelper class
Second Class is UserImage class (user image id (PK) ,user image name)
Thrid Class is User class ( user id(PK) ,user name , user image id (FK)
There is a relationship between second and third class
When I called them in DatabaseHelper Class , two choices (Create field or create constant) are shown on DatabaseHelper page . I couldn’t this part please help me my mail address is deryaaltinoklar@gmail.com
hi vimal. this is awesome tutorial. i am a newbie in android and m working currently in a project using database. please can you send me the source code. it will of great help. this is great stuff. like it. my mail id is iyerkrtk@gmail.com please send me at earliest.
thanks and regards..
Hi vimal,
hi vimal.
this is cool tutorial. i am a new in android and m working currently in a project using database. please can you send me the source code. it will of great help. this is great stuff. mail id:mangalpsingh@yahoo.com.plz as soon as possible
Hello, sir!
i cannot download the code
could you please send me a code?
I put like and add the google also!
My email is
raulhurj@gmail.com
Thanks in advance!!
Thanks for the tutorial, it really helps.
Can send me the project code?
Email: luvclssam@yahoo.com
Thanks in advance
great tutorial!!!!!!!!!!, but im stuck at SQLiteDatabase.jave.. can u email me full coding? zazsvs_ok2@yahoo.com