SlideShare a Scribd company logo
GridView
flutterjunction.com
GridView
GridView is a view group that display items in two dimensional scrolling grid
(rows and columns).
Items are inserted into this grid layout from a database or from an array.
The ListView and GridView are subclasses of AdapterView and they can be
populated by binding them to an Adapter, which retrieves data from an external
source and creates a View that represents each data entry.
flutterjunction.com
Key Methods of GridView
flutterjunction.com
setAdapter(Adapter adapter)
Binds the data source (like an ArrayAdapter or custom adapter) to the
GridView.
gridView.setAdapter(adapter)
setNumColumns(int numColumns)
Sets the number of columns in the GridView.
gridView.setNumColumns(3);
Key Methods of GridView
flutterjunction.com
setOnItemClickListener(OnItemClickListener listener)
Handles item click events in the GridView.
gridView.setOnItemClickListener(listener);
getAdapter()
Returns the adapter currently associated with the GridView.
Adapter adapter = gridView.getAdapter();
Key Methods of GridView
flutterjunction.com
getSelectedItem()
Returns the item that is currently selected.
Object item = gridView.getSelectedItem();
GridView
flutterjunction.com
Create Grid view
GridView
flutterjunction.com
Features
Flexible Grid Layout:
GridView provides a structured grid layout that allows developers to organize
data into rows and columns. The number of columns can be dynamically
adjusted.
Automatic Data Binding:
With the help of adapters (like ArrayAdapter, BaseAdapter, or custom adapters),
GridView automatically binds and displays data from various sources (arrays,
lists, databases, etc.).
GridView
flutterjunction.com
Features
Customizable Grid Items
Each cell in the grid can be customized using custom layouts, allowing for rich
content such as images, text, and interactive UI components.
Scrollable Grid:
GridView is inherently scrollable both vertically and horizontally, making it ideal
for large data sets that require scrolling.
GridView
flutterjunction.com
Features
Efficient Item Reuse
GridView efficiently reuses item views with the ViewHolder pattern, improving
performance and memory management when displaying large amounts of data.
Responsive Layout Control
Developers can control spacing between grid items, padding, alignment, and the
number of columns to make the grid adaptive across various screen sizes and
orientations.
RecyclerView
flutterjunction.com
RecyclerView
flutterjunction.com
RecyclerView is an advanced, flexible version of ListView and GridView, used to
efficiently display large datasets by recycling item views.
Why Use RecyclerView?
More flexible compared to ListView and GridView.
Supports different layout managers (Linear, Grid, Staggered).
Efficient memory usage with view recycling.
Components of RecyclerView
flutterjunction.com
RecyclerView:
The view that contains and displays a list of items.
LayoutManager:
Manages how items are arranged. Types include:
LinearLayoutManager (vertical/horizontal list)
GridLayoutManager (grid format)
StaggeredGridLayoutManager (grid with uneven rows/columns)
Components of RecyclerView
flutterjunction.com
Adapter
Binds data to RecyclerView and creates ViewHolders.
ViewHolder
Holds references to item views and caches them for reuse, improving
performance.
Methods in RecyclerView
flutterjunction.com
setLayoutManager(LayoutManager layoutManager)
Sets the layout manager (Linear, Grid, etc.) for arranging items.
setAdapter(Adapter adapter)
Binds the adapter to RecyclerView to manage and display data.
onCreateViewHolder(ViewGroup parent, int viewType)
Inflates the item layout and returns a new ViewHolder instance.
Methods in RecyclerView
flutterjunction.com
onBindViewHolder(ViewHolder holder, int position)
Binds data to each item in the ViewHolder based on the position.
getItemCount()
Returns the total number of items in the dataset.
RecyclerView
flutterjunction.com
Additional Uses of RecyclerView
Efficient item recycling with the ViewHolder pattern.
Supports multiple layout managers.
Built-in animations for item changes (add, remove, move).
Easy implementation of complex lists (grids, staggered layouts).
More control over item layout, interaction, and decoration.
RecyclerView
flutterjunction.com
When to Use RecyclerView?
Scrollable Lists: Chat apps, social feeds.
Grids: Photo galleries, e-commerce product listings.
Staggered Grids: Pinterest-style layouts.
Complex Lists: Custom, interactive lists with varied item types.
SQLite
flutterjunction.com
Introduction to SQLite
flutterjunction.com
It is an open-source database provided in Android.
Lightweight, embedded database engine. So, there is no need to perform any
database setup or administration task.
Local storage solution for Android applications.
Stores data in tables with rows and columns.
The SQLite database is lazily initialized. This means that it isn't actually created
until it's first accessed through a call to getReadableDatabase() or
getWriteableDatabase(). This also means that any methods that call
getReadableDatabase() or getWriteableDatabase() should be done on a
background thread as there is a possibility that they might be kicking off the
initial creation of the database.
Establishing Connection
flutterjunction.com
A helper class to manage database creation and version management.
Requires overriding onCreate() and onUpgrade() methods.
SQLite database will be used across your entire application; within services,
applications, fragments, and more.
For this reason, best practices often advise you to apply the singleton pattern
to your SQLiteOpenHelper instances to avoid memory leaks and unnecessary
reallocations.
The best solution is to make your database instance a singleton instance across
the entire application's lifecycle.
SQLiteOpenHelper Class
Establishing Connection
flutterjunction.com
Establishing Connection
flutterjunction.com
Creating Instance
Creating Database and Tables
flutterjunction.com
Data Manipulation
flutterjunction.com
Inserting Data
Data Manipulation
flutterjunction.com
Reading Data
Use query() method or raw SQL queries.
Data Manipulation
flutterjunction.com
Updating Data
Data Manipulation
flutterjunction.com
Deleting Data
Data Manipulation
flutterjunction.com
Keep In Mind
Use try-finally to ensure database resources are closed.
Keep database interactions on a background thread to avoid blocking the UI.
Use Singleton pattern for SQLiteOpenHelper to manage a single database
instance.
API
flutterjunction.com
flutterjunction.com
Stands for Application Programming Interface.
Set of rules and protocols for building and interacting with software
applications.
Enables different software systems to communicate with each other.
API
flutterjunction.com
Facilitates integration between different systems and services.
Allows access to remote data and functionality.
Encourages modular and reusable code.
Why Use APIs?
flutterjunction.com
Web API architecture style.
Uses standard HTTP methods: GET, POST, PUT, DELETE.
Data often exchanged in JSON or XML format.
Types of API
REST (Representational State Transfer)
flutterjunction.com
Protocol for exchanging structured information.
XML-based messaging protocol.
Requires strict standards and more overhead.
Types of API
SOAP (Simple Object Access Protocol)
flutterjunction.com
Query language for APIs.
Allows clients to request only the data they need.
More flexible than REST but requires a different setup.
Types of API
GraphQL
flutterjunction.com
Stands for JavaScript Object Notation.
Lightweight data-interchange format.
Easy for humans to read and write, and easy for machines to parse and
generate.
Consists of key-value pairs.
Supports data types like strings, numbers, objects, arrays, booleans, and null.
Introduction to JSON
flutterjunction.com
JSON Example
flutterjunction.com
Retrieving
Contents from
Remote Server
Making an HTTP GET Request
flutterjunction.com
Retrieving Contents from Remote Server
Parsing JSON Response
flutterjunction.com
Sending Contents
to Remote Server
Making an HTTP POST Request
Thank you
flutterjunction.com

More Related Content

PDF
Soal Bahasa Inggris Label, Procedure Text
DOCX
Soal ipa kelas viii bab 1 pertumbuhan dan perkembangan
PDF
Kelas1 Sd Pkn Bangga Menjadi Insan Pancasila Sarjan
PDF
SOAL IPA SD OSN 2016
PPT
Hello Android
PPTX
PPT
Web Oriented Architecture at Oracle
Soal Bahasa Inggris Label, Procedure Text
Soal ipa kelas viii bab 1 pertumbuhan dan perkembangan
Kelas1 Sd Pkn Bangga Menjadi Insan Pancasila Sarjan
SOAL IPA SD OSN 2016
Hello Android
Web Oriented Architecture at Oracle

Similar to GridView,Recycler view, API, SQLITE& NetworkRequest.pdf (20)

PPTX
Asp Net Advance Topics
PDF
Building Modern Apps using Android Architecture Components
DOC
The most basic inline tag
PPT
Twitter bootstrap (css, components and javascript)
PPT
Struts
PPT
MVC
PDF
Step by Step Asp.Net GridView Tutorials
PPTX
Model viewviewmodel2
PDF
Java Web Programming on Google Cloud Platform [2/3] : Datastore
PPT
Data controls ppt
PPTX
Ch 7 data binding
PDF
Introduction to Datastore
PPT
Chapter12 (1)
PDF
Asp net interview_questions
PDF
Asp net interview_questions
PPTX
Android Training (AdapterView & Adapter)
PPT
Beginning Native Android Apps
PPTX
ASP.NET Lecture 4
ODP
Android App Development - 11 Lists, grids, adapters, dialogs and toasts
PPTX
Adapter and adapter views that are used in android
Asp Net Advance Topics
Building Modern Apps using Android Architecture Components
The most basic inline tag
Twitter bootstrap (css, components and javascript)
Struts
MVC
Step by Step Asp.Net GridView Tutorials
Model viewviewmodel2
Java Web Programming on Google Cloud Platform [2/3] : Datastore
Data controls ppt
Ch 7 data binding
Introduction to Datastore
Chapter12 (1)
Asp net interview_questions
Asp net interview_questions
Android Training (AdapterView & Adapter)
Beginning Native Android Apps
ASP.NET Lecture 4
Android App Development - 11 Lists, grids, adapters, dialogs and toasts
Adapter and adapter views that are used in android
Ad

More from Nabin Dhakal (15)

PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
PPTX
Broadcast receiver- How Android apps listen to system-wide or app-specific ev...
PPTX
Android Notifications-A Guide to User-Facing Alerts in Android .pptx
PPTX
Menu in Android (Define,Create,Inflate and Click Handler)
PPTX
Unit Two - Java Architecture and OOPS
PPTX
Chapter One - Introduction to Mobile Oses
PPTX
Unit 1 -Programming Languages(Programming Logic and Techniques)
PPTX
UNIT 3- Programming Technique(Programming Logic and Technique)
PPTX
UNIT 5- Standalone and Client Server Programming Concept
PPTX
UNIT 4- Program Maintenance(Programming Logic & Techniques)
PPTX
Unit 2 -Software-Development (Programming Logic and Techniques)
PPTX
ListView.pptx
PPTX
SQLite in Flutter.pptx
PPTX
Hive in Flutter.pptx
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Broadcast receiver- How Android apps listen to system-wide or app-specific ev...
Android Notifications-A Guide to User-Facing Alerts in Android .pptx
Menu in Android (Define,Create,Inflate and Click Handler)
Unit Two - Java Architecture and OOPS
Chapter One - Introduction to Mobile Oses
Unit 1 -Programming Languages(Programming Logic and Techniques)
UNIT 3- Programming Technique(Programming Logic and Technique)
UNIT 5- Standalone and Client Server Programming Concept
UNIT 4- Program Maintenance(Programming Logic & Techniques)
Unit 2 -Software-Development (Programming Logic and Techniques)
ListView.pptx
SQLite in Flutter.pptx
Hive in Flutter.pptx
Ad

Recently uploaded (20)

PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
System and Network Administration Chapter 2
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
L1 - Introduction to python Backend.pptx
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Introduction to Artificial Intelligence
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
ai tools demonstartion for schools and inter college
PPT
Introduction Database Management System for Course Database
PDF
Nekopoi APK 2025 free lastest update
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
medical staffing services at VALiNTRY
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
assetexplorer- product-overview - presentation
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
System and Network Administration Chapter 2
Navsoft: AI-Powered Business Solutions & Custom Software Development
L1 - Introduction to python Backend.pptx
2025 Textile ERP Trends: SAP, Odoo & Oracle
Introduction to Artificial Intelligence
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
ai tools demonstartion for schools and inter college
Introduction Database Management System for Course Database
Nekopoi APK 2025 free lastest update
Upgrade and Innovation Strategies for SAP ERP Customers
medical staffing services at VALiNTRY
Operating system designcfffgfgggggggvggggggggg
CHAPTER 2 - PM Management and IT Context
Softaken Excel to vCard Converter Software.pdf
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
assetexplorer- product-overview - presentation
Design an Analysis of Algorithms I-SECS-1021-03
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool

GridView,Recycler view, API, SQLITE& NetworkRequest.pdf