I have two datasets which are currently in the same folder as my java files AND on my PC. Currently, I am accessing them through my C-drive. Since this is an app, where should I save my .ARFF files and what path should I use instead? I have tried in the raw folder, but nothing seems to work.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Create a raw directory in your project, raw is included in the res folder of android project. You can add an assets files in raw folder like music files, database files or text files or some other files which you need to access directly
1) Right click on res folder, select New> Directory, then studio will open a dialog box and it will ask you to enter the name.
2) Enter “raw” and click OK. Open res folder and you will find your raw folder under it.
// Example to read file from raw directory
After too many hours
A very easy solution to retrieving data from the assets folder! Only one user-defined method.
raw
folder inres
directory.raw directory
.java
fileAppCompatActivity
A. This is in the
main
function OR in a custom,user-defined
function.FILENAME_WITHOUT_TYPE
refers to only the name of the file, not its ending (everything followed by the .).B. This is the definition of ISR.
Works like a charm!
Resources: