在模拟器Android的数据库目录 [英] Android database directory on emulator

查看:278
本文介绍了在模拟器Android的数据库目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我创建了一个的Andorid数据库类,如下。

public class Veritabani extends SQLiteOpenHelper {

    private static final String Veritabani_Adi = "Veritabanim";
    private static final int Veritabani_Version = 1;
    public Veritabani(Context context) {
    super(context, Veritabani_Adi, null, Veritabani_Version);
    }
    @Override
    public void onCreate(SQLiteDatabase db) {

        db.execSQL("CREATE TABLE ARKTABLE (id INTEGER PRIMARY KEY AUTOINCREMENT , ad TEXT, soyad TEXT);");  
    }
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    db.execSQL("DROP TABLE IF EXIST OperatorTablosu");
    onCreate(db);
    }
}


**then i declare may Veritabani class in my activity as below.**

public class DictionaryActivity extends Activity {
    Spinner spnLanguage;
    Veritabani objdb;;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_dictionary);
        spnLanguage=(Spinner)findViewById(R.id.spnLanguage);
        objdb=new Veritabani(this);
        spinnerfill();

    }

我没有对logcate或控制台异常。
但是,当我看到5月数据/数据​​/ myappp /我没有看到数据库目录。

i don't have an exception on logcate or console. But when i look may data/data/myappp/ i dont see database directory.

我用Android 2.2版

i used android 2.2 version

推荐答案

在下面的评论中提到的更新:

You don't need to be on the DDMS perspective anymore, just open the File Explorer from Eclipse Window > Show View > Other... It seems the app doesn't need to be running even, I can browse around in different apps file contents. I'm running ADB version 1.0.29

或者,你可以尝试老办法:

Or, you can try the old approach:

在Eclipse IDE中打开DDMS透视图

Open the DDMS perspective on your Eclipse IDE

(窗口>打开透视图>其它> DDMS)

和最重要的:

应用程序必须运行,以便可以看到文件夹和文件的层次结构。

然后在文件浏览器选项卡,你会遵循的路径:

Then in the File Explorer Tab you will follow the path :

数据>数据>您的包名>数据库>你的数据库文件。

然后选择文件,在屏幕的右下角点击图标disket下载.db文件。如果你要上传的数据库文件到您可以点击电话图标(disket图标旁边),仿真器,并选择要上传的文件。

Then select the file, click on the disket icon in the right corner of the screen to download the .db file. If you want to upload a database file to the emulator you can click on the phone icon(beside disket icon) and choose the file to upload.

如果你想看到.db文件的内容,我建议你使用SQLite数据库浏览器,你可以在这里下载。

If you want to see the content of the .db file, I advise you to use SQLite Database Browser, which you can download here.

PS:如果你想看到一个真实的设备数据库,你必须根除您的手机

这篇关于在模拟器Android的数据库目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆