The Android resource files can be roughly divided into two categories:
The first is a compiled resource file stored in the Res directory:
This resource file system will automatically generate the ID of the resource file in R.java, so it is simpler to access this resource file, through R.xxx.id;
The second is the native resource
How to extract and generate mp4 files in AndroidWith the gradual popularization of Android 4.4 and later versions, the MediaExtractor class introduced by Android 4.1 and the MediaMuxer class introduced by Android 4.3 can finally begin to officially "glow and Heat. MediaMuxer is mainly used to generate multimedia
development languages, these languages have weak logic, better structure, better readability, and easier understanding. They are also very friendly to automation tools and can be combined with drag-and-drop configurations on the interface. Such a strip can be independent of the underlying logic and the upper-layer interface, or even different personnel development (This point should be obvious in Web development ...), the coupling between the two is very small, and the coder's burden is suddenl
In the Android project folder, the main resource files are in the Res folder.
1:assets folder is stored without compiling the original file, that is, the folder inside the file will not be like Xml,java file is precompiled, you can store some pictures, Html,js, CSS and other documents.
Introduction to the 2:res folders inside multiple folders
Res/anim/xml
stored in the resources directory because it cannot be written on the ipad.So what should you do with the read and write XML on the ipad? The method is described as follows:Store the files that need to be serialized in the Application.persistentdatapath directory, which is a platform-dependent path.Write:XmlDocument xmldoc = new XmlDocument ();...Xmldoc.save (application.persistentdatapath+ "//abc.xml");Re
On the Android platform, in addition to operating files in the private folder of the application, you can also obtain the input stream to read data from resource files and assets, these files are stored in the Res/raw directory and Assets Directory of the application. These
Whether it is text, image or sound, must be organized and stored in a certain format, so that the player will know how to parse this piece of data, for example, for the original image data, our common format is YUV, Bitmap, and for audio, the simplest common format is the WAV format.WAV format, like bitmap, are Microsoft developed a file format specification, they all have a similarity, is the whole file is divided into two parts, the first part is "F
Append content to the file)
③ MODE_WORLD_READABLE (the file content can be read by other applications)
④ MODE_WORLD_WRITEABLE (the file content can be written by other applications)
Read files:
Assume that name is the name of the file to be opened.
?
1 2 3 4 5 6 7 8 9
FileInputStream f = openFileInput (name ); Byte [] buf = new byte [1, 1024]; Int hasRead = 0; StringBuilder sb = new StringBuilder (""); While (hasRead = f. read (bu
Android learning notes-save Files)Android devices have two types of file storage areas: internal storage and external storage ). This name comes from early Android, when most Android devices provided two storage methods: built-in non-Loss memory (internal storage) and remova
Click Save and save the created file in/data/Directory, you can check: ddms -- file Explorer -- Data --
Select a file and click it to export the file for viewing. Click it to add other files.
After you click "save", the prompt box is displayed, indicating that the file is saved successfully. After you click "read", the prompt box displays file content: ×××××.
Layout File
Activity_main.xml
Business Layer Code:
Fileservice. Java
Package CN. BZU. file
Currently there is a project that needs to sort the files in the directory and arrange them by time.1. Filter the XLS file by ImageFilterThe task of the ImageFilter class object is to provide a method of accept (). Callbacks can improve the flexibility of the program.FilenameFilter filter = new FilenameFilter () {Public Boolean Accept (File dir, String filename) {Return Filename.endswith (". xls");}};2. Get the directory below the suffix is the XLS fi
ObjectiveWelcome everyone I share and recommend useful code Snippets ~ ~StatementWelcome reprint, but please keep the original source of the article:CSDN:http://www.csdn.netrainy season o mo away:http://blog.csdn.net/luckkofBodySummarize:Asset Directory Files:Called native files, which are not compressed when packaged as an apk file and do not automatically generate an ID for r filesAccess:Get path: File://android_asset/test.xml
//The Assets folde
Android saves and reads data to files
Android gets fileoutputstream
Context. openfileoutput (file, permission)
Context is the context of the environment, and activity inherits the ccontext class.For exampleAA inherits ActivityYou can write it like this.: AA. This. openfileoutput (file, permission)
File: Name and extension of the file created for the user,
The example in this article describes how the Android implementation puts files in SDcard. Share to everyone for your reference. Specifically as follows:
Use the activity of the Openfileoutput () method to save the file, the file is stored in the mobile phone space, the general mobile phone storage space is not very large, storing small
I. Overview of the problem
In Android development, the ability to download files, such as app version updates, is often used. After API Level 9, the Android system provides us with the Downloadmanager class, which is a system service provided by Android, which we complete with the file download. The entire d
Usually we need to store on the phone for audio, video and so on large files, previously learned to use file for storage (using the file operation to store); Because of the small storage space of the phone itself, we need to store the file in SDcard, Today I also learned how to use the SDcard storage in Android;
First, if you want to use SDcard for storage in your program, we have to do the following permi
Android briefly introduces SharedPreference, internal files, and sdcard data storage,
SharedPreference
Store simple data in xml structure and store it in the data/package name/shared_prefs folder
Usage
There are three ways to create an object
GetSharedPreferences () of Context ()
GetPreferences () of the Activity ()
Getdefasharsharedpreferences () of PreferenceManager ()
Get Data
SharedPrefs. getXXX () meth
Android uses the path api to internally store read and write files. androidapiCopy and modify the original project
Copy the previously created Project CC + CV operation
To be modified:* Project name* Application package name* Re-import the R file package
Next, modify the package name in the file/AndroidManifest. xml: package = "com. wuyudong. rwinrom"
For simplicity, change to package = "com. wuyudong. rwi
. In addition, the file class has some of the following common operations:String Name = File.getname (); Get the name of the file or folder:String Parentpath = File.getparent (); Get the parent directory of a file or folderString path = File.getabsoultepath ();//Absolute Road warpString path = File.getpath ();//Relative Road warpFile.createnewfile ();//Build fileFile.mkdir (); Create a folderFile.isdirectory (); Judging is a file or folderfile[] files
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.