Last active
April 9, 2021 06:27
-
-
Save ericosur/f2aa1515ce69d4537c165cc04a90c149 to your computer and use it in GitHub Desktop.
query system features from package manager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.pm.PackageManager; | |
import android.content.pm.FeatureInfo; | |
import android.util.Log; | |
// $ adb shell pm list features | |
private void querySystemFeatures() { | |
static final String APP_TAG = "app_tag"; | |
final PackageManager pm = getPackageManager(); | |
final FeatureInfo[] featuresList = pm.getSystemAvailableFeatures(); | |
String feature_string = ""; | |
for (FeatureInfo f : featuresList) { | |
if (f.name != null) { | |
feature_string += f.name + "\n"; | |
} | |
} | |
feature_string += "\n"; | |
Log.i(APP_TAG, "rasmus: query features: " + feature_string); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment