读取android手机流量信息(3)
// TODO Auto-generated method stub
/* */
objHandler.removeCallbacks(mTasks);
super.onDestroy();
}
public void DisplayToast(String str)
{
Toast.makeText(this,str,Toast.LENGTH_SHORT).show();
}
public void readdev()
{
FileReader fstream = null;
try {
fstream = new FileReader(DEV_FILE);
}
catch (FileNotFoundException e) {
DisplayToast("Could not read " + DEV_FILE);
}
BufferedReader in = new BufferedReader(fstream, 500);
String line;
String[] segs;
String[] netdata;
int count=0;
int k;
int j;
try {
while ((line = in.readLine()) != null) {
segs = line.trim().split(":");
if(line.startsWith(ETHLINE))
{
netdata=segs[1].trim().split(" ");
for(k=0,j=0;k<netdata.length;k++)
{
if(netdata[k].length()>0)
{
ethdata[j]=netdata[k];
j++;
}
}
}
else if(line.startsWith(GPRSLINE))
{
netdata=segs[1].trim().split(" ");
for(k=0,j=0;k<netdata.length;k++)
相关新闻>>
- 发表评论
-
- 最新评论 更多>>