-1

In android if we want to set property from cpp file how it can be done. what headers can be included and what api we can call directly to set property.

Tried executing setprop command from cpp file that works but wanted different approach.

1 Answer 1

2

we can set property directly by including the below header in cpp file

#include <cutils/properties.h>

and setting property using below command

property_set("ro.myprop.server", "1");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.