How shakibim/locationtracker-android-app works
1. Project shape
- This is a single-module Android app (app) written in Java with XML layouts and Gradle Kotlin build scripts.
- The architecture is client-only: there is no backend service in the repo. Core state lives on the device.
2. High-level flow
- The app starts with an onboarding/auth path: GetStarted → SignIn / SignUp → MainActivity.
- After login, the user lands in the main shell, which hosts the app’s functional screens: Home, History, and Profile.
3. Main navigation shell
- MainActivity is the container for the authenticated experience.
- bottom_nav_menu.xml and the fragment classes indicate a bottom-navigation, fragment-based UI rather than multiple independent screens.
- HomeFragment, HistoryFragment, and ProfileFragment are the primary feature areas.
4. Authentication and session boundary
- SignUp.java and SignIn.java manage account creation and login.
- UserDatabaseHelper.java stores user records locally in SQLite.
- The README says login state is persisted with SharedPreferences, which acts as the session boundary that decides whether to show the auth flow or the main app.
5. Location tracking pipeline
- HomeFragment is the control center for tracking, including the on/off switch mentioned in the README.
- LocationService.java is the background component responsible for collecting device GPS location at intervals.
- The app stores location snapshots every five minutes with timestamp metadata, and shows a toast notification when a reading is saved.
6. Local data persistence
- LocationDatabaseHelper.java is the storage layer for tracked location history.
- LocationModel.java represents a single location record, likely including latitude, longitude, date/time, and possibly an identifier.
- This makes the app offline-first: saved data remains available without network access.
7. History browsing and list presentation
- HistoryFragment.java displays stored tracking records.
- LocationAdapter.java binds LocationModel items into the list UI defined in item_location.xml.
- The list is the read-side of the location database, separated from the write-side handled by the service.
8. Details view
- ViewDetailsLocation.java and activity_view_details_location.xml provide a per-record detail screen.
- This is the drill-down from history into a single saved location entry, probably used to inspect coordinates and timestamp more closely.
9. Profile area
- ProfileFragment.java is the user/account screen inside the authenticated shell.
- Given the presence of shared session state and auth screens, this fragment likely summarizes the current user and offers logout or account-related actions.
10. UI structure and assets
- The repository uses standard Android resource separation: layouts, drawables, menus, themes, dimens, and strings.
- Material-style icons and themed backgrounds suggest a Material Components UI layered on top of native Android views.
11. External integrations noted in the README
- The README documents optional/adjacent integrations with OSMDroid/OpenStreetMap, Nominatim for reverse geocoding, and Open-Meteo for weather.
- These would sit at the presentation edge of the location screens, enriching raw GPS coordinates with map, place-name, or weather context if those features are enabled.
12. Architectural boundaries
- The main separation is between:
- UI layer: activities/fragments/adapters/layouts
- State and session layer: SharedPreferences + auth flow
- Persistence layer: SQLite helpers and models
- Background capture layer: LocationService
- The app’s data moves from GPS → service → SQLite → history adapter/details screen, while authentication moves from sign-in/up → shared session → main navigation.
Main entry points: HistoryFragment.java History · LocationService.java Location Service · bottom_nav_menu.xml Bottom Nav · MainActivity.java Main Activity
Components 19
UI Shell
Entry, navigation, and screens
- Get Started · Launch screen that routes into authentication or the app shell
LocationTracker/app/src/main/java/com/example/locationtracker/GetStarted.java - Main Activity · Authenticated container that hosts bottom navigation and fragments
LocationTracker/app/src/main/java/com/example/locationtracker/MainActivity.java - Profile · Authenticated user screen for profile and logout actions
LocationTracker/app/src/main/java/com/example/locationtracker/ProfileFragment.java
Auth & Session
Login, signup, and persisted session state
- Sign In · Login screen that validates existing users
LocationTracker/app/src/main/java/com/example/locationtracker/SignIn.java - Sign Up · Account creation screen for new users
LocationTracker/app/src/main/java/com/example/locationtracker/SignUp.java - Session State · Stored login state that decides whether to show auth or the main app
- User DB · Local SQLite store for user records
LocationTracker/app/src/main/java/com/example/locationtracker/UserDatabaseHelper.java
Location Capture
Background GPS capture and record flow
- Home · Control center for tracking on/off and live capture controls
LocationTracker/app/src/main/java/com/example/locationtracker/HomeFragment.java - Location Service · Collects device GPS location at intervals
LocationTracker/app/src/main/java/com/example/locationtracker/LocationService.java - GPS Source · Underlying device location provider used by the service
Local Data
SQLite-backed storage and list binding
- Location DB · Local history store for tracked location snapshots
LocationTracker/app/src/main/java/com/example/locationtracker/LocationDatabaseHelper.java - Location Model · Single saved location entry with coordinates and timestamp
LocationTracker/app/src/main/java/com/example/locationtracker/LocationModel.java - History · Browse stored tracking records
LocationTracker/app/src/main/java/com/example/locationtracker/HistoryFragment.java - Location Adapter · Binds saved location models into the history list UI
LocationTracker/app/src/main/java/com/example/locationtracker/LocationAdapter.java - Location Details · Drill-down view for a single saved location entry
LocationTracker/app/src/main/java/com/example/locationtracker/ViewDetailsLocation.java
Resources
Key layouts and navigation menu
- Bottom Nav · Navigation menu for the main shell tabs
LocationTracker/app/src/main/res/menu/bottom_nav_menu.xml - Home Layout · Screen layout for the tracking dashboard
LocationTracker/app/src/main/res/layout/home_fragment.xml - History Layout · Screen layout for location history
LocationTracker/app/src/main/res/layout/history_fragment.xml - Details Layout · Screen layout for the location detail view
LocationTracker/app/src/main/res/layout/activity_view_details_location.xml
Connections 23
- Get Started → Sign In: entry · Starts the authentication flow
- Get Started → Sign Up: new user · Routes first-time users to account creation
- Sign Up → User DB: stores user · Persists new accounts locally
- Sign In → User DB: verifies user · Checks credentials against local users
- Sign In → Session State: sets login · Persists authenticated session state
- Sign Up → Session State: starts session · Marks the user as signed in after registration
- Session State → Main Activity: opens shell · Controls whether the authenticated app is shown
- Main Activity → Bottom Nav: hosts nav · Uses bottom navigation to switch primary fragments
- Bottom Nav → Home: tab · Main tracking dashboard tab
- Bottom Nav → History: tab · History browsing tab
- Bottom Nav → Profile: tab · Profile tab
- Home → Location Service: starts/stops · Controls background location capture
- Location Service → GPS Source: reads · Collects device GPS updates
- Location Service → Location DB: writes snapshot · Stores periodic location readings
- Location Service → Location Model: creates record · Materializes captured readings as model objects
- Location DB → History: feeds history · Provides stored records to the browsing screen
- History → Location Adapter: binds list · Displays records through a list adapter
- Location Adapter → Location Model: renders · Binds each saved location model into the list item UI
- History → Location Details: opens detail · Drills into a selected record
- Location Details → Details Layout: uses layout · Renders the per-record detail screen
- Home → Home Layout: uses layout · Renders the tracking dashboard UI
- History → History Layout: uses layout · Renders the history screen UI
- Main Activity → Profile: contains · Hosts the profile screen inside the authenticated shell