Android Utility <2K – 4K>

Android Utility <2K – 4K>

Every Android developer, at some point, finds themselves repeating the same tasks: clearing cache, checking battery stats, or toggling settings quickly. That's where building a utility app comes in.

<uses-permission android:name="android.permission.CLEAR_APP_CACHE" /> <uses-permission android:name="android.permission.BATTERY_STATS" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> : Starting with Android 11, CLEAR_APP_CACHE is restricted for third‑party apps. You'll need to use the Storage Access Framework or guide users to system settings. For this demo, we'll handle it gracefully. Step 3: Build the Main UI Create a simple activity_main.xml with three buttons and a TextView for results: android utility

<Button android:id="@+id/btnStorageInfo" android:text="Analyze Storage" ... /> Every Android developer, at some point, finds themselves

return "📁 Storage:\nTotal: ${formatSize(total)}\nUsed: ${formatSize(used)}\nFree: ${formatSize(available)}" } You'll need to use the Storage Access Framework

<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="16dp"> <Button android:id="@+id/btnClearCache" android:text="Clear App Cache" ... />

Have you built a utility app before? Share your favorite tool or feature in the comments below! Happy coding! 🚀

<Button android:id="@+id/btnBatteryStatus" android:text="Check Battery" ... />