Skip to content

Instantly share code, notes, and snippets.

@bmc08gt
Created July 29, 2014 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmc08gt/b02f5bc1f3574d077859 to your computer and use it in GitHub Desktop.
Save bmc08gt/b02f5bc1f3574d077859 to your computer and use it in GitHub Desktop.
public String getBestResolution() {
String[] resolutions = null;
String resolution = "720p";
String rawList = readSupportList(HDMI_SUPPORT_LIST);
if (rawList != null) {
resolutions = (rawList.substring(0, rawList.length()-1)).split("|");
}
if (resolutions != null) {
for (int i = 0; i < resolutions.size(); i++) {
if (resolutions[i].contains("*")) {
// best mode
resolution = resolutions[i].substring(0, resolutions[i].length()-1);
}
}
if (resolution.contains("50hz")) {
return resolution + "50hz";
}
return resolution;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment