List
addTrackerData from getFilesDir() [Android]
Posted Date: 2018-04-09 17:23     Edited Date: 2018-04-11 1:22     Writer: inactive

Hello!

 

is there a way to load tracker data  from folder returned by context.getFilesDir() (default internal app directory) on Android? 

Posted Date: 2018-04-10 0:39     Edited Date: 2018-04-10 0:39     Writer: slkim

if you want to load Tracker Data at SDCARD, use code below.

File sdcard = Environment.getExternalStorageDirectory();
String Path = sdcard.getAbsolutePath() + "/Blocks.2dmap";

TrackerManager.getInstance().addTrackerData(Path, false);
Posted Date: 2018-04-10 22:25     Edited Date: 2018-04-10 22:26     Writer: inactive

thanks for the answer, but this is not exactly what I'm interested in. My goal is to use the internal storage available only to my application. something like:

 

File internal = new File(context.getFilesDir(), "/Blocks.2dmap"); TrackerManager.getInstance().addTrackerData(internal.getAbsolutePath(), false);

now this approach does not work

Posted Date: 2018-04-11 1:22     Edited Date: 2018-04-11 1:22     Writer: slkim

1. are you copy 'Blocks.2dmap" File at Internal Storage? (ex /data/user/0/com.maxst.ar.sample/files/Blocks.2dmap)

We tested to load file at internal storage. like below code. 

File external = new File(Environment.getExternalStorageDirectory(), "/Blocks.2dmap");
File internal = new File(this.getFilesDir(), "/Blocks.2dmap");
try {
   copy(external, internal);
} catch (IOException e) {
   e.printStackTrace();
}
TrackerManager.getInstance().addTrackerData(internal.getAbsolutePath(), false);

Please check it again.