Sonopant Dandekar Shikshan Mandali’s SONOPANT DANDEKAR ARTS, V.S. APTE COMMERCE AND M.H. MEHTA SCIENCE COLLEGE, PALGHAR Palghar, Dist – Palghar, Pin – 401 404, E – Mail: sdsmcollege@yahoo.com Department of Computer Science BSc. Computer Science SEM I V Practical Journal Name Roll. No. Subject Name Mobile Application Development (SEC) Sonopant Dandekar Shikshan Mandali’s SONOPANT DANDEKAR ARTS, V.S. APTE COMMERCE AND M.H. MEHTA SCIENCE COLLEGE, PALGHAR Palghar, Dist – Palghar, Pin – 401 404, E – Mail: sdsmcollege@yahoo.com Department of Computer Science Journal Certificate Class: B.Sc. Computer Science (Semester: I V) Seat Number: _____________________ Roll No.: ____________ Academic Year: 2025 - 26 This is to certify that the work entered in this journal is the work of Mr/Miss: , who has worked for academic year 2025 - 26 in the computer laboratory. He/She has completed prescribed practical of following course satisfactorily. Course Title: Teacher In - charge Head of Department Date: External Examiner College Stamp 3 INDEX Sr.No. Practical Name Date Signature 1 To study the Android application development environment including Android Studio, Android SDK, AVD, and first Kotlin - based application setup. 2 To understand Kotlin programming basics such as variables, data types, operators, type conversion, and simple input/output using standard Android UI components. 3 To apply control flow mechanisms and object - oriented programming concepts in Kotlin including conditional statements, loops, functions, classes, objects, inheritance, and companion objects. 4 To understand and implement core Android application components such as Activities and Intents (explicit and implicit). 5 To analyze the Activity lifecycle and demonstrate state changes using logs and basic user interactions. 6 To design and develop user interfaces using Android layout managers such as LinearLayout, RelativeLayout, and ConstraintLayout along with basic UI controls. 7 To implement event handling, input validation, and UI customization using listeners, themes, styles, and Android Manifest configuration. 8 To design applications using list - based UI components such as ListView and RecyclerView with appropriate adapter mechanisms. 9 To implement menus and fragment - based navigation including options, context, and popup menus within Android applications. 10 To understand and implement local data persistence techniques using SharedPreferences and SQLite database with CRUD operations. 11 To handle multimedia content such as images and animations using ImageView and XML - based animations. 12 To implement background processing in Android and display task progress using a ProgressBar. 4 NOX Instructions Step 1: Open Nox Player Emulator on your system. Step 2 : Open Android Studio and load your Android project. Step 3 : Click on Build in the top menu. Step 4 : Select Build Bundle(s) / APK(s). Step 5 : Click Build APK(s). Step 6 : After the APK is generated, go to the project folder → app → build → outputs → apk → debug. Step 7 : Locate the file app - debug.apk. Step 9: Nox will automatically install the application. S tep 1 0 : The app icon will appear on the Nox home screen. 5 Step 1 1 : Click the icon to run the application. 6 Practical No: 01 Aim : To study the Android application development environment including Android Studio, Android SDK, AVD, and first Kotlin - based application setup. ________________________________________________________________________________ NOTE: These 7 steps must be followed for all practicals. St ep 1 : Install Android Studio. Step 2 : Open Android Studio and select New Project. Step 3 : Choose Empty Views Activity. 7 Step 4 : Enter application name. Step 5: Select Kotlin as the programming language. Step 6: Click Finish to create the project. File Structure : Main two files 8 1. MainActivity.kt package com.example.android import android.os.Bundle import androidx.activity.enableEdgeToEdge import androidx.appcompat.app.AppCompatActivity import androidx.core.view.ViewCompat import androidx.core.view.WindowInsetsCompat class MainActivity : AppCompa tActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) enableEdgeToEdge () setContentView(R.layout. activity_main ) ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id main )) { v, insets - > val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom) insets } } } 2. activity_main.xml <? xml version="1.0" encoding="utf - 8" ?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res - auto" xmlns:tools ="http://schemas.android.com/tools" android:id="@+id/main" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <TextView android:layout_width="wrap_content" android:la yout_height="wrap_content" android:text="Hello World!" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_ toTopOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout> 9 In Android Studio, you can both design the layout and write the code in the XML file. Step 7: Run the application using AVD Emulator or physical device or NOX (Refer NOX instructions for running application using NOX ) Final Output : This is android studio’s Emulator 10 Practical No: 0 2 Aim : To understand Kotlin programming basics such as variables, data types, operators, type conversion, and simple input/output using standard Android UI components. ________________________________________________________________________________ Note : Shortcut for running the program Ctrl + Shift +B (Before using this Shortcut you must have created the tasks.json file) Steps for creating Tas k s.json File: Step 1: Terminal → Configure Tasks Step 2: Create tasks.json file from template Step 3: Others select karo Step 4: Replace with the below code ...... Task s .json { "version": "2.0.0", "tasks": [ { "label": "Run Kotlin (ps)", "type": "shell", "command": "kotlinc \ "${file} \ " - include - runtime - d \ "${fileBasenameNoExtension}.jar \ "; java - jar \ "${fileBasenameNoExtension}.jar \ "", "group": { "kind": "build", "isDefault": true }, "presentation": { "echo": true, "reveal": "always", "focus": true, "panel": "shared", "showReuseMessage": false, "clear": false }, "problemMatcher": [] } ] } 11 1) Input / Output Variables Code: fun main() { print("Enter your name: ") val name = readLine() ?: "Student" print("Enter your age: ") val age = readLine()?.toIntOrNull() ?: 0 println(" \ nHello $name, you are $age years old!") } Output: 2) Operators Code: fun main () { print ( "Enter first number: " ) val a = readLine() !! .toInt() print ( "Enter second number: " ) val b = readLine() !! .toInt() println ( "Addition: ${a + b} " ) println ( "Subtraction: ${a - b} " ) println ( "Multiplication: ${a * b} " ) println ( "Division: ${a / b} " ) } O utput: 12 3) Control Statements Code: fun main() { print("Enter a number: ") val n = readLine()!!.toInt() if (n > 0) { println("Positive number") } else if (n < 0) { println( "Negative number") } else { println("Zero") } } Output: 4) While loop Code: fun main() { var count = 1 while (count <= 5) { println("Count: $count") count++ } } Output: 13 5) For loop Code: fun main() { for (i in 1..10) { println(i) } } Output: 6) When Code: fun main() { print("Enter day number (1 - 7): ") val day = readLine()!!.toInt() val dayName = when(day) { 1 - > "Monday" 2 - > "Tuesday" 3 - > "Wednesday" 4 - > "Thursday" 5 - > "Friday" 6 - > "Saturday" 7 - > "Sunday" else - > "Invalid day" } println("Day is: $dayName") } Output: 14 Practical No: 0 3 Aim : To apply control flow mechanisms and object - oriented programming concepts in Kotlin including conditional statements, loops, functions, classes, objects, inheritance, and companion objects. ________________________________________________________________________________ 1) OOP (Object & Class) Code: class Student { var name: String = "" var age: Int = 0 fun display() { println("Name: $name, Age: $age") } } fun main() { val s = Student() s.name = "Priya" s.age = 22 s.display() } Output: 2) Inheritance Code: open class Animal { fun sound() = println("Animal makes a sound") } class Dog : Animal() { fun bark() = println("Dog barks") } fun main() { val d = Dog() d.sound() d.bark() } 15 Output: 3) Functions Code: fun greet(name: String) { println("Hello, $name!") } fun main() { greet("Priya") } Output: 4) With Arguments Code: fun displayInfo(name: String, age: Int = 18) { println("Name: $name, Age: $age") } fun main() { displayInfo ("Rahul") displayInfo("Sneha") } Output: 16 Practical No: 0 4 Aim : To understand and implement core Android application components such as Activities and Intents (explicit and implicit). ________________________________________________________________________________ File Structure: Main 5 Files 1. MainActivity.kt package com.example.actint import android.content.Intent import android.net.Uri import android.os.Bundle import android.widget.Button import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout. activity_main ) val btnExplicit = findViewById<Button>(R.id. btnExplicit ) val btnImplicit = findViewById<Button>(R.id. btnImplicit ) btnExplicit.setOnClickListener { val intent = Intent(this, SecondActivity::class. java ) startActivity(intent) } btnImplicit.setOnClickListener { val intent = Intent( Intent. ACTION_VIEW , Uri.parse("https://www.google.com") ) 17 startActivity(intent) } } } 2. SecondActivity.kt package com.example.actint import android.os.Bundle import androidx.appcompat.app.AppCompatActivity class SecondActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout. activity_second ) } } 3. activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:gravity="center" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:id="@+id/btnExplicit" android:text="Explicit Intent" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:id="@+id/btnImplicit" android:text="Implicit Intent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp"/> </LinearLayout> 4. activity_second.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="center" android:layout_width="match_parent" 18 android:layout_height="match_parent"> <TextView android:text="Second Activity" android:textSize="20sp" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </LinearLayout> 5. AndroidManifest.xml Add this line in manifest file......... <activity android:name=".SecondActivity" /> Output: After clicking on Explicit , the Second Activity page will be displayed. After clicking on Implicit , it will redirect to the link provided in the code 19 Practical No: 0 5 Aim : To analyze the Activity lifecycle and demonstrate state changes using logs and basic user interactions. ________________________________________________________________________________ File Structure: Main 2 Files 1. MainActivity.kt package com.example.logs import android.os.Bundle import android.util.Log import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() { private val TAG = "LifeCycleDemo" override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout activity_main ) Log.d(TAG, "onCreate called") } override fun onStart() { super.onStart() Log.d(TAG, "onStart called") } override fun onResume() { super.onResume() Log.d(TAG, "onResume called") } override fun onPause() { super.onPause() Log.d(TAG, "onPause called") } 20 override fun onStop() { super.onStop() Log.d(TAG, "onStop called") } override fun onDestroy() { super.onDestroy() Log.d(TAG, "onDestroy called") } } 2. activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="center" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:text="Cl ick Me" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </LinearLayout> Output: Note : Run this practical on the emulator. After running the application, navigate through the app to generate logs. The logs can be viewed in Logcat, available on the left - hand side panel of Android Studio.