Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7756137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:44:35+00:00 2026-06-01T12:44:35+00:00

I’m trying to parse the getprop command of android. Here’s the code I’m using.

  • 0

I’m trying to parse the getprop command of android. Here’s the code I’m using.

public class PropManager {
    public String propReader() {
        InputStream inputstream = null;
        try {
            inputstream = Runtime.getRuntime().exec("/system/bin/getprop")
                    .getInputStream();
        } catch (IOException e) {
            e.printStackTrace();
        }
        String propval = "";
        try {

            propval = new Scanner(inputstream).useDelimiter("\\A").next();
            System.out.println(propval);

        } catch (NoSuchElementException e) {
            e.printStackTrace();
        }
        return propval;
    }

    public String DeviceProp(String propval) {
        String deviceprop = "none";
        try {
            Scanner scanner = new Scanner(propval).useDelimiter("\\n");
            scanner.findWithinHorizon(
                    Pattern.compile("\\[ro.product.model\\].*\\[([^\\0]+)\\]"),
                    0);
            mbvsprop = scanner.match().group(1);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return deviceprop;
    }

}

However I’m getting an error, here’s the StackTraCE :

03-30 08:07:49.317: I/System.out(5055): [ARGH]: [ARGH]
03-30 08:07:49.317: I/System.out(5055): [dalvik.vm.heapsize]: [48m]
03-30 08:07:49.317: I/System.out(5055): [dalvik.vm.stack-trace-file]: [/data/anr/traces.txt]
03-30 08:07:49.317: I/System.out(5055): [dev.bootcomplete]: [1]
03-30 08:07:49.317: I/System.out(5055): [gsm.current.phone-type]: [1]
03-30 08:07:49.317: I/System.out(5055): [gsm.defaultpdpcontext.active]: [true]
03-30 08:07:49.317: I/System.out(5055): [gsm.network.type]: [UMTS:3]
03-30 08:07:49.317: I/System.out(5055): [gsm.nitz.time]: [1333077079197]
03-30 08:07:49.317: I/System.out(5055): [gsm.operator.alpha]: [Android]
03-30 08:07:49.317: I/System.out(5055): [gsm.operator.iso-country]: [us]
03-30 08:07:49.317: I/System.out(5055): [gsm.operator.isroaming]: [false]
03-30 08:07:49.317: I/System.out(5055): [gsm.operator.numeric]: [310260]
03-30 08:07:49.317: I/System.out(5055): [gsm.sim.operator.alpha]: [Android]
03-30 08:07:49.327: I/System.out(5055): [gsm.sim.operator.iso-country]: [us]
03-30 08:07:49.327: I/System.out(5055): [gsm.sim.operator.numeric]: [310260]
03-30 08:07:49.327: I/System.out(5055): [gsm.sim.state]: [READY]
03-30 08:07:49.327: I/System.out(5055): [gsm.version.ril-impl]: [android reference-ril 1.0]
03-30 08:07:49.327: I/System.out(5055): [init.svc.adbd]: [running]
03-30 08:07:49.327: I/System.out(5055): [init.svc.bootanim]: [stopped]
03-30 08:07:49.327: I/System.out(5055): [init.svc.console]: [running]
03-30 08:07:49.327: I/System.out(5055): [init.svc.debuggerd]: [running]
03-30 08:07:49.327: I/System.out(5055): [init.svc.goldfish-logcat]: [stopped]
03-30 08:07:49.327: I/System.out(5055): [init.svc.goldfish-setup]: [stopped]
03-30 08:07:49.327: I/System.out(5055): [init.svc.installd]: [running]
03-30 08:07:49.327: I/System.out(5055): [init.svc.keystore]: [running]
03-30 08:07:49.327: I/System.out(5055): [init.svc.media]: [running]
03-30 08:07:49.327: I/System.out(5055): [init.svc.netd]: [running]
03-30 08:07:49.327: I/System.out(5055): [init.svc.qemu-props]: [stopped]
03-30 08:07:49.327: I/System.out(5055): [init.svc.qemud]: [running]
03-30 08:07:49.327: I/System.out(5055): [init.svc.ril-daemon]: [running]
03-30 08:07:49.327: I/System.out(5055): [init.svc.servicemanager]: [running]
03-30 08:07:49.327: I/System.out(5055): [init.svc.surfaceflinger]: [running]
03-30 08:07:49.327: I/System.out(5055): [init.svc.vold]: [running]
03-30 08:07:49.327: I/System.out(5055): [init.svc.zygote]: [running]
03-30 08:07:49.337: I/System.out(5055): [net.bt.name]: [Android]
03-30 08:07:49.337: I/System.out(5055): [net.change]: [net.dnschange]
03-30 08:07:49.337: I/System.out(5055): [net.dns1]: [10.0.2.3]
03-30 08:07:49.337: I/System.out(5055): [net.dnschange]: [1]
03-30 08:07:49.337: I/System.out(5055): [net.eth0.dns1]: [10.0.2.3]
03-30 08:07:49.337: I/System.out(5055): [net.eth0.gw]: [10.0.2.2]
03-30 08:07:49.337: I/System.out(5055): [net.gprs.local-ip]: [10.0.2.15]
03-30 08:07:49.337: I/System.out(5055): [net.hostname]: [android-ab5e8b1dff91e7d5]
03-30 08:07:49.337: I/System.out(5055): [net.qtaguid_enabled]: [0]
03-30 08:07:49.337: I/System.out(5055): [net.tcp.buffersize.default]: [4096,87380,110208,4096,16384,110208]
03-30 08:07:49.337: I/System.out(5055): [net.tcp.buffersize.edge]: [4093,26280,35040,4096,16384,35040]
03-30 08:07:49.337: I/System.out(5055): [net.tcp.buffersize.gprs]: [4092,8760,11680,4096,8760,11680]
03-30 08:07:49.337: I/System.out(5055): [net.tcp.buffersize.hspa]: [4094,87380,262144,4096,16384,262144]
03-30 08:07:49.337: I/System.out(5055): [net.tcp.buffersize.lte]: [524288,1048576,2097152,262144,524288,1048576]
03-30 08:07:49.337: I/System.out(5055): [net.tcp.buffersize.umts]: [4094,87380,110208,4096,16384,110208]
03-30 08:07:49.337: I/System.out(5055): [net.tcp.buffersize.wifi]: [524288,1048576,2097152,262144,524288,1048576]
03-30 08:07:49.337: I/System.out(5055): [persist.sys.country]: [US]
03-30 08:07:49.337: I/System.out(5055): [persist.sys.language]: [en]
03-30 08:07:49.337: I/System.out(5055): [persist.sys.localevar]: []
03-30 08:07:49.337: I/System.out(5055): [persist.sys.profiler_ms]: [0]
03-30 08:07:49.337: I/System.out(5055): [persist.sys.timezone]: [GMT]
03-30 08:07:49.337: I/System.out(5055): [persist.sys.usb.config]: [adb]
03-30 08:07:49.337: I/System.out(5055): [qemu.hw.mainkeys]: [1]
03-30 08:07:49.337: I/System.out(5055): [qemu.sf.fake_camera]: [back]
03-30 08:07:49.337: I/System.out(5055): [qemu.sf.lcd_density]: [120]
03-30 08:07:49.337: I/System.out(5055): [rild.libargs]: [-d /dev/ttyS0]
03-30 08:07:49.337: I/System.out(5055): [rild.libpath]: [/system/lib/libreference-ril.so]
03-30 08:07:49.337: I/System.out(5055): [ro.allow.mock.location]: [1]
03-30 08:07:49.337: I/System.out(5055): [ro.baseband]: [unknown]
03-30 08:07:49.337: I/System.out(5055): [ro.board.platform]: []
03-30 08:07:49.337: I/System.out(5055): [ro.bootloader]: [unknown]
03-30 08:07:49.337: I/System.out(5055): [ro.bootmode]: [unknown]
03-30 08:07:49.357: I/System.out(5055): [ro.build.characteristics]: [default]
03-30 08:07:49.357: I/System.out(5055): [ro.build.date.utc]: [1323837732]
03-30 08:07:49.357: I/System.out(5055): [ro.build.date]: [Tue Dec 13 20:42:11 PST 2011]
03-30 08:07:49.357: I/System.out(5055): [ro.build.description]: [sdk-eng 4.0.3 MR1 237985 test-keys]
03-30 08:07:49.357: I/System.out(5055): [ro.build.display.id]: [sdk-eng 4.0.3 MR1 237985 test-keys]
03-30 08:07:49.357: I/System.out(5055): [ro.build.fingerprint]: [generic/sdk/generic:4.0.3/MR1/237985:eng/test-keys]
03-30 08:07:49.357: I/System.out(5055): [ro.build.host]: [android-test-34.mtv.corp.google.com]
03-30 08:07:49.357: I/System.out(5055): [ro.build.id]: [MR1]
03-30 08:07:49.357: I/System.out(5055): [ro.build.product]: [generic]
03-30 08:07:49.357: I/System.out(5055): [ro.build.tags]: [test-keys]
03-30 08:07:49.357: I/System.out(5055): [ro.build.type]: [eng]
03-30 08:07:49.357: I/System.out(5055): [ro.build.user]: [android-build]
03-30 08:07:49.357: I/System.out(5055): [ro.build.version.codename]: [REL]
03-30 08:07:49.357: I/System.out(5055): [ro.build.version.incremental]: [237985]
03-30 08:07:49.357: I/System.out(5055): [ro.build.version.release]: [4.0.3]
03-30 08:07:49.357: I/System.out(5055): [ro.build.version.sdk]: [15]
03-30 08:07:49.357: I/System.out(5055): [ro.carrier]: [unknown]
03-30 08:07:49.357: I/System.out(5055): [ro.com.google.locationfeatures]: [1]
03-30 08:07:49.357: I/System.out(5055): [ro.config.alarm_alert]: [Alarm_Classic.ogg]
03-30 08:07:49.357: I/System.out(5055): [ro.config.nocheckin]: [yes]
03-30 08:07:49.357: I/System.out(5055): [ro.config.notification_sound]: [OnTheHunt.ogg]
03-30 08:07:49.357: I/System.out(5055): [ro.crypto.state]: [unencrypted]
03-30 08:07:49.357: I/System.out(5055): [ro.debuggable]: [1]
03-30 08:07:49.357: I/System.out(5055): [ro.factorytest]: [0]
03-30 08:07:49.357: I/System.out(5055): [ro.hardware]: [goldfish]
03-30 08:07:49.357: I/System.out(5055): [ro.kernel.android.checkjni]: [1]
03-30 08:07:49.357: I/System.out(5055): [ro.kernel.android.qemud]: [ttyS1]
03-30 08:07:49.357: I/System.out(5055): [ro.kernel.console]: [ttyS0]
03-30 08:07:49.357: I/System.out(5055): [ro.kernel.ndns]: [1]
03-30 08:07:49.357: I/System.out(5055): [ro.kernel.qemu.gles]: [0]
03-30 08:07:49.357: I/System.out(5055): [ro.kernel.qemu]: [1]
03-30 08:07:49.357: I/System.out(5055): [ro.product.board]: []
03-30 08:07:49.357: I/System.out(5055): [ro.product.brand]: [generic]
03-30 08:07:49.357: I/System.out(5055): [ro.product.cpu.abi2]: [armeabi]
03-30 08:07:49.357: I/System.out(5055): [ro.product.cpu.abi]: [armeabi-v7a]
03-30 08:07:49.357: I/System.out(5055): [ro.product.device]: [generic]
03-30 08:07:49.367: I/System.out(5055): [ro.product.locale.language]: [en]
03-30 08:07:49.367: I/System.out(5055): [ro.product.locale.region]: [US]
03-30 08:07:49.367: I/System.out(5055): [ro.product.manufacturer]: [unknown]
03-30 08:07:49.367: I/System.out(5055): [ro.product.model]: [sdk]
03-30 08:07:49.367: I/System.out(5055): [ro.product.name]: [sdk]
03-30 08:07:49.367: I/System.out(5055): [ro.radio.use-ppp]: [no]
03-30 08:07:49.367: I/System.out(5055): [ro.revision]: [0]
03-30 08:07:49.367: I/System.out(5055): [ro.runtime.firstboot]: [1333077089134]
03-30 08:07:49.367: I/System.out(5055): [ro.secure]: [0]
03-30 08:07:49.367: I/System.out(5055): [ro.serialno]: []
03-30 08:07:49.367: I/System.out(5055): [ro.setupwizard.mode]: [OPTIONAL]
03-30 08:07:49.367: I/System.out(5055): [ro.wifi.channels]: []
03-30 08:07:49.367: I/System.out(5055): [status.battery.level]: [5]
03-30 08:07:49.367: I/System.out(5055): [status.battery.level_raw]: [50]
03-30 08:07:49.367: I/System.out(5055): [status.battery.level_scale]: [9]
03-30 08:07:49.367: I/System.out(5055): [status.battery.state]: [Slow]
03-30 08:07:49.367: I/System.out(5055): [sys.boot_completed]: [1]
03-30 08:07:49.367: I/System.out(5055): [sys.settings_system_version]: [1]
03-30 08:07:49.367: I/System.out(5055): [sys.usb.config]: [adb]
03-30 08:07:49.377: I/System.out(5055): [sys.usb.state]: [adb]
03-30 08:07:49.377: I/System.out(5055): [system_init.startsurfaceflinger]: [0]
03-30 08:07:49.377: I/System.out(5055): [xmpp.auto-presence]: [true]
03-30 08:07:49.377: W/System.err(5055): java.util.regex.PatternSyntaxException: Unrecognized backslash escape sequence in pattern near index 30:
03-30 08:07:49.377: W/System.err(5055): \[ro.product.model\].*\[([^\0]+)\]
03-30 08:07:49.377: W/System.err(5055):                               ^
03-30 08:07:49.377: W/System.err(5055):     at java.util.regex.Pattern.compileImpl(Native Method)
03-30 08:07:49.377: W/System.err(5055):     at java.util.regex.Pattern.compile(Pattern.java:400)
03-30 08:07:49.377: W/System.err(5055):     at java.util.regex.Pattern.<init>(Pattern.java:383)
03-30 08:07:49.377: W/System.err(5055):     at java.util.regex.Pattern.compile(Pattern.java:374)
03-30 08:07:49.377: W/System.err(5055):     at prop.test.PropManager.DeviceProp(PropManager.java:97)
03-30 08:07:49.387: W/System.err(5055):     at prop.test.PropManager.propArray(PropManager.java:113)
03-30 08:07:49.387: W/System.err(5055):     at prop.test.ProptestActivity.onCreate(ProptestActivity.java:20)
03-30 08:07:49.387: W/System.err(5055):     at android.app.Activity.performCreate(Activity.java:4465)
03-30 08:07:49.387: W/System.err(5055):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
03-30 08:07:49.387: W/System.err(5055):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
03-30 08:07:49.387: W/System.err(5055):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
03-30 08:07:49.387: W/System.err(5055):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
03-30 08:07:49.387: W/System.err(5055):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
03-30 08:07:49.387: W/System.err(5055):     at android.os.Handler.dispatchMessage(Handler.java:99)
03-30 08:07:49.397: W/System.err(5055):     at android.os.Looper.loop(Looper.java:137)
03-30 08:07:49.397: W/System.err(5055):     at android.app.ActivityThread.main(ActivityThread.java:4424)
03-30 08:07:49.397: W/System.err(5055):     at java.lang.reflect.Method.invokeNative(Native Method)
03-30 08:07:49.397: W/System.err(5055):     at java.lang.reflect.Method.invoke(Method.java:511)
03-30 08:07:49.397: W/System.err(5055):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-30 08:07:49.397: W/System.err(5055):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-30 08:07:49.397: W/System.err(5055):     at dalvik.system.NativeStart.main(Native Method)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T12:44:36+00:00Added an answer on June 1, 2026 at 12:44 pm

    It’s hard to know quite what you’re trying to accomplish just from reading the code and plethora of output, but I’ll take a stab at it.

    And specifically, it’s impossible to know what you meant by [^\\0] in your regular expression, but if you replace that with a dot and use the question mark to make it non-greedy, then the following line, replacing the one in your code, should do what you’re looking for…

                    Pattern.compile("\\[ro.product.model\\].*\\[(.+?)\\]"),
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.