读取android手机流量信息(2)

来源:未知 责任编辑:责任编辑 发表时间:2013-11-15 19:45 点击:

    private int intCounter=0;

    private int mHour; 

private int mMinute; 

private int mYear; 

private int mMonth; 

private int mDay;

private String mdate;

final public String DEV_FILE = "/proc/self/net/dev";//系统流量文件

String[] ethdata={"0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"};

String[] gprsdata={"0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"};

String[] wifidata={"0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"};

String data="0,0,0,0,0,0,0,0,0,0,0,0";//对应on.txt里面的格式

final String ETHLINE="  eth0";//eth是以太网信息 tiwlan0 是 Wifi  rmnet0 是 GPRS

final String GPRSLINE="rmnet0";

final String WIFILINE="tiwlan0";

final String TEXT_ENCODING = "UTF-8";

 

final public String ONPATH = "/data/data/zy.dnh/on.txt";

final public String LOGPATH = "/data/data/zy.dnh/log.txt";

    private Runnable mTasks = new Runnable() 

    {

 

        public void run()//运行该服务执行此函数

        {

      refresh();

    

    

          intCounter++;

         //DisplayToast("Counter:"+Integer.toString(intCounter));

         objHandler.postDelayed(mTasks, 3000);//每3000毫秒执行一次

       } 

    };

 

  @Override

  public void onStart(Intent intent, int startId)

  {

    // TODO Auto-generated method stub

 

 

    objHandler.postDelayed(mTasks, 0);

    super.onStart(intent, startId);

  }

 

  @Override

  public void onCreate()

  {

    // TODO Auto-generated method stub

 

 

    super.onCreate();

  }

 

  @Override

  public IBinder onBind(Intent intent)

  {

    // TODO Auto-generated method stub

 

 

    return null;

  }

 

  @Override

  public void onDestroy()

  {

发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
用户名: 验证码:点击我更换图片
最新评论 更多>>

推荐热点

  • Android 完全退出程序
  • 原创:Android应用开发-Andorid歌词秀,含源码
  • android 屏幕保护
  • Android手机软件汉化教程---第四课 dex文件汉化
  • 众多Android 开源项目推荐,给力工作给力学习
  • Android Audio代码分析4
  • Android得到已安装的应用程序信息!
  • Android开发者指南(29) —— USB Host and Accessory
  • Android成长的幕后推手:工程师鲁宾
网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
Copyright © 2008-2015 计算机技术学习交流网. 版权所有

豫ICP备11007008号-1