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!

Will Verduzco

willverduzco is an editor on XDA-Developers, the largest community for Android users. Will Verduzco is the Portal Administrator for the XDA-Developers Portal. He has been addicted to mobile technology since the HTC Wizard. But starting with the Nexus One, his gadget love affair shifted to Google's little green robot. He is also a Johns Hopkins University graduate in neuroscience and is now currently studying to become a physician. View willverduzco's posts and articles here.
Mathew Brack · Aug 1, 2015 at 09:00 am · no comments

Voices Of XDA: Orbiting The Earth With Android

Editor’s note: This week's feature has been written by forum member RowHanSolo and takes a look at the exciting prospect of launching satellites fitted with little more than an Android phone as an onboard computer. From a university to NASA, multiple projects like this have launched!   Technology is an ever-growing industry, regardless of which corner you look at. However, each area of technology has its limitations on what it can do and how far it can expand. For satellite technology,...

XDA NEWS
Mike McCrary · Jul 31, 2015 at 03:56 pm · 1 comment

CloudPlayer: DIY HiFi Music Streaming Solution

In our Helpful Guide to Music Streaming Services, we mentioned several different services that offer ways to stream catalogs of music directly to your device. While each service has their benefits and drawbacks, the common theme among them is to give you access to a vast library of music without the need to store your own, and charge you a monthly fee for the privilege. But what if you already had access to your own catalog of music? Sure, there...

XDA NEWS
GermainZ · Jul 31, 2015 at 01:03 pm · 1 comment

Optimize Battery Life with This Useful App

Battery life is an important aspect of your smartphone, especially if you use it for more than just calls on the go. Since you're on XDA, you probably do and want to get the most out of your battery. Now, you can't magically expand its size but no matter how much its capacity is, you should make sure it's not draining faster than it should be. Your phone's processor runs at different frequencies when you're using the device. The CPU...

XDA NEWS