blogjae.blogg.se

Android wear sqlite database example
Android wear sqlite database example











  • On the delete button, we are sending the username which is passed to DBHelper class delete Method.
  • We are using the S1 object to send the user names to other activities.
  • putExtra method is used to send data and key pair with activity to another activity.
  • The intent is used to start or jump to another activity.
  • android wear sqlite database example

  • setOnClickListener will start when we click on Create Button.
  • getItemPosition(i).toString() will return the item selected to String.
  • AdapterView will return the item selected from the dropdown list.
  • android wear sqlite database example

    setOnItemSelectedListener is used to Listen to any changes made in the spinner view.setAdapter is used to assign ArrayAdapter to Spinner View.

    android wear sqlite database example

  • We are populating the Spinner view with user names.
  • ArrayAdapter is used to populate the spinner view with a list of arrays.
  • findViewById is used to connect an object to the view which has an id.
  • getUser() method will insert user names from data object to users object.
  • ArrayList used a dynamic array to store data it’sdata = new ArrayList(db.read()) db.read() will return arraylist object to data object which contain all users info an array with no size defined.
  • The String is basically an object that represents the sequence of char values.
  • Button is used to connect with the button view in the XML.
  • Spinner is a DropDown menu in Android we will use it to display UserNames in this application.
  • android wear sqlite database example

    In this class, we have defined four different types of Objects Spinner, Button, String, and ArrayList.Step1: Getting Started With Android Studio So, let us start with the development.Ĭrud Stands for Create, Read, Update and Delete operation in Sqlite. In this project, we will create an SQLite database and perform read update and delete operations in the database. The database we are using is SQLite that comes with android. The Android SDK that we are going to use here is the set of development tools to develop applications for the android platform. In this article, we will learn how to perform CRUD operations using SQLite in Android.













    Android wear sqlite database example