How to declare new system property in Android?

I want to add a new system property in android code, a property I can set and get by property_set() and property_get() in native code.

How to add a new system property? For example I want to declare new sys.newprop

Answers


go to init.rc or your proprietary init.xyz.rc

declare new property

setprop sys.newprop 0

then now you can use it in your code

#include <cutils/properties.h>
property_set("sys.newprop","1");

Why not simply use a HashMap<String,Object>?


Need Your Help

Raise an event from within a task

c# events

I have a manager class which spawns a task to complete a long running operation.

Flask application error when uploading to Heroku

python git heroku deployment flask

I built a simple website with Flask and it is running fine on localhost.