Function setprop
Source pub fn setprop(name: &str, value: &str) -> Result<(), String>
Expand description
Sets the property value if it exists or creates new one with specified value
examples/property_set.rs (
line 2)
1fn main() {
2 android_properties::setprop("hello.world", "hello").expect("Cannot set android property");
3}
More examples
Hide additional examples
examples/property_refresh.rs (
line 6)
5fn main() {
6 setprop(HELLO_WORLD_PROPERTY, "initial value").expect("Cannot set android property");
7 let hello_world = AndroidProperty::new(HELLO_WORLD_PROPERTY);
8 println!("Initial property: {}", hello_world);
9
10 setprop(HELLO_WORLD_PROPERTY, "refreshed value").expect("Cannot set android property");
11 println!("Refreshed property: {}", hello_world);
12}