. Mode_world_readable: Indicates that the current file can be read by another application; Mode_world_writeable: Indicates that the current file can be written by another application. */FileOutputStream Fos=openfileoutput (file_name, mode_append); OutputStreamWriter OSW=NewOutputStreamWriter (FOS, "UTF-8"); Osw.write (Writeedit.gettext (). toString ()); //osw.write ("Hello Wrold!");Osw.flush (); Fos.flush (); Osw.close ();
, have friends if know for Android, request recommended!Two. Scan local music filesFirst through the QQ music has downloaded the good song.Scan implementation://scan local musicif(Environment.getexternalstoragestate (). Equals (environment.media_mounted)) {NewThread () {@Override Public void Run() {Try{string[] ext = {". mp3"}; File File =NewFile (environment.getexternalstoragedirectory () +"/androi
troublesome.But Google has provided us with a dedicated access to internal storage api:getfilesdir () Create a file where the user saves the user name and password //file file = new file ("Data/data/com.demo.storage/info.txt"); Getfilesdir returns a file object whose path is: data/data/com.demo.storage/files File File = new file (Getfilesdir (), "Info.txt") ;The path to the Getfiledir is under the
How to Use SharedPreference to save files for Android storage Learning
In the last two sections, we used text files to store user information, which is obviously vulnerable. At the same time, it is difficult to manage the content in the file. Today, we learn to use SharedPreference to save. SharedPreference stores scattered data.
We still use the example in the s
two different ways:First, the window interface operation1. Open DDMS page2. Open the File Explorer page, if not, at window---Show View-->file Explorer3, generally in mnt--sdcard4. In SDcard, click on the destination folder where you want to put the file, such as mp3 folder5, click on the folder, on the right side of the File Explorer page, there are two icons, one is pull, one is Push,pull will be mp3 inside the file pulled out, push is the outside, s
entire application, and the application destroys it to destroy fileservice service = new Fileservice ( Getapplicationcontext ()); try { //To determine if the sdcard exists, and can read and write,//environment.getexternalstoragestate () Gets the current state://environment.media_ Mounted represents the state of SDcard: Presence Sdcardif (Environment.getexternalstoragestate (). Equals (environment.media_mounted)) { Service.savetosdcard (filename, content); Call the Save () method to save
Preface: For XStream do not understand, please see:Android XMl parsing Magic XStream: Parse aa.xml file under Asset folder in Android projectAndroid XML parsing Magic XStream II: Converting objects to XMLAndroid XML parsing Magic XStream Three: Transforming complex objects into XMLAndroid XML parsing Magic XStream Four: parsing complex XMl files into objects1, establish Javabeen PackageCom.android10; Public
in order to better in response to network access, recently learned a bit okhttp, feel very convenient to use, first to use okhttp, need to import Okhttp-x.x.x.jar in the project Okhttputils-x_x_x.jar Okio-x.x.x.jar These three jar packages, the following is the Android side and server-side key code:
private void Uplodeimage (file mfile) {//mfile A real existing picture file if (!mfile.exists ()) { Toast.maketext ( Mainactivity.th
In a previous company to do an app inside the upload avatar function, then studied for a long time, found an article about the H5 Camera and album calls, so it solved the problem!! I record here so that some people need, can refer to!!!!The following is a complete HTML page content, placed on the server and then browse on it, only support chrome and Safari core browser, QQ browser, Chrome,safari browser can be. Different phones and browsers do not show
Using the Activity class's Openfileinput () and Openfileoutput methods to manipulate files on the device, the file created by default exists in the "/data/data/The key implementation code is as follows, and it is recommended that you call these two methods into two menu options to see the program effect.(1) Read the file codepublic void ReadFile (String sfilename) { try { FileInputStream fis = openfileinput (sfilename); Convert b
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.