Download presentation
Presentation is loading. Please wait.
Published byΣελήνη Αλεξάνδρου Modified over 5 years ago
1
ListView A view that shows items in a vertically scrolling list. The items come from the ListAdapter associated with this view. ListAdapter is used to bridge between a ListView and the data that backs the list. ArrayAdapter, BaseAdapter, CursorAdapter
2
RecyclerView The RecyclerView widget is a more advanced and flexible version of ListView. This widget is a container for displaying large data sets that can be scrolled very efficiently by maintaining a limited number of views. To use the RecyclerView widget, you have to specify an adapter and a layout manager. To create an adapter, extend the RecyclerView.Adapter class.
3
ListView Vs RecyclerView
Reuse cells while scrolling up/down - this is possible with implementing View Holder in the listView adapter, but it was an optional thing, while in the RecycleView it's the default way of writing adapter. LayoutManager - In a ListView, the only type of view available is the vertical ListView. There is no official way to even implement a horizontal ListView. In RecyclerView, we can have a LinearLayoutManager , GridLayoutManager. RecyclerView is much more customizable than the ListView and gives a lot of control and power to its developers.
4
SQLite Database SQLiteDatabase has methods to create, delete, execute SQL commands, and perform other common database management tasks. Database names must be unique within an application, not across all applications
5
SQLite Database Methods
Database – Creation SQLiteDatabase db = openOrCreateDatabase(“Your database name”, MODE_PRIVATE, null); Database – Insertion db.execSQL("CREATE TABLE IF NOT EXISTS Note ( " + "_id INTEGER PRIMARY KEY, " + "TITLE TEXT, CONTENT TEXT" + ")"); db.execSQL (“INSERT INTO Note VALUES(“Text”,”Text”);“; Database - Fetching Cursor result = db.rawQuery(“Select * from TutorialsPoint”,null); *Cursor have methods like getColumnCount(),getCount(),moveToFirst(),getColumnIndex(“column name”) ..
6
SQLiteOpenHelper A helper class to manage database creation and version management. You create a subclass implementation onCreate(SQLiteDatabase), onUpgrade(SQLiteDatabase, int, int) and optionally onOpen(SQLiteDatabase), and this class takes care of opening the database if it exits, creating it if it does not, and upgrading it as necessary. Constructor SQLiteOpenHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.