Haryana Last

Technologies:
Kotlin XML Gradle (Kotlin DSL) Hilt (Dependency Injection) Retrofit 2 OkHttp Coroutines Flow Data Binding Navigation Component ViewModel LiveData Material Design Glide Gson PDF Viewer Library
Project Overview

The "Haryana Last" (project folder: "Last Kerala") is a native Android application designed to provide users with lottery results and number combination tools. The app fetches lottery data from a remote API and displays results in an organized, user-friendly interface. It allows users to view historical lottery results, check prize-winning numbers, and generate number combinations for analysis.


Technical Architecture

The application follows Clean Architecture principles with a clear separation of concerns:

Data Layer: Handles remote API communication, data transfer objects (DTOs), and repository implementations

Domain Layer: Contains business logic, use cases, domain models, and repository interfaces

UI Layer: Implements views, ViewModels, and user interaction logic using MVVM pattern


Key Technologies & Libraries

Language: Kotlin

Build System: Gradle with Kotlin DSL

Minimum SDK: 24 (Android 7.0)

Target SDK: 36 (Android 14+)

Dependency Injection: Hilt (Dagger Hilt Android)

Networking: Retrofit 2 with OkHttp for API calls

Image Loading: Glide

Async Operations: Kotlin Coroutines & Flow

UI Components:AndroidX Lifecycle (ViewModel, LiveData), Data Binding, Navigation Component, Material Design Components

PDF Viewing: Custom PDF viewer module (android-pdf-viewer)

Responsive Design: SDP/SSP (Scalable DP/SP) libraries

JSON Parsing: Gson

Application Features

1. Home Screen

The entry point of the application provides navigation to all main features:

First Prize Last Jodi Number: View historical jodi (pair) winning numbers

First Prize Last Number: View individual winning numbers

Number Combination: Generate permutations of 4-digit numbers

Show Result: View complete lottery result PDFs

Share App: Share the application with others

2. First Prize Jodi

Displays lottery jodi results organized by date and time slots:

Time Slots: 11:30 AM, 3:00 PM, 5:00 PM, 8:30 PM

Data Structure: Each entry includes date and winning jodi numbers for each time slot

UI: RecyclerView with custom adapter displaying results in card format

State Management: Loading, Success, Error, and Empty states

3. First Prize First

Similar to Jodi but displays single-digit first prize results:


Same time slot structure (11:30 AM, 3:00 PM, 5:00 PM, 8:30 PM)

Individual number results for each time slot

RecyclerView with custom adapter

Consistent state management pattern

4. Number Combination

A utility feature for generating number permutations:


Input: Accepts exactly 4-digit numbers

Processing: Generates all unique permutations of the input digits

Algorithm: Uses recursive backtracking to generate permutations

Validation: Ensures input is numeric and exactly 4 digits

Output: Displays sorted list of all possible combinations

Example: Input "1234" generates all 24 permutations (4! = 24)

5. Show Result

PDF viewer for complete lottery result documents:


Data Source: Fetches list of PDF URLs from API

Features:Download and display PDF files

Navigate between multiple PDFs (Previous/Next buttons)

Zoom and page navigation within PDFs

Loading states and error handling

Caching: Downloads PDFs to cache directory for performance

Error Handling: Displays error messages for failed downloads or invalid URLs


Project Structure


Last Kerala/

├── app/

│ ├── src/main/

│ │ ├── java/com/altaf/haryanalast/

│ │ │ ├── data/ # Data layer (API, DTOs, repositories)

│ │ │ ├── domain/ # Domain layer (models, use cases, mappers)

│ │ │ ├── ui/ # UI layer (fragments, viewmodels, adapters)

│ │ │ ├── di/ # Dependency injection modules

│ │ │ └── common/ # Base classes, extensions, utilities

│ │ ├── res/ # Resources (layouts, drawables, strings)

│ │ └── AndroidManifest.xml

│ └── build.gradle.kts

├── android-pdf-viewer/ # PDF viewer library module

├── build.gradle.kts

└── settings.gradle.kts