pub struct AndroidSystemProperties { /* private fields */ }
Expand description

An object that can retrieve android system properties.

Example

use android_system_properties::AndroidSystemProperties;

let properties = AndroidSystemProperties::new();

if let Some(value) = properties.get("persist.sys.timezone") {
   println!("{}", value);
}

Implementations

Create an entry point for accessing Android properties.

Retrieve a system property.

Returns None if the operation fails.

Example
let properties = AndroidSystemProperties::new();

if let Some(value) = properties.get("persist.sys.timezone") {
    println!("{}", value);
}

Retrieve a system property using a CStr key.

Returns None if the operation fails.

Example
let properties = AndroidSystemProperties::new();

let key = unsafe { CStr::from_bytes_with_nul_unchecked(b"persist.sys.timezone\0") };
if let Some(value) = properties.get_from_cstr(key) {
    println!("{}", value);
}

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.