IT Book 2

Introduction to Andriod

Android is an open-source mobile operating system developed by Google. It is based on the Linux kernel and is designed for touchscreen devices, smartphones, tablets, smart TVs, and wearables. Android apps are developed using Java, Kotlin, or Flutter (Dart).

Basic Structure of Andriod

An Android app consists of multiple components stored in a project directory. .Key Files & Directories
.AndroidManifest.xml → Stores app permissions, activities, and services.
.MainActivity.java / MainActivity.kt → Main logic of the app.
.res/layout/activity_main.xml → Defines the UI layout.
.Gradle Scripts → Manages dependencies and app configuration.

Andriod Architecture

Android is built on multiple layers: 1.Linux Kernel → Handles device drivers, memory, and process management.
2.Native Libraries → Includes OpenGL, SQLite, WebKit, and Media Framework.
3.Android Runtime (ART) → Runs Android apps efficiently.
4.Application Framework → Provides APIs for UI, location, and notifications.
5.Applications → User-installed apps like WhatsApp, Instagram, and Gmail.

Activities and Lifecycle

An Activity represents a screen in an Android app. It follows a lifecycle managed by Android.
Life cycle states
onCreate() Activity is created. onStart() Activity becomes visible.
onResume() Activity is in the foreground.
onPause() Activity is partially visible.
onStop() Activity is no longer visible.
onDestroy() Activity is destroyed.

Intents in Android

Intents help navigate between activities and pass data. 1.Explict Intents
2.Implict Intent

UI Components in Android

Android apps use XML for UI design. Common UI elements: ✅ TextView → Displays text
✅ EditText → User input field
✅ Button → Clickable button
✅ ImageView → Displays images
✅ RecyclerView → Lists items efficiently.

Android Permissions

Android apps require permissions to access device features (Camera, Location, Storage).
✅ Declaring Permissions in AndroidManifest.xml
✅ Requesting Permission in Code (Kotlin)

Databases in Android (SQLite & Room)

Android provides SQLite and Room Database for data storage.
✅ Creating SQLite Database (Kotlin)
✅ Using Room Database (Recommended)

Firebase in Android

Firebase provides real-time database, authentication, and cloud messaging.
✅ Adding Firebase to Android App
✅Go to Firebase Console and create a project.
✅Add the google-services.json file to your project.
✅Update build.gradle with Firebase dependencies.

Conclusion

Android is the most widely used mobile OS globally, offering flexibility, open-source tools, and a vast developer community. By learning Android development, you can build apps for business, entertainment, social media, and automation.

End of Flip Book

Your AI Assistant