this error means that you have not imported Context or not created an instance of it called “context”
fragment is not an activity but something like a sub-activity; it is created by P5 on runtime by the main activity you cannot see but to which you must refer in a lot of cases. If you want to understand a) export your app as android app b) go to the created folder c) look at src folder; as for the other questions yes, filesDir return a path to your private internal storage but assets folder is not the same… Anyway it s difficult to help you without having the complete code you are using now , with imports and var.