My First Mobile App for Students : A comprehensive guide to Android app development for beginners

Learn the basics of Kotlin and build your first Android app. Key Features: - Build real-world apps from scratch with U

176 64 18MB

English Pages 360 Year 2024

Report DMCA / Copyright

DOWNLOAD FILE

My First Mobile App for Students : A comprehensive guide to Android app development for beginners

Table of contents :
Cover
Title Page
Copyright Page
Dedication Page
About the Author
About the Reviewer
Acknowledgements
Preface
Table of Contents
1. Welcome, Future App Developer
Introduction
Structure
Objectives
History of Android OS
History of Kotlin
Market impact of Mobile operating systems
Setting up Android Studio
Windows installation
Mac installation
Linux installation
Android SDK setup
Kotlin classes and objects
Class in Kotlin
Object in Kotlin
Functions and variables in Kotlin
Function
Variables
Conditions and loops
If expression
When expression
Loops
For
While
Conclusion
Points to remember
Exercises
2. App 1—Dynamic Dice Simulator (Part 1)
Introduction
Structure
Objectives
Android project wizard
Android studio interface
Android app project structure
Android design editor interface
Adding drawables
View
Viewgroups
ConstraintLayout
Adding TextView
Adding button
Adding ImageView
XML editor
Editing attributes of views
Coding Kotlin function
Activity and types of activities
Event listener
Emulator
Developer mode in Android phones
Running the app
Gradle build
Conclusion
Exercises
3. App 1—Dynamic Dice Simulator (Part 2)
Introduction
Structure
Objectives
Multiple activities in app
Intent
Types of Intent
Companion object in Kotlin
Passing data through intent
Intent filter
Android manifest
Motion layout
Motion editor
Motion scene
Transition
Finishing up the app
Conclusion
Exercises
4. App 2—State Trivia
Introduction
Structure
Objectives
Collection and generics
Model and data class
Data class
Create the new app
Data source
Material design
Updating to Material 3 theme
Changing the app icon
ViewBinding
Enabling the ViewBinding
Gradle sync
Creating the scrollable list
RecyclerView
Single element layout
CardView
Adapter for RecyclerView
Abstract methods
Constructor for the adapter
ViewBinding inside the adapter
Passing the data to ViewHolder
Setting the size of items
ViewHolder
The full Adapter class code
Completing the RecyclerView
Changing the layout
Options menu
The click functionality
Conclusion
Exercises
5. App 3—Movie Booking
Introduction
Structure
Objectives
What is fragment?
Fragment lifecycle
The basic activity
NavHostFragment
Android jetpack
Creating a new project
Setting up the fragments
Rename existing fragment
Create a new package
Creating new fragments
Update fragment labels
Kotlin getter and backing properties
Updating fragment default code
Fix new fragments
Create a user interface for each fragment
fragment_intro.xml
fragment_day_select.xml
fragment_time_select.xml
fragment_seat_select.xml
fragment_payment.xml
fragment_confirm.xml
fragment_receipt.xml
Navigation graph
MVVM architecture in Android
DataBinding
Updating the build.gradle file
ViewModel
Shared ViewModel
Creating the ViewModel
LiveData
Immutable versus mutable LiveData
Updating the ViewModel
ViewModel + DataBinding in Layout files
fragment_intro.xml
fragment_day_select.xml
fragment_time_select.xml
fragment_seat_select.xml
fragment_payment.xml
fragment_confirm.xml
fragment_receipt.xml
Lifecycle observer
Completing the fragments
IntroFragment.kt
DaySelectFragment.kt
TimeSelectFragment.kt
SeatSelectFragment.kt
PaymentFragment.kt
ConfirmFragment.kt
ReceiptFragment.kt
Running the app
Conclusion
Exercises
6. App 4—Book Finder
Introduction
Structure
Objectives
Multithreading
Coroutines
Web services and networking
The Google Books API
Setting up the new project
Retrofit service
Moshi and data conversion
Permission in Android
Creating the Project UI
Update strings.xml
Update navigation graph
Update activity_main.xml layout
Change fragment_search.xml layout
Change fragment_result.xml
Edit the book_card_view.xml
Integrating the code
Creating the BookViewModel
Editing the SearchFragment
Editing the ResultFragment
Handling the BookAdapter
BindingAdapter
Adding the data binding to layout
Running the app
Conclusion
Exercises
7. App 5—Flash Cards (Part 1)
Introduction
Structure
Objectives
The concept of database
Local databases
Remote databases
Table, columns and rows
Tables
Columns
Rows
Datatypes
Primary key
SQL and basic queries
SELECT
INSERT
UPDATE
DELETE
Room library
Creating the new project
Adding room dependency
Entity in room
Data Access Object
Creating the database
Attaching the database with application
Conclusion
Exercises
8. App 5—Flash Cards (Part 2)
Introduction
Structure
Objectives
Fetching data using flow
ViewModel and DAO
ViewModelFactory and DAO
Adding data
The layout design
Add the resource strings
The fragment’s code
Setting the home screen with ViewPager
ViewPager2
The layout design
The fragment’s code
Setting up the ListAdapter
Adding more functionality
View and delete item
The layout
Kotlin code
Navigation graph implementation
Editing item
The layout
Kotlin code
Navigation graph implementation
Running the app
Conclusion
Exercise
9. App 6—Inspire Me
Introduction
Structure
Objectives
Cloud services
Setting up the project
Fragments
ViewModels
Adapter
Navigation graph
Layouts
Model
Drawables
BindingUtil.kt
Menu
Strings.xml
App’s project structure
Firebase integration
Firebase console
Firebase authentication
Firebase Firestore
Project UI and layout
activity_auth.xml
fragment_login.xml
fragment_register.xml
post_card.xml
fragment_display.xml
fragment_add.xml
ViewModels
CloudAuthViewModel
FirebaseViewModel
Navigation graph
Fixing the menu
Adapter
Implementation of fragments
LoginFragment
RegisterFragment
DisplayFragment
AddFragment
Uploading apps to GitHub
Running the app
Conclusion
Exercises
Index

Polecaj historie