Back to Projects

Android Project

MyFavLocation - Android Location Discovery App

About this Project

Project Overview

MyFavLocation is a mobile application for Android designed to help users explore their surroundings. It fetches nearby points of interest from the Google Places API and displays them in a user-friendly list. Users can save these locations as favorites, view detailed information, or create their own custom locations complete with a name, description, photo, and rating, which are then stored locally on the device.

The Challenge

The primary challenge was to design a scalable and maintainable Android application from the ground up. This involved implementing the MVVM (Model-View-ViewModel) architectural pattern to separate UI logic from business logic, managing asynchronous operations for network requests and database access, and handling Android's runtime permission system for features like GPS and camera access. Another key goal was to ensure a smooth user experience by caching data to minimize API calls and data consumption.

Key Features

  • Nearby Location Discovery: Automatically fetches and displays a list of nearby locations within a 200-meter radius.
  • Favorite Locations: Save any location from the Google Places API or a custom-created one to a local favorites list.
  • Custom Location Creation: Create new locations by taking a picture, providing a name, description, category, and rating, and saving it with the current GPS coordinates.
  • Location Search: Search for specific locations using text queries, which queries both the Google Places API and the local database.
  • Detailed Views: View detailed information for each location, including a static map image, rating, and user-provided details.
  • Data Persistence: User-created and favorite locations are stored locally using the Room persistence library.

Technical Deep Dive

  • Architecture: The application is built using the MVVM (Model-View-ViewModel) pattern, ensuring a clean separation of concerns. This is supported by ViewModel and LiveData components from Android Jetpack to create a reactive UI that is independent of the application's lifecycle.
  • Frontend: The UI is built with native Android components (Activities and Fragments) and Kotlin. The Android Navigation Component is used to manage navigation between screens. Glide is leveraged for efficient loading and caching of images from URLs and local file paths.
  • Backend: The backend logic is encapsulated within Repositories. Retrofit handles asynchronous API calls to the Google Places API. Local data storage is managed by the Room Persistence Library, providing an abstraction layer over SQLite. GPS coordinates are fetched using Android's native location services.
  • Dependency Management: A custom InjectorUtils class is used to manage dependencies between ViewModels and Repositories, centralizing the creation of objects and making the architecture easier to test and modify.

Personal Learnings

This project was a deep dive into modern Android development practices. I gained significant experience in implementing the MVVM architecture, which was crucial for building a scalable and testable app. I learned to handle asynchronous operations effectively using callbacks for API and database interactions, although the project also highlighted the complexities that lead to modern solutions like Kotlin Coroutines. Managing the Android component lifecycle, handling runtime permissions, and implementing a robust data layer with Room and Retrofit were key takeaways that solidified my understanding of building feature-rich mobile applications.