Skip to content

This repository serves as a collection of laboratory assignments completed during the "Android Software Development" elective course

License

Notifications You must be signed in to change notification settings

RadioPizza/TPU-Labs-Android-development

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android Kotlin Android Studio Gradle SQLite Microsoft Word

How to use this repository

Each lab is located in its own directory and contains:

  • Source code implementation
  • Additional resources (if any)
  • Report

Tutorials and methodological guidelines for each lab are located in the tutorial folder at the root of the repository.

To explore a specific lab, navigate to the corresponding directory and open the project in Android Studio.

Contents

Lab 1: Text Formatting

Overview

This lab introduces Kotlin basics and demonstrates how to use regular expressions for text formatting. The goal is to create a program that processes an input string and applies a series of formatting transformations to improve its readability.

Key Transformations

The program performs the following operations on the input string:

  • Quote Replacement: replace double quotes (") with proper opening («) and closing (») quotation marks. Opening quotes should precede words, and closing quotes should follow words (including any punctuation).

  • Space Normalization: standardize spacing around punctuation. Remove spaces before commas, periods, opening parentheses, etc., and add spaces after commas, periods, closing parentheses, etc.

  • Hyphen Replacement: replace hyphens/dashes with en-dashes surrounded by spaces (unless adjacent to letters).

  • Double Space Removal: replace multiple spaces with single spaces.

Example Input and Output

Input:

" Лето , как обычно ,пролетело    незаметно..."-грустно сказал Ваня .Он( и его друзья )сидели на берегу речки с поэтичным названием "Стремительная ".

Output:

«Лето, как обычно, пролетело незаметно...» – грустно сказал Ваня. Он (и его друзья) сидели на берегу речки с поэтичным названием «Стремительная».

Lab 2: Telephone Station Emulator

Overview

This lab focuses on the fundamentals of working with Kotlin classes and objects and demonstrates how to implement basic object interactions. The goal is to create a program that simulates the operation of a simple telephone station. The program allows users to manage a list of subscribers and log calls between them.

Key Features

The program is divided into two main components:

  1. Abonent Class
    Represents a subscriber with the following properties:

    • Name and Phone Number
    • A call log that stores incoming and outgoing calls.
  2. Station Class
    Represents the telephone station and includes:

    • A list of subscribers.
    • The ability to initiate calls and log them for both the caller and the recipient.
    • A method to display call logs for all subscribers.

Key Functionality

  • Adding Subscribers
    Subscribers can be added to the station using the addAbonent() method.

  • Making Calls
    The call(from: String, to: String) method simulates a call from one subscriber to another:

    • Logs an outgoing call in the caller's call log.
    • Logs an incoming call in the recipient's call log.
  • Displaying Call Logs
    The showStat() method displays the full call logs of all subscribers in a structured format.

Example Program Execution

Code Example

fun main() {
    val station = Station()

    station.addAbonent(Abonent("Иван", "001"))
    station.addAbonent(Abonent("Ольга", "002"))
    station.addAbonent(Abonent("Сергей", "003"))

    station.call("Иван", "Ольга")
    station.call("Ольга", "Сергей")
    station.call("Сергей", "Иван")
    station.call("Иван", "Сергей")
    station.call("Ольга", "Иван")

    station.showStat()
}

Example Output

Журнал звонков абонента Иван:
    Исходящий к Ольга
    Входящий от Сергей
    Исходящий к Сергей
    Входящий от Ольга

Журнал звонков абонента Ольга:
    Входящий от Иван
    Исходящий к Сергей
    Исходящий к Иван

Журнал звонков абонента Сергей:
    Входящий от Ольга
    Исходящий к Иван
    Входящий от Иван

Lab 3: Project Creation and Program Launch

In the third lab, the focus was on getting acquainted with Android Studio and understanding the process of creating and launching an Android project. The primary objective was to initialize a new project using the Empty Views Activity template, configure the project structure, and familiarize with essential project files such as MainActivity.kt and activity_main.xml. Additionally, this lab covered editing the application's manifest file (AndroidManifest.xml) to include necessary permissions, specifically internet access.

Lab 4: Simple Calculator

A basic calculator app with four arithmetic operations. Features two input fields, operation buttons, and a shared event listener that handles all button clicks. The app displays results in "X + Y = Z" format and includes error handling for invalid inputs and division by zero.

Lab 5: Colored Tiles

A grid application with colored tiles that change colors when clicked or when the app returns to the screen. Uses GridLayout container and activity lifecycle methods. Each tile shares the same base color but has different transparency levels, creating a gradient effect across the grid.

Lab 6: Quadratic Equation Solver

A quadratic equation solver that automatically calculates roots when coefficients are changed. Uses ConstraintLayout for the interface and handles all discriminant cases: two real roots, one real root, and no real roots.

Lab 7: "Edible - Inedible" Game

A food recognition game that shows random images where players guess if items are edible or not. The app tracks correct and incorrect answers with score display and supports multiple languages through resource localization.

Lab 8: Unit Converter

A length conversion app that automatically updates all fields when any value is changed. Uses ViewModel and LiveData to preserve state during configuration changes. Supports conversion between micrometers, mils, millimeters, lines, and inches with real-time synchronization.

Lab 9: Questionnaire

A user registration app demonstrating the use of multiple input controls. Features a Spinner for country selection that dynamically updates the phone code prefix. The app uses a CheckBox to enable/disable the registration button based on user agreement and a RadioGroup for selecting phone number visibility preferences. The interface is built with ScrollView to accommodate various screen sizes.

Lab 10: Snackbar Tester

A Snackbar customization app that demonstrates advanced notification features. Allows users to create customized Snackbar messages with configurable text, action buttons, and RGB color controls for background, text, and action elements. Uses SeekBar sliders for color component adjustment and includes default values for immediate testing.

Lab 11: Calculation Testing

An electronics calculator demonstrating unit testing with JUnit. Features specialized calculation methods and comprehensive test coverage for normal/boundary values. Shows error detection through intentional code faults and automated test validation.

Lab 12: Store Showcase

A RecyclerView-based store showcase app demonstrating efficient list handling for product displays. Features CardView elements with product images, names, and prices in a grid layout. Implements interactive cart functionality with dynamic icon toggling (add/remove) and color-coded Snackbar notifications.

Lab 13: City Guide

An intent-based city information app featuring RecyclerView selection and map integration. Demonstrates explicit intents for activity communication and implicit intents for launching map applications. Includes CSV data loading and modern result handling patterns.

Lab 14: City Guide with Fragments

A fragment-based city app with responsive dual/single-pane layouts. Features landscape mode with simultaneous list/detail views and portrait mode with navigation. Implements scroll state preservation and fragment lifecycle management for adaptive UI experiences.

Lab 15: Shopping List

A shopping list app implementing full CRUD operations using RecyclerView and DialogFragment. Features swipe-to-delete functionality with ItemTouchHelper and follows Material Design principles with Floating Action Button for adding items.

Lab 16: Interactive Tale "Kolobok"

An interactive storybook app demonstrating Android Navigation Component. Features fragment-based navigation with illustrated scenes and choice-driven storyline. Uses NavController for seamless transitions between story fragments and implements a branching narrative with multiple endings based on user decisions.

Lab 17: Super App

An app with bottom navigation between Music, Books, and News sections. Implements scrollable genre tabs with ViewPager2, fixed book category tabs, and a automated news counter with badge management.

Lab 18: Central Bank Exchange Rates

A currency rates app that downloads XML data from Central Bank using coroutines. Implements background network operations with progress indicator and displays parsed currency values in a RecyclerView.

Lab 19: Reading Contact List

A contacts app demonstrating Android runtime permissions with rationale dialogs and settings fallback. Reads and displays contacts after permission grant.

Lab 20: External Controller

  • Broadcasts
  • Notifications

Lab 21: Timer

  • Services

Lab 22: Game "Find the Point!"

  • Geolocation

Lab 23: GitHub Search

  • Internet and JSON

Lab 24: Animated Something

  • Drawing

Lab 25: Reading List

  • SQLite Database

Lab 26: Colors of the Real World

  • Camera

Lab 27: Gravity Ball

  • Sensors