I am developing a mobile application by using Lucene. I have a folder which includes index files. In the application, I want to use these index files for searching. Lucene Library expects path of this folder to read. I placed this folder in the assets folder. But I can't get this folder's path. I checked Android Storage Documentation. But I could not find any solution to add existing folder to external storage. If I would add them to external storage, I can get the path with getExternalFilesDir()
. I am working by using emulator.
Directory dir = FSDirectory.open(Paths.get("path of index folder"));
IndexReader reader = DirectoryReader.open(dir);
searcher = new IndexSearcher(reader);
Above code section works well in a Java SE application since I can give the path of folder directly. But In android I am working by using emulator. How can give path of index folder in android? Where should I place this folder to reach in the application?