java - Can not retrieve CellID and LAC for the current cell -
i tried retrieve cid , lac connected cell, using
public void getcid(){ int cid; int lac; gsmcelllocation xxx = new gsmcelllocation(); cid = xxx.getcid(); lac = xxx.getlac(); toast output = toast.maketext(getapplicationcontext(), "base station lac "+lac+"\n" +"base station cid " +cid, toast.length_short); output.show(); }
the thing -1 value both parameters (i on 2g). may wrong or there way cid , lac of current cell?
telephonymanager telephonymanager = (telephonymanager) context.getsystemservice(context.telephony_service); celllocation location = telephonymanager.getcelllocation(); gsmcelllocation gsmlocation = (gsmcelllocation) location; int cellid = gsmlocation.getcid(); int lac = gsmlocation.getlac();
Comments
Post a Comment