Try this it will help you open .twa file. This what i did with my files
First have ByteArrayInputStream
private ByteArrayInputStream file_hnd;
Now try opening file as
try {
{
InputStream fip = null;
)
fip = getAssets().open("My Files/" + file_name);//Your driectory and file name
/* else
{
fip=new FileInputStream(f);
}*/
byte[] b = new byte[fip.available()];
fip.read(b);
file_hnd = new ByteArrayInputStream(b);
fip.close();
file_hnd.mark(file_hnd.available() + 1);
return true;
}
} catch (Exception e) {
e.printStackTrace();
}
Now your ByteArray i.e file_hnd has all the data from that file. For reading i did this
try {
file_hnd.reset();
int chars, i = 0, index = 0;
while ((chars = file_hnd.read()) != -1) {
aDes[index++] = (byte) chars;//Do your reading here
}
} catch (Exception e) {
e.printStackTrace();
}
Hope this helps you.