Skip to content

tinvu11/battery-full-notification

Repository files navigation

Battery Full Notification

Ứng dụng Android thông báo khi pin sạc đầy.

📱 Screenshots

Screen Preview Screen Preview
Home Screen Settings

✨ Chức năng

  • Thông báo pin đầy: Nhận thông báo khi pin đạt mức yêu cầu
  • Âm thanh tùy chỉnh: Chọn âm thanh thông báo
  • Hiển thị thông tin cơ bản về pin: Nhiệt độ, sức khoẻ, điện app, và công nghệ pin

🛠️ Cấu hình Gradle & SDK

android {
    namespace = "com.base.baterynotification"
    compileSdk = 36
    
    defaultConfig {
        applicationId = "com.base.baterynotification"
        minSdk = 26
        targetSdk = 36
        versionCode = 1
        versionName = "1.0"
    }
    
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_11
        targetCompatibility = JavaVersion.VERSION_11
    }
    
    buildFeatures {
        viewBinding = true
    }
}

Quyền ứng dụng

  • POST_NOTIFICATIONS - Gửi thông báo khi pin đầy
  • RECEIVE_BOOT_COMPLETED - Khởi động lại dịch vụ sau khi khởi động lại thiết bị
  • FOREGROUND_SERVICE - Chạy dịch vụ theo dõi pin ở chế độ foreground

📁 Cấu trúc dự án

BatteryFullNotification/
├── app/
│   ├── src/
│   │   ├── main/
│   │   │   ├── java/com/base/baterynotification/
│   │   │   │   ├── data/
│   │   │   │   │   ├── model/          # Data models (BatteryInfo)
│   │   │   │   │   └── repository/     # Repository pattern (BatteryRepository)
│   │   │   │   ├── ui/
│   │   │   │   │   ├── main/           # MainActivity, HomeFragment, MainViewModel
│   │   │   │   │   └── setting/        # SettingFragment, SettingViewModel
│   │   │   │   ├── utils/              # Utility classes
│   │   │   │   │   ├── BatteryUtil.java          # Battery helper functions
│   │   │   │   │   ├── BatteryMonitorService.java # Background service
│   │   │   │   │   ├── BatteryCircleView.java    # Custom view
│   │   │   │   │   ├── PremiumManager.java       # Premium features
│   │   │   │   │   └── Event.java                # LiveData event wrapper
│   │   │   │   └── BatteryApp.java     # Application class
│   │   │   ├── res/
│   │   │   │   ├── layout/             # XML layouts
│   │   │   │   ├── drawable/           # Icons, shapes
│   │   │   │   ├── values/             # Strings, colors, themes
│   │   │   │   ├── raw/                # Sound files
│   │   │   │   ├── menu/               # Menu resources
│   │   │   │   └── navigation/         # Navigation graphs
│   │   │   └── AndroidManifest.xml
│   │   ├── androidTest/                # Instrumented tests
│   │   └── test/                       # Unit tests
│   ├── build.gradle.kts                # App-level Gradle config
│   └── proguard-rules.pro              # ProGuard rules
├── gradle/
│   ├── libs.versions.toml              # Dependencies version catalog
│   └── wrapper/
├── media/                              # Screenshots & demo images
├── build.gradle.kts                    # Project-level Gradle config
├── settings.gradle.kts
├── gradlew
├── gradlew.bat
└── README.md

🏗️ Kiến trúc

  • Pattern: MVVM (Model-View-ViewModel)
  • Repository: BatteryRepository quản lý dữ liệu pin
  • ViewModel: MainViewModel, SettingViewModel quản lý UI state
  • Service: BatteryMonitorService để theo dõi trạng thái pin
  • UI: View Binding với Fragment Navigation
  • Async: LiveData & Event wrapper

📝 License

Distributed under the MIT License. See LICENSE for more information.

👤 Author

Tín Vũ


Made with ❤️ for better battery care

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages