I have to convert a byte array to a string. Therefore I use this function:
public static String byteToString(byte[] bytes) {
String str = new String(bytes, Charset.forName("UTF8"));
return str;
}
The problem is, that it requires API 9:
Call requires API level 9 (current min is 8): new java.lang.String
but I want to provide my app to API 8 users too. Is there any possibility or alternative?