androidstringdevice-name

Device model in strings.xml?


Hello guys!

I have got a problem, I want to make my app display the device name (if your [DEVICENAME] is rooted or not) in the strings.xml, I have already tried many things, but nothing really worked.

Please tell me how to do that! It should work in Toasts made with MainActivity.java.


Solution

  • In your strings.xml,

    <string name="device">if %s is rooted or not.</string>
    

    And in your Activity

    getString(R.id.device, android.os.Build.MANUFACTURER + android.os.Build.PRODUCT);