Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 23rd, 2013  |  syntax: None  |  size: 0.55 KB  |  views: 26  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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);
clone this paste RAW Paste Data