Reputation: 4081
I have file kanji.xls. I would like to get that file through new File(); What should I write inside that constructor? I tried many options but didn't find correct answer...
I tried:
Upvotes: 1
Views: 1646
Reputation: 15720
Use assets
directory in your project to store this file and read file from there. Android – Read file from Assets will guide you.
if you don't wish to use assets
directory,
Create directory as Kanji_Database
instead of Kanji database
. Then use below code.
File f= new File(Environment.getExternalStorageDirectory()
+ "/Android/data/" + getApplicationContext().getPackageName()
+ "/Kanji_Database/", "kanji.xls");
Upvotes: 2