在哪里/数据/数据​​/? [英] where is /data/data/?

查看:145
本文介绍了在哪里/数据/数据​​/?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

初​​学者的Andr​​oid问题。好吧,我已经成功地写入的文件。例如。
                 //获取文件名
            字符串文件名= getResources()的getString(R.string.filename);

Beginner android question. Ok, I've successfully written files. E.g. // get the file name String filename = getResources().getString(R.string.filename);

        FileOutputStream toWriteTo;
        try {
            toWriteTo = openFileOutput(filename, MODE_WORLD_READABLE);
            // get the string to write
            String toWrite = getResources().getString(R.string.contentstowrite);
            toWriteTo.write(toWrite.getBytes());
            toWriteTo.close();

            ...         
               }
        catch (Exception ex) {
            Toast.makeText(HelloFilesAppActivity.this, "fail!", Toast.LENGTH_SHORT).show();
        }
        }});

和我已经证明了它的存在,通过读和显示内容,即使使用getFilesDir(),并显示该文件夹中的所有文件。

And I've proved that it is there by reading it and displaying contents, even using getFilesDir() and displaying all of the files in the folder.

一切我读到说,文件在/数据/数据​​//文件/
但我无法找到他们。 (我在Windows XP)。我的安装没有使用默认位置,因为我的C:\\是pretty满。我看着在C:\\ Documents和Settings \\麦克\\ .android \\ AVD,并在项目文件夹,并在地方,我安装了SDK:D:\\ Program Files文件\\的Andr​​oid \\ Android的SDK窗口。那么,是/数据/数据​​/?

Everything I read says that the files are in /data/data//files/ But I cannot find them. (I'm on Windows XP). My install didn't use default locations because my C:\ is pretty full. I looked in C:\Documents and Settings\Mike\.android\avd and in the project folder and in the place I installed the SDK: D:\Program Files\Android\android-sdk-windows. So where is /data/data/ ?

我读,我可以使用亚行推拉文件来回,但我使用Eclipse ADT和我最好preFER使用除命令行以外的东西。我使用这本书似乎在暗示,你可以使用Eclipse,但然后继续给命令行命令。

I read that I can use ADB to push and pull files back and forth, but I'm using Eclipse ADT and I'd prefer to use something other than command line. The book I'm using seems to imply that you can use Eclipse but then proceeds to give the command-line commands.

我发现对工程资源管理器中的DDMS的信息,但我没有看到我写的文件。

I found info about the Project Explorer in the DDMS, but I don't see the files I have written.

我一直认为我可能需要创建在Windows中使用其他一些手段,我会用我的应用程序读取文本文件的假设下。所以,如果答案是你为什么要这么做?,那就是我了。最后一个DB可能太(这是在下一章:-))。

I've been working under the assumption that I might want to create a text file using some other means in Windows that I would read with my App. So if the answer is "why do you want to do this?", that's what I'm after. Eventually a DB probably too (that's in the next chapter :-) ).

我必须使用ADB命令行?

Do I have to use the ADB command line?

感谢

迈克

推荐答案

http://developer.android.com/guide/topics/data/data-storage.html

您的使用,让你读/写目录的方法:

The method your using to get the directory you read/write to:

openFileOutput()

openFileOutput()

您可以在设备的内部存储直接保存文件。 默认情况下,保存到内部存储器中的文件是私人以您的应用程序和其他应用程序不能访问它们(也可以在用户)。:当用户卸载应用程序,这些文件被除去。

You can save files directly on the device's internal storage. By default, files saved to the internal storage are private to your application and other applications cannot access them (nor can the user). When the user uninstalls your application, these files are removed.

您会希望将这些文件你的工作保存到SD卡。

You'll want to save the files your working with to the SD card.

试试这个:

<一个href=\"http://developer.android.com/reference/android/os/Environment.html#getExternalStoragePublicDirectory(java.lang.String)\"相对=nofollow> getExternalStoragePublicDirectory例

这篇关于在哪里/数据/数据​​/?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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