开发者

If i install a package say "mypack.apk" ,then will "/data/data/com.Android.mypack" will get created always

        File fileDir = getFilesDir();
     Log.v("TEST","FILEDIR--->"+ fileDir.toString());  //prints   FILEDIR--->/data/data/com.Android.mypack/files


    String strNewFileName = "test1.txt";
    String strFileContents = "TEST PRG, NOTHN  MUCH";


    File newFile = new File(fileDir, strNewFileName);
    try{
    boolean filestat = newFile.createNewFile();
    Log.v("TEST"," CREATE FILE =>"+ filestat);  //Prints true indicating a successful creation

    FileOutputStream fo =
        new FileOutputStream(newFile.getAbsolutePath());
        fo.write(strFileContents.getBytes());
        fo.close();
    }
    catch(IOException e) 
    {} 

After running the program with a android tablet. I mounted the tablet and used the file explorer to find the file in the internal storage. But i'm not able to locate a path like "/data/data/com.Android.mypack/files ". How to confirm that a new file is created ? or how to check it from the UI using a file manager.

OR

If i install a package say "mypack.apk" ,then wi开发者_运维技巧ll "/data/data/com.Android.mypack" will get created ? I'm not able to view it . I tired using andexplorer and its empty


If you are using Eclipse then you can check if the file is present or not by following way.

On the top right corner of your eclipse there is option to select DDMS(If you dont see it click on "Open Perspective" icon).

DDMS -> File Explorer -> data -> data -> com.Android.mypack -> files -> (your file if it is created)

It will show you the files of your tab also.just select your tab on left side.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜