Creditos: https://stackoverflow.com/questions/25284233/prevent-status-bar-for-appearing-android-modified
Android – Desabilitar o recurso multi window programaticamente (Disable multi window feature programatically)
Normalmente presente em dispositivos da samsung. Para desabilitar o recurdo multi-window basta executar o seguinte comando: // requer permissão: android:name=”android.permission.WRITE_SETTINGS” // 0=desabilitado ; 1=habilitado Settings.System.putInt(contentResolver, “multi_window_enabled”, 0)
Java – Ler um arquivo e codifica-lo para Base64 – Converter File para Base64 (Encode file to Base64)
private String encodeFileToBase64Binary(File file) throws IOException { byte[] bytes = loadFile(file); byte[] encoded = Base64.getEncoder().encode(bytes); String encodedString = new String(encoded); return encodedString; } private byte[] loadFile(File file) throws IOException { byte[] bytes; try (InputStream is = new FileInputStream(file)) { long length = file.length(); if (length > Integer.MAX_VALUE) { throw new IOException(“File to large ” + […]