android - Instant signal strength -
i need find way measure current signal strength of android phone, without need register phonestatelistener god knows when returns actual asu.
something like:
int signal = getphonesignal();
any plz?
thanks!
if have closer on android sources see after registering phonestatelistener
have instant notification:
public void listen(phonestatelistener listener, int events) { string pkgfordebug = mcontext != null ? mcontext.getpackagename() : "<unknown>"; try { boolean notifynow = (getitelephony() != null); mregistry.listen(pkgfordebug, listener.callback, events, notifynow); } catch (remoteexception ex) { // system process dead } }
so can create own timer , on timer update register new listener , after receiving instant update remove passing same listener object , set events argument listen_none
.
of course can't call best practice alternative can see calculate signal strength based on signal strengths getneighboringcellinfo()
.
p.s. not god knows when phonestatelistener
triggered ;)
Comments
Post a Comment