Closed Frago9876543210 closed 6 years ago
Beginning with andronid 7 or 6, the application data must reside in /data/user/0/package. I think that need use this code for get data folder:
/data/user/0/package
ContextWrapper context = new ContextWrapper(this); String data_path = context.getApplicationInfo().dataDir + "/files";
https://github.com/fengberd/PocketServer/blob/d387a9ec1873710456663eaa259e9f3126c60876/app/src/main/java/moe/berd/pocket_server/utils/ServerUtils.java#L40
I write this line to compatible with some b**t devices that returns null when I calling ctx.getFilesDir()... Anyway,I'll follow your suggestion,but still keep the hardcoded path. 👍
Beginning with andronid 7 or 6, the application data must reside in
/data/user/0/package
. I think that need use this code for get data folder:https://github.com/fengberd/PocketServer/blob/d387a9ec1873710456663eaa259e9f3126c60876/app/src/main/java/moe/berd/pocket_server/utils/ServerUtils.java#L40