Hi, Android has a UEvent Listener in the Application Framework. This receives the UEvent from the Kernel.
For BatteryStatus: You may want to look at frameworks/base/services/java/com/android/server/BatteryService.java Similarly, also at BatteryServer.cpp(corresponding JNI..) Basically the battery service gets info from the JNI and packs them into an intent and broadcasts it. Intent : Action_Battery_Changed You can register to listen this intent and extract every little detail from this :) BTW, Nothing stops you from writing a C program that can catch the UEvents. You have to write a Netlink Socket receiver..in order to do that. Just Curious, Why you want to do that in C ? [If you are Ok to that in Java, then its very simple & easy..] On Mon, Jul 18, 2011 at 4:45 PM, Hemant <[email protected]> wrote: > I want to handle uevent in user-space mainly for battery status > changed in my application. > Can this be done using C program? > Can this be done by calling a select() on one of the sysfs which > indicates change in battery voltage? > How Android polls uevents from kernel? > > Br/ > Hvr > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- Regards Durgadoss -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

