I am trying to open a file located within my android studio project @ res/drawable/conan_obrian.png. However, a java.io.FileNotFoundException was thrown. I have tried different pathname combinations with no results.
this snippet is throwing the exception:
InputStream is;
byte[] buffer = new byte[0];
try {
final AssetManager assetMgr = context.getResources().getAssets();
is = assetMgr.open("drawable/conan_obrian.png");
buffer = new byte[is.available()];
is.read(buffer);
} catch (IOException e) {
e.printStackTrace();
}
serverAPI.register(userName, Base64.encodeToString(buffer,Base64.DEFAULT).trim(), myCrypto.getPublicKeyString());