Exemple #1
0
  public HiddenService() {
    super();
    if (null == MainActivity.DB_list) {
      MainActivity.DB_list = new ArrayList<DataProvider>();

      DataProvider dp = new DataProvider_battery(MainActivity.context);
      dp.onCreate();
      MainActivity.DB_list.add(dp);
      dp = new DataProvider_wifi(MainActivity.context);
      dp.onCreate();
      MainActivity.DB_list.add(dp);
      dp = new DataProvider_threeg(MainActivity.context);
      dp.onCreate();
      MainActivity.DB_list.add(dp);
      dp = new DataProvider_bluetooth(MainActivity.context);
      dp.onCreate();
      MainActivity.DB_list.add(dp);
      /*
      			DataProvider dp = new DataProvider_battery( MainActivity.context, null );
      			MainActivity.DB_list.add( dp );
      			dp = new DataProvider_wifi( MainActivity.context, dp.db() );
      			MainActivity.DB_list.add( dp );
      			dp = new DataProvider_threeg( MainActivity.context, dp.db() );
      			MainActivity.DB_list.add( dp );
      			dp = new DataProvider_bluetooth( MainActivity.context, dp.db() );
      			MainActivity.DB_list.add( dp );
      //*/
    }
  }
Exemple #2
0
  /**
   * displays data for different entities
   *
   * @param title
   * @param DB_table
   */
  private void displayData(String title, String tablename) {
    //		Log.d(TIG, TAG + "::displayData()");

    XYPlot plot = (XYPlot) findViewById(R.id.xyplot);
    arrayadapter.clear();
    List<Number> xseries = new ArrayList<Number>();
    List<Number> yseries = new ArrayList<Number>();

    if (tablename.equals(SystemInfo.DB_TABLENAME_BATTERY)) {
      DB.generatePlotData_battery(arrayadapter, xseries, yseries);
      this.drawGraph(plot, xseries, yseries, title, SystemInfo.DB_TABLENAME_BATTERY);
    } else if (tablename.equals(SystemInfo.DB_TABLENAME_WIFI)) {
      DB.generatePlotData_wifi(arrayadapter, xseries, yseries);
      this.drawGraph(plot, xseries, yseries, title, SystemInfo.DB_TABLENAME_WIFI);
    } else if (tablename.equals(SystemInfo.DB_TABLENAME_THREEG)) {
      DB.generatePlotData_threeg(arrayadapter, xseries, yseries);
      this.drawGraph(plot, xseries, yseries, title, SystemInfo.DB_TABLENAME_THREEG);
    }
  }