Exemplo n.º 1
0
 // Create Data
 public synchronized void createHisData(HisData his) {
   // Log.i(TAG,"Create HisData()");
   SQLiteDatabase db = openDatabase();
   ContentValues args = new ContentValues();
   args.put(COL_ID, his.get_id());
   args.put(COL_USER_ID, his.getUserId());
   args.put(COL_DEVICE_SN, his.getDeviceSn());
   args.put(COL_DEVICE_TIME, his.getDeviceTime());
   args.put(COL_DEVICE_ID, his.getDeviceId());
   args.put(COL_DEVICE_TYPE, his.getDeviceType());
   args.put(COL_READ_TIME, dateFormat.format(System.currentTimeMillis()));
   args.put(COL_AC, his.getAc());
   args.put(COL_PC, his.getPc());
   args.put(COL_BHP, his.getBhp());
   args.put(COL_BLP, his.getBlp());
   args.put(COL_PULSE, his.getPulse());
   args.put(COL_SEX, his.getSex());
   args.put(COL_UPLOADED, 0);
   args.put(COL_AGE, his.getAge());
   args.put(COL_INPUT_TYPE, his.getInputType());
   long i = db.insert(TABLE_HISDATA, null, args);
   db.close();
   // Log.i(TAG, "long i:"+i);
   return;
 }
Exemplo n.º 2
0
 // Create glucose record
 public synchronized long createGlucose(HisData hisData) {
   // Log.i(TAG,"Create glucose()");
   SQLiteDatabase db = openDatabase();
   ContentValues args = new ContentValues();
   args.put(COL_ID, hisData.get_id());
   args.put(COL_USER_ID, hisData.getUserId());
   args.put(COL_DEVICE_SN, hisData.getDeviceSn());
   args.put(COL_DEVICE_TIME, hisData.getDeviceTime());
   args.put(COL_DEVICE_TYPE, Constant.BIODATA_DEVICE_TYPE_BLOOD_GLUCOSE);
   args.put(COL_READ_TIME, dateFormat.format(System.currentTimeMillis()));
   args.put(COL_AC, hisData.getAc());
   args.put(COL_PC, hisData.getPc());
   args.put(COL_NM, hisData.getNm());
   args.put(COL_UPLOADED, Constant.DATA_IS_NOT_UPLOAD);
   args.put(COL_INPUT_TYPE, hisData.getInputType());
   long i = db.insert(TABLE_HISDATA, null, args);
   db.close();
   return i;
 }