fengberd / PocketServer

[Discontinued] Run PocketMine or Nukkit on your Android phone!
GNU General Public License v3.0
94 stars 26 forks source link

app path #77

Closed Frago9876543210 closed 6 years ago

Frago9876543210 commented 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:

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

fengberd commented 6 years ago

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. 👍