I’m developing an application in which I want to check like to which power source my device is connected to? I know it is possible by some way but I couldn’t figure it out. Thanks for helping.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Depending on what information you’re after a BatteryManager intent may be more useful.
Make a class extending BroadcastReceiver.
Make an intent filter for Intent.ACTION_BATTERY_CHANGED
registerReceiver
Don’t forget to unregisterReceiver when you are done.