Various paths on Android

Source: Internet
Author: User

Http://mobile.51cto.com/abased-375025.htmhttp://blog.sina.com.cn/s/blog_7db304660100xgpp.html

Android/data: This is the cache path of the application. If you clear the cache of the application in the settings, the data in this directory will also be cleared, it is the same as data/package name /.


19:39:34-17. 681: I/Tag (8150): getexternalfilesdir (environment. directory_movies); =/storage/sdcard0/Android/data/COM. example. onlyfortest/files/Movies07-17 19:23:25. 187: I/Tag (6496): This. getapplicationcontext (). getcachedir () =/data/COM. example. onlyfortest/Cache

07-17 19:23:25. 187: I/Tag (6496): environment. getdatadirectory () =/Data

07-17 19:23:25. 187: I/Tag (6496): environment. getexternalstoragestate () = mounted

07-17 19:23:25. 187: I/Tag (6496): environment. getdownloadcachedirectory () =/Cache

07-17 19:23:25. 187: I/Tag (6496): environment. getrootdirectory () =/System

07-17 19:23:25. 187: I/Tag (6496): environment. getexternalstoragepublicdirectory () =/storage/sdcard0/pictures

07-17 19:23:25. 187: I/Tag (6496): environment. getexternalstoragedirectory () =/storage/sdcard0


First, the internal storage path is/data/youpackagename/. The paths described below are based on the internal storage path of your own application. All files stored in the internal storage will be deleted when the user uninstalls the application.

1. files1. context. getfilesdir (). This method returns the file object of/data/youpackagename/files. 2. Context. openfileinput () and context. openfileoutput () can only read and write files. The returned objects are fileinputstream and fileoutputstream. Www.2cto. com3. context. filelist (), returns all file names under files, and returns the string [] object. 4. Context. deletefile (string): delete the file with the specified name under files. 2. cache1. context. getcachedir (). This method returns the file object/data/youpackagename/cache. 3. Custom dirgetdir (string name, int mode), return the file object of the specified name under/data/youpackagename, if the folder does not exist, use the specified name to create a new folder. If you want to store a content in a path without knowing where it is suitable, you can view all the paths and learn about the android storage structure.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.