Android Basics Flashcards
Fundamentals of Android App development
What are the 3 basic types of mobile apps
Native
Web apps
Hybrid
What is a Web app
Responsive version of a website that works on any mobile device or OS
Delivered via mobile browser
What is a hybrid app
Combination of web app and native app
Web app that is wrapped in a native app so it can be downloaded
What are native apps
Built for the Mobile device OS
require installation
written in Android or swift
What are some benefits of Native apps
- Provide access to all the standard tools and features and are compatible with native features such as sensors, hand gestures, accelerometer
-Performance
What are Web apps usually built with
HTML5, CSS, JavaScript
What is a PWA
Progressive Web app
- native web app running insides a browser
- Web app that functions like a native mobile app
- has a homescreen icon, responsive design, offline functionality
- Get automatic updates
- Offer good performance
- provide users with a more app-like experience on the web
What is the Dalvik VM
A pioneering virtual machine that paved the way for Android’s success. It allowed applications to run on the android device
- superseded by Android Runtime (ART), its legacy remains in the foundation of the Android ecosystem.
What is Android jetpack
Suite of software components, libraries, tools, and guidance provided by Google to help developers build robust, high-quality Android applications.
Benefits - reduces boilerplate code, ensures consistent apps
Includes AndroidX which is used for backwards compatibility
What is AndroidX
Provides backwards compatibility across Android releases
How do Android apps work
Device launches app
app creates activity object
Activity tells Android what layout to display
User interacts with the layout
Activity responds to the interaction by running application code
Activity updates the display
What are view groups
Invisible container for views
What are common android layouts
Linear
Relative (Constraint layout is preferred)
Web view to display web pages
Adaptor layouts: list view, grid view, recycler view
Constraint layout
Constraint layout
default layout
has a flat hierarchy
Needs at least one horizontal and one vertical constraint for the view
What are the main files in android
Manifest
Gradle scripts
java
res
What are the gradle scripts
build.gradle project
build.gradle module
settings. gradle
What are the common res files
drawables
layout files
menu
values (strings)
What does the Android manifest do
declares components (activities, services)
defines permissions (camera, location, storage)
set config (min level supported)
app metadata (helps user understand app)
What does the settings.gradle do
defines the project hierarchy
Defines plugins remote repositories like Maven
What does MainActivity.java do
- defines how the app will behave and interact with the user
- Starts the activity and loads the layout set by setContentView() method
What are the different stages in the activity lifecycle
onCreate()
onStart()
on Resume()
ACTIVITY RUNNING
on Pause()»_space; go to onResume
on Stop()»_space; go to onCreate from here if other apps need the memory, or go to onRestart()
on Destroy
ACTIVITY SHUT DOWN
What is AppCompatActivity
Base class for activities and uses an app bar
What is the Bundle savedInstanceState
Previously frozen state if there was one
What does the setContentView method do
loads the activity_main.xml
sets the activity content from a layout resource that will be inflated, adding all the top level view to the activity