Welcome to the repository for the Mobile Programming Assignments and Final Project! This repository is focused on learning and mastering Android development using Jetpack Compose, Kotlin, and other modern tools and frameworks. Through practical assignments and a comprehensive final project, you'll gain hands-on experience in creating functional, efficient, and user-friendly mobile applications.
- About
- Features
- Assignments
- Final Project: Mobile Shopping App
- Requirements
- Installation and Setup
- Usage
- Contributing
- License
- Acknowledgments
This repository contains a series of assignments and a final project designed to:
- Teach the basics of Kotlin and Jetpack Compose.
- Develop layouts and user interfaces using modern Android tools.
- Handle data persistence, state management, and API integration.
- Build a complete mobile shopping app as a capstone project.
- π¨ Jetpack Compose: Declarative UI design with modern components.
- π± Responsive Layouts: Optimized for various screen sizes.
- π Data Management: Use of Room database and LiveData.
- π Network Communication: Integration of APIs using Retrofit.
- π Scalable Architecture: MVVM architecture for clean code.
Learn the foundational syntax and concepts of Kotlin.
- Variables and Data Types: Work with
Int,String,Boolean, etc. - Conditional Statements: Check number positivity.
- Loops: Print numbers using
forandwhileloops. - Collections: Sum a list of numbers.
- Set Up the Android Project:
- Create a new Android project in Android Studio.
- Ensure you have a Kotlin-based project.
- Design the Layout:
- Create a new XML layout file (
activity_main.xml) for a simple Instagram-like user interface. - Include elements like
ImageView,TextView, andRecyclerViewfor the feed. - Create the RecyclerView Adapter:
- Set up the
RecyclerViewto display a feed of posts withImageViewfor the picture andTextViewfor the caption. - MainActivity Setup:
- Initialize the
RecyclerViewinMainActivityand populate it with sample data.
Design a modern UI layout using Jetpack Compose to create an Instagram-like interface.
- Compose-Based Feed:
- Use Jetpack Compose's
LazyColumnto display a dynamic list of posts. - Each post includes a profile picture, username, image, caption, and like button.
- Use Jetpack Compose's
- Custom Components:
- Create reusable Compose components for Post, Profile Picture, and Caption.
- Interactivity:
- Add click listeners for likes and post interactions.
- Display a toast message when posts are liked.
- Sample Data Integration:
- Use a ViewModel to provide mock data and observe state changes.
- Bind the data dynamically to the UI using Compose state management.
Explore fragments, LazyColumn (Compose's replacement for RecyclerView), and state management with ViewModel.
-
Fragments:
- Create a basic fragment and implement lifecycle methods.
- Implement communication between fragments using a shared ViewModel.
- Manage fragment transactions with Jetpack Navigation.
-
LazyColumn:
- Use Jetpack Compose's
LazyColumnfor displaying dynamic lists of items. - Handle item interactions such as clicks using Compose's
Modifier.clickable.
- Use Jetpack Compose's
-
ViewModel and LiveData:
- Store and observe data using
LiveData. - Integrate ViewModel with Compose state management to display real-time updates.
- Fetch data from a Room database and dynamically reflect changes in the UI using Compose components.
- Store and observe data using
Integrate Room for local storage and Retrofit for API communication.
-
Room Database:
- Define entities and DAO interfaces.
- Perform database operations in a lifecycle-aware manner.
-
Retrofit:
- Set up Retrofit for API requests.
- Create data models for JSON responses.
- Handle API responses gracefully and cache data locally.
Develop a comprehensive shopping application using Jetpack Compose, integrating all the concepts learned throughout the assignments.
- User Management: Manage user profiles, login, and registration.
- Product Listings: Display a list of products with search and filtering.
- Shopping Cart: Add products to a cart and proceed to checkout.
- Order History: Track user orders and display order details.
- Real-time Updates: Use WebSockets for live notifications.
- Fully functional shopping app with Jetpack Compose UI.
- Room database for data storage.
- Retrofit integration for API calls.
- Clean architecture with ViewModel and LiveData.
- Android Studio: Latest version
- Kotlin: Latest version
- Jetpack Compose: Version 1.x+
- Room Database: Version 2.x+
- Retrofit: Latest version
Ensure the following are installed:
- Android Studio with Jetpack Compose support
- Latest Android SDK
- Clone the repository:
git clone https://github.com/diable201/MobileProgrammingMS.git cd MobileProgrammingMS - Open the project in Android Studio and sync Gradle.
- Run the app on an emulator or physical device.
- Run the App: Launch the application in Android Studio to explore features.
- Test API Calls: Use mock data or connect to a real API using Retrofit.
- Modify Layouts:
Customize Jetpack Compose components in
MainActivityand fragments.
Contributions are welcome! Please fork the repository and submit a pull request for review. Ensure your code follows best practices and includes documentation.
This project is licensed under the MIT License. See the LICENSE file for details.
- Kotlin Documentation: Kotlin Lang
- Jetpack Compose: Compose Docs
- Android Development: Android Docs