1. Save to SD card:Get the status of SDcard:Environment.getextemalstoragestate ()Environment.media_mounted mobile phone is equipped with sdcard and can read and writeGet the directory of SDcard: Environment.getextemalstoragedirectory ()//=============================================File Savefile=new file ("/sdcard/zhzhg.txt");Or: File Sdcarddir=new file ("/sdcard");//get
In this section, we do a very simple demo that allows you to read an image from an SD card and display it in the app.In three steps:1. Set permissions. Add three lines of permission information to the manifest file. uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/> uses-permission android:name="an
rawData recovery. Learning.
Helpless, my laptop was powered off. I used my mobile phone to search for keywords and found that easyrecovery could be used for advanced data recovery. At this time, I saw a glimmer of hope. If the hardware is not damaged, you can simply format the data after it is taken. During the class this morning, it took another few minutes to look at the SD, CF, and MMC items.
When I got to the lab, I decided to try Linux first t
1. To back up your contacts I'll go back to my mobile desktop and then click on the "Contacts" icon.2. In the contact us click on the three-point box, such as the Red Box "menu."3. Then we click on the three point after the pop-up menu, here we click on the Drop-down menu "set."4. Okay, let's get into the setup. We find "contact" and click on Enter, as shown in the following figure.
5. OK here we will see an "import/export" We click on it and
mresolver = Ctx.getcontentresolver (); The top of the CTX is a context,activity.this is that context, this context is equivalent to a contextual environment. Once you get this context, you can call the Getcontentresolver interface to get the Contentresolver instance. Contentresolver instances obtained, you can make a variety of queries, the following I take the audio database as an example to explain the m
fileinputstream (File); int Len = 0; byte [] Buffer = New byte [1024]; while (LEN = inputstream. Read (buffer ))! =-1) {sb. append (new string (buffer, 0, Len);} tvresult. settext (sb. tostring (); // close the stream inputstream. close ();} catch (exception e) {// todo auto-generated catch blocke. printstacktrace ();}}}});}}
Effect
File explorer shows the same effect:
Development considerations:
1. You must not forget to add permissions.
2. Check whether the
In Android, the implementation of the output log content in the SD card file, the practice is:Or relatively, log4j, is useful.1. Download the Android log4j library (in the package)Go: http://code.google.com/p/android-logging-log4j/ download the corresponding android-logging-log4j-1.0.3.jar , added to the project. 2. Download the dependent Apache log4j LibraryGo: http://logging.apache.org/log4j/1.2/download.
/** * Save Bitmap to a file. Saves the picture to the SD card. * * @param bitmap * @param file * @return error message if the saving is failed. Null if the saving is * successful. * @throws IOException */public static void Savebitmaptofile (Bitmap Bitmap, String _file) throws Ioexcep tion {//_file = /** * Get SDK Path * @return */public static String Getsdpat
Hello, could you ask me a question? I recently called a 6410 board and wanted to start it from the SD card. The card Detect of the SD card was detected, but the clock didn't get up, I don't know what the problem is. Now I only gen
The project will occasionally use screenshots to share, so there is the following screenshot of the method ~The following SaveImage () method is to save the screen of all the contents of the current activity.private void SaveImage () {SD Card Save pathString Savepath = environment.getexternalstoragedirectory () + "/temp.png";ShowProgress ("Please Wait", "saving picture ...");Savemybitmap (Getbitmapfromrootv
Finally:
Implement the SD card file browser
Technical analysis:
The main controls used:Listview
How to fill in the listview control, you need to traverse all the files under the entire SD card. If you traverse a folder, first obtain all the files under the folder, then we can fill all the files in this listview, so we
This example mainly implements Android to get the data in the Assets folder and write it to the SD card, which is mainly to read the database in the Assets folder and write it to the SD memory card.
The complete sample code is as follows:
Import Java.io.File;
Import Ja
Tags: system settings button tracking cmd adb shell Click SDcard sel DaemonHow do I complete an automatic SD card upgrade with adb command? Original September 09, 2014 10:50:57
2746
By means of the ADB command, the inconvenience of pressing powerkey+volumeup into menu select and Recovery mode is waived. You can put the command in the. bat file. As long as the package path is set correctly, you
();
}
2. Get the right:
3. Judge the state of SDcard (SDcard may be write-protected or not inserted sdcard)
Save
String en=environment.getexternalstoragestate () to SDcard;
Gets the SDcard state if SDcard is plugged into the phone and is not write-protected state if
(En.equals (environment.media_mounted)) {
try {
Service.savetosdcard (filename, content);
Toast.maketext (Getapplicationcontext (), "Save Success",
Android newest mobile phone internal storage size, SD card storage size Method
We used to obtain this information in the past.
// Before Android API18: fs. getAvailableBlocks () * fs. getBlockSize ()
Currently:
/** Obtain available system memory **/@ SuppressLint ("NewApi") private String getMemFree () {StatFs fs = new StatFs (Environment. getDataDirectory (). getPath (); return Formatter. for
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.