linux - How to calculate when the network card opens a connection on Android -
i trying figure out if there way know when app opens internet connection , wakes network card.
so example, have phone off , decide search http://www.cnn.com
in case, lets imagine no background data going on app, connection idle @ time call website. want know when network card opened connection load page.
i have found no apis this. looking @ telephonymanager has different states of network card (dormant, inout, none, etc), found phone never goes dormant, believe due fast dormancy. have been looking @ linux filesystem files might contain information driver, have found none.
i read nice article att explains mobile networks
thanks.
ok answer use signalstrength class , phonestatelistener's onsignalstrengthschanged in order measure radio signal. helps detect when connecdtion made. referenced att's aro app:
https://developer.att.com/application-resource-optimizer http://developer.android.com/reference/android/telephony/signalstrength.html http://developer.android.com/reference/android/telephony/phonestatelistener.html#onsignalstrengthschanged(android.telephony.signalstrength)
Comments
Post a Comment