SHARE
TWEET

Untitled

a guest Jun 23rd, 2013 30 Never
  1. #include <cutils/properties.h>
  2.  
  3.     char key[PROPERTY_KEY_MAX];
  4.     char value[PROPERTY_VALUE_MAX];
  5.  
  6.     strncpy(key, "test.rate", PROPERTY_KEY_MAX);
  7.     property_get(key, value, "");
  8.     int rate = 0;
  9.     rate = atoi(value);
  10.     TRACE("####### Got %d from property test.rate", rate);
  11.  
  12.     strncpy(value, "15", PROPERTY_VALUE_MAX);
  13.     int ret = property_set(key, value);
  14.     TRACE("####### property_set(%s)for test.rate, retVal=%d",value, ret);
  15.  
  16.     property_get(key, value, "");
  17.     rate = atoi(value);
  18.     TRACE("####### Got %d from property test.rate", rate);
RAW Paste Data
Top