Skip to content

cxy7988/cardQueryApp_android

Repository files navigation

Card Query Android App

This is a campus fee query Android application that can check meal card balance, water fee balance, and electricity fee balance.

Features

  • Email verification login (@wku.edu.cn)
  • Dormitory information binding
  • Meal card balance query
  • Water fee balance query
  • Electricity fee balance query
  • Query history records
  • Developer mode (custom API parameters)
  • Local data storage for privacy protection

Technical Architecture

  • UI Framework: Jetpack Compose
  • Architecture Pattern: MVVM + Repository
  • Network Requests: Retrofit + OkHttp
  • Data Storage: DataStore Preferences
  • Asynchronous Processing: Kotlin Coroutines + Flow
  • Dependency Injection: Manual dependency injection

Project Structure

app/src/main/java/com/wku/cardquery/
├── data/                   # Data layer
│   ├── models/            # Data models
│   ├── Config.kt          # Configuration management
│   └── RoomDataManager.kt # Room data management
├── network/               # Network layer
│   ├── ApiService.kt      # API interface definitions
│   └── NetworkClient.kt   # Network client
├── repository/            # Repository layer
│   ├── AuthRepository.kt  # Authentication repository
│   └── QueryRepository.kt # Query repository
├── viewmodel/             # ViewModel layer
│   ├── AuthViewModel.kt   # Authentication ViewModel
│   └── MainViewModel.kt   # Main ViewModel
├── ui/                    # UI layer
│   ├── screen/           # Screens
│   │   ├── LoginScreen.kt # Login screen
│   │   └── MainScreen.kt  # Main screen
│   └── theme/            # Theme
└── MainActivity.kt        # Main Activity

Build Requirements

  • Android Studio Flamingo or higher
  • Android SDK API 24+ (Android 7.0)
  • Kotlin 1.9.20+
  • Gradle 8.2+

Configuration Instructions

Default Configuration

The app includes default API configuration parameters and can be run directly upon first use. For custom configuration, modify settings in the app's developer mode.

Room Data

Room information is stored in the assets/rooms_data.json file, containing building, floor, and room information for the school.

Network Configuration

  • Login verification server: https://wkuquery.asia:5000/
  • Meal card query interface: https://webapp.xiaofubao.com/
  • Water and electricity fee query interface: https://application.xiaofubao.com/

Usage Instructions

  1. Registration and Login: Register and verify using @wku.edu.cn email
  2. Bind Dormitory: Select building, floor, and room number
  3. Start Querying: Click the query button to get real-time data
  4. View History: Check historical query records
  5. Configure Settings: Customize API parameters in developer mode

Privacy and Security

  • All data stored locally, not uploaded to third-party servers
  • Sensitive configuration information saved only on local device
  • Network requests only access official query interfaces

Developer Notes

Obtaining API Parameters

To customize API parameters, follow these steps:

  1. Download and configure network packet capture tool (such as Fiddler Everywhere)
  2. Perform a query operation on the official query page
  3. Get the shiroJID value from the request header Cookie
  4. Get the corresponding ID and area code from request parameters

Adding New Features

  1. Add network request methods in the corresponding Repository
  2. Add business logic in ViewModel
  3. Add corresponding UI components in the UI layer

License

This project follows the MIT License. See LICENSE file for details.

Contributing

Issues and Pull Requests are welcome to help improve this project.

Version History

  • v1.0.0: Initial version with basic functionality implemented

About

This is the implementation of the cardQuery app on the Android platform.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published