0

Is there any way to execute Binary file in an android application. without JNI wrapper approach.

plz give me sample codes.

user1925921
  • 120
  • 1
  • 10
  • See http://stackoverflow.com/questions/4703131/is-it-possible-to-run-a-native-arm-binary-on-a-non-rooted-android-phone – Michael Feb 06 '13 at 11:09

1 Answers1

0

try this

public void pump(InputStream in, OutputStream out, int size) {
byte[] buffer = new byte[4096]; // Or whatever constant you feel like using
int done = 0;
while (done < size) {
    int read = in.read(buffer);
    if (read == -1) {
        throw new IOException("Something went horribly wrong");
    }
    out.write(buffer, 0, read);
    done += read;
}
// Maybe put cleanup code in here if you like, e.g. in.close, out.flush, out.close
     }

from this link Reading and writing binary file in Java (seeing half of the file being corrupted)

Community
  • 1
  • 1
kamal
  • 290
  • 3
  • 20