Skip to content

Simple Android Application for PassEntry

Notifications You must be signed in to change notification settings

Mohamedess107/PassEntry

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

N|Solid

Simple Android Application



Overview 🚀

Welcome to the PassEntry Android application repository! This project is designed to showcase a simple Android application integrated with a mock HTTP API.

Application Features 📱

1. Login Page 🔐

The application features a login page that accepts a username and password. Upon submission, the credentials are validated against the /login endpoint of the included mock API.

2. Tap History Page 🔄

Authenticated users can access the tap history page, displaying a list of pass taps retrieved from the /taps endpoint of the mock API.

Preview 📱

APK file📥

You can download the precompiled APK file of the debug version from HERE.

Images 🖼️

PassEntry App hexfa PassEntry App amir

Video 📽️

PassEntry App dehdarian fallah

Documentation 📜

  • Online Document

    For looking at the last document code version of this project, you can generate it by Dokka section.

    Also, you can see the first document version of the project on this link Documentation.

  • Dokka

    • I recommend Html document type

    • I recommend to use the JAVA JDK 18 and set it in your JAVA_HOME environment. after putting it in the system needs a restart

      • Dokka terminal commands
        Type Syntax
        Html ./gradlew.bat dokkaHtml
        Java doc ./gradlew.bat dokkaJavadoc
        Gfm ./gradlew.bat dokkaGfm
      • Output Location

        app -> build -> dokka

Mock API Integration 🤖

🌐 I've hosted the mock API on an online server accessible at http://154.62.108.207:3000. This server will be available until December 31, 2023. You can use this IP address for API integration. 🌐

Alternatively, if you prefer to run the mock API locally, execute the following command:

docker-compose up --build

This will launch the mock HTTP API, accessible at http://localhost:3000.

Mock API Endpoints 🌐

1. POST /login

Description 🚪

Authenticate a user and generate an API token.

Request 📤

  • Method: POST
  • URL: /login
  • Headers:
    • Content-Type: application/json
Request Body
{
  "username": "[email protected]",
  "password": "securepass"
}

Success Response ✅

If correct credentials are provided, the response body contains an API token for use with the /taps endpoint.

  • Status Code: 200 OK
Success Response Body
{
  "api-token": "your-api-token"
}

Error Response ❌

If incorrect credentials are provided, no token is returned.

  • Status Code: 401 Unauthorized
Error Response Body
{
  "error": "Unauthorized"
}

2. GET /taps

Description 📊

Retrieve a collection of pass tap history data.

Note: Include the bearer token returned by the /login endpoint in the request header for successful authentication.

Request 📥

  • Method: GET
  • URL: /taps
  • Headers:
    • Authorization: Bearer your-api-token

Success Response ✅

  • Status Code: 200 OK
  • Body:
[
  {
    "tappedAt": "2023-12-22T12:34:56.789Z",
    "status": "success",
    "readerId": "someReaderId"
  },
  {
    "tappedAt": "2023-12-23T12:34:56.789Z",
    "status": "fail",
    "readerId": "someReaderId"
  }
  // ... more data
]

Error Response ❌

If the authorization token is missing or invalid, no data is returned.

  • Status Code: 401 Unauthorized
Error Response Body
{
  "error": "Unauthorized"
}

Technologies and Libraries 🛠️

The PassEntry Android application is built using the following technologies and libraries:

  • Kotlin: A modern and concise programming language for Android development.

  • Hilt: A dependency injection library for Android that simplifies the process of injecting dependencies into Android components.

  • LiveData: A lifecycle-aware data holder class in Android Jetpack that allows data to be observed for changes and provides automatic updates to the UI.

  • Dokka: A documentation generation tool for Kotlin and Java that generates API documentation in various formats, including HTML and Markdown.

  • Junit: A popular unit testing framework for Java and Kotlin that provides a set of annotations and assertions for writing automated tests.

  • Mockito: A mocking framework for unit testing in Java and Kotlin that allows the creation of mock objects to simulate dependencies and behavior during testing.

  • Room: An SQLite database library for Android that provides an abstraction layer over SQLite and enables efficient database operations using annotations and generated code.

  • Moshi: A modern JSON parsing and serialization library for Kotlin and Java that makes it easy to convert JSON data to Kotlin/Java objects and vice versa.

  • Gson: Gson is a powerful JSON library that simplifies JSON parsing and serialization in Android through a flexible reflection-based approach.

  • RxJava:RxJava is a Java VM library that provides a reactive programming model for composing asynchronous and event-based programs using observable sequences.

  • Retrofit:Retrofit is a type-safe HTTP client for Android and Java, making it easier to consume RESTful web services.

About

Simple Android Application for PassEntry

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 100.0%