To store various types of files such as . txt, . json, etc, you first need to create a Assets Folder, That’s where you’ll put your files.
to create a Assets Folder just click on your projectile with the right mouse button and follow this path:
New->Folder->Assets Folder
Now that you have a Assets Folder just enter it and drag the files you want. To enter it just follow the guidelines of the next image:
Now your file already appears in the projectile.
To read the file, you can do this way:
public String loadJSONFromAsset(String nomeArquivo) {
String json = null;
try {
InputStream is = context.getAssets().open(nomeArquivo);
int size = is.available();
byte[] buffer = new byte[size];
is.read(buffer);
is.close();
String texto = new String(buffer, "UTF-8");
} catch (IOException ex) {
ex.printStackTrace();
return null;
}
return texto;
}
I never had to use it, but check out this tutorial if it helps: http://www.codepool.biz/making-an-android-application-with-tesseract.html
– viana
@Acklay I’ll take a look, but I’m doing a lot of research already on how to use Tesseract in windows with android-studio, in the vast majority of tutorials is in linux and eclipse, I’ve already made enough progress, I’m already able to use Tesseract, missing some last settings, calibrate etc... The main functionality already works, the problem is that I added these files I need to sdcard manually, so the question, thank you.
– Mathiasfc