Listen to own application uninstall event on Android

Here is a way you can get uninstall event of your own app. Using inotify in native code. For example: You can using inotify_add_watch to monitor your application’s data cache folder like: /data/data/your-package-name/cache. When your application gets uninstalled, you can get the folder’s delete event. Another key point is that inotify should run in a … Read more

Broadcast Receiver Not Working After Device Reboot in Android

Here’s a tested and working solution on both the devices that you mentioned, OnePlus and Mi. As you said the auto-start prevention feature on OnePlus and Mi devices prevent apps from starting up their services automatically on boot complete so as to improve the overall device boot speed and battery performance. However, there’s a workaround … Read more

How to get sms sent confirmation for each contact/person in android?

This is a very simple example to demonstrate the use of the send and delivery PendingIntents available for all of the SmsManager#send*() methods, and attaching data to those to easily differentiate the results in the Receiver. Attaching that data is as simple as putting extras on the Intents backing the PendingIntents we pass to the … Read more

Android Broadcast Receiver bluetooth events catching

In order to catch Bluetooth state changes (STATE_OFF, STATE_TURNING_ON, STATE_ON, STATE_TURNING_OFF), do this: First, add Bluetooth permission to your AndroidManifest file: <uses-permission android:name=”android.permission.BLUETOOTH” /> Create a BroadcastReceiver in your Activity or Service: private final BroadcastReceiver mBroadcastReceiver1 = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) … Read more