Android 中有没有返回内部存储上的数据路径的方法?
我有 2 部 Android 智能手机(三星 s2 和 s7 edge),我在其中安装了应用程序。我想获取位于此路径中的 sqliteDB:
/Android/data/application.most/files/most_db
问题是在三星 s2 中我必须使用此路径来获取数据库:
private static final String db_path = "/storage/sdcard0/Android/data/org.application/files/application_db";
相反,在 s7 中我必须使用这个:
private static final String db_path = "/storage/emulated/0/Android/data/application.most/files/application_db";
我想通过设备独立地走这条路。
你能帮助我吗?
提前致谢。
我认为你正在寻找的是类似的东西
String path = getFilesDir().getAbsolutePath();
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)