Detect soft navigation bar availability in android device progmatically?

Raghu Mudem picture Raghu Mudem · Mar 11, 2015 · Viewed 25.5k times · Source

I am trying to determine soft navigation bar through the android program. I didn't find straight way to determine. Is there anyway to find the navigation bar availability.

Soft Navigation bar image is here.

enter image description here

Answer

Raghu Mudem picture Raghu Mudem · Sep 21, 2015

Following method worked for me and tested in many devices.

public boolean hasNavBar (Resources resources)
    {
        int id = resources.getIdentifier("config_showNavigationBar", "bool", "android");
        return id > 0 && resources.getBoolean(id);
    }

Note: Verified this method in real device