Microproject Report: Bluetooth Control App for Android 12+
**Student Name:** Abhishek
**Course:** Diploma in Computer Engineering
**Semester:** 5th Semester
**Subject:** Mobile Application Development (MAD)
**Project Title:** Bluetooth Control App for Android 12+
1. Introduction
This microproject focuses on developing a Bluetooth Control Application for Android
devices. Due to security restrictions in Android 12+, the application cannot directly enable
or disable Bluetooth without user interaction. This report explores different methods to
achieve Bluetooth control within these restrictions.
2. Objectives
1. Develop an Android application that provides Bluetooth control functionality.
2. Explore different methods to turn Bluetooth on/off in Android 12+.
3. Implement the most efficient and Play Store-compliant approach.
3. Methodology
To control Bluetooth, the following approaches were explored:
3.1 Using ACTION_REQUEST_ENABLE (Recommended)
This is the official method to request the user to enable Bluetooth through a system dialog.
It is recommended for Play Store applications and does not require additional permissions
beyond the standard Bluetooth permissions.
3.2 Using ADB Shell Commands (Requires Root)
This method allows the app to toggle Bluetooth programmatically using ADB shell
commands. However, it requires either root access or granting `WRITE_SECURE_SETTINGS`
permission manually via ADB, which limits its usability.
3.3 Using Accessibility Service (No Root)
This method enables Bluetooth automation by simulating user interaction within system
settings. It works without root access but requires enabling Accessibility Service, which may
be restricted by Google Play Store policies.
4. Implementation
The application was developed using Android Studio with Java. The manifest file includes
necessary permissions, and the main activity implements the Bluetooth enabling/disabling
functionality based on the chosen approach.
5. Challenges Faced
1. Direct Bluetooth toggle without user interaction is restricted in Android 12+.
2. ADB and root-based solutions are not feasible for most users.
3. Accessibility-based solutions require manual user permissions.
6. Conclusion
The final implementation uses `ACTION_REQUEST_ENABLE` to allow users to turn
Bluetooth on through a system prompt. While other methods offer automation, they are
limited by root requirements or Play Store restrictions. This project highlights the evolving
security landscape of Android development.