(Android)在内部存储中查找路径/Android [英] (Android) Find path /Android in internal storage
本文介绍了(Android)在内部存储中查找路径/Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Android中是否有一种方法可以返回内部存储设备上的数据路径?
Is there a method in Android that returns the data path on internal storage?
我有2台Android智能手机(三星s2和s7 edge),我在其中安装了应用程序.我想使用位于此路径中的sqliteDB:
I have 2 Android smartphone (Samsung s2 and s7 edge) where i installed an application. I want to take a sqliteDB situated in this path:
/Android/data/application.most/files/most_db
问题在于,在三星s2中,我必须使用以下路径来获取数据库:
The problem is that in Samsung s2 i must use this path to take the DB:
private static final String db_path = "/storage/sdcard0/Android/data/org.application/files/application_db";
立即安装,在s7中,我必须使用此功能:
Instaed, in s7 i must use this:
private static final String db_path = "/storage/emulated/0/Android/data/application.most/files/application_db";
我想通过设备独立走这条路.
I want to take this path independently by device.
你能帮我吗?
谢谢.
推荐答案
我认为您正在寻找的是类似的东西
I think that what you're looking for is something like that
String path = getFilesDir().getAbsolutePath();
这篇关于(Android)在内部存储中查找路径/Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文