Will Verduzco · Jul 27, 2013 at 10:00 am

Read Build.prop Values from Your App without Root

We’ve featured plenty of tools in the past that allow an end-user to modify his or her own build.prop. We’ve also featured a set of tools for app developers to incorporate that allow applications to modify the file. These (obviously) all require root access, as you’re modifying system settings. However, to date we haven’t featured a method of reading the build.prop from an app.

There are plenty of reasons why an app developer would want read-only access a device’s build.prop. Be it to know about its software or hardware configuration, or simply to peek into some system settings, looking into this treasure trove of information is potentially quite useful for an app developer. However, requiring root access to do so is unnecessary from both user hassle and security standpoints.

In a quest to access the build.prop from his own app without resorting to root, XDA Forum Member torpedo mohammadi wrote a couple of lines of code and shared it with the community. The way he goes about it can be summarized in his explanation:

1. Make a process which executes “getprop” from the “/system/bin/getprop” directory and initialize the String which we want to get (ro.board.platform in example).
2. Make a BufferedReader which gets the value (String) by retrieving the data from a inputStreamReader().
3.Convert the BufferedReader to String.

Head over to the original thread to get started, copy the code, and get it implemented into your app.


_________
Want something on the XDA Portal? Send us a tip!
Faiz Malkani · Mar 1, 2015 at 10:01 am · no comments

Watch “Samsung Galaxy Unpacked” Event Live Stream Here

It's that time of the year again, when the largest players in the mobile sphere gather in Barcelona for MWC, and one of the most highly anticipated unveilings is the next iteration of Samsung's Galaxy S series, Android's biggest OEM and one of the best selling series in the world. Numerous leaks have ensured that nothing mysterious remains about the supposed Galaxy S6 and S6 Edge, with images of both devices from multiple angles, as well as side by side shots and...

XDA NEWS
Faiz Malkani · Mar 1, 2015 at 09:48 am · no comments

Watch HTC’s “Utopia In Progress” Live Stream Here

MWC is here, and two of Android's biggest OEMs, HTC and Samsung are gearing up to launch their flagships. The rumored HTC M9 is no stranger to the camera and various leaks have showcased the device from all angles, with cranked up internals and a look similiar to its predecessor. Despite the extensive nature of these leaks, actual announcement garners a lot of anticipation and is happening at an HTC event titled "Utopia in Progress", with the live stream available right here:

XDA NEWS
Faiz Malkani · Mar 1, 2015 at 09:02 am · 1 comment

Huawei Watch Unveiled, Best-Looking Wear Device to Date?

When Google announced its wearables initiative around this time last year with LG and Motorola being the frontrunning hardware partners, many were skeptical about the endeavor. However, in the time since then, the platform has grown in leaps and bounds and what started off as a two manufacturer arena, soon expanded to include all the big OEMs out there. Today marks another step in Android Wear's advent, as one of the relatively smaller OEMs, Huawei, took the wraps off the...

XDA NEWS
Share This