Alibabacloud.com offers a wide variety of articles about sd card corrupted android fix, easily find your sd card corrupted android fix information here online.
If you want to use SD card during development, you must specify
There are two ways to create an SD card. One is to directly enter the size to be created and the ADT is automatically created. The other is the image file of the specified sdcard.
Use the mksdcard.exe tool in sdkto create an image file for sdcard. For
Read the SD card file information and add it to the listview to display it:
Listview obtains the information of the SD FileCode:
List
Draw different images based on filetype:
Public long getsdtotalsize () {/* Gets the memory card path */File sdcarddir= environment.getexternalstoragedirectory (); /*statfs See File system space Usage */StatFs statfs=new StatFs (Sdcarddir.getpath ()); Long blocksize= Statfs.getblocksizelong (); Long Totalsize=statfs.getblockcountlong (); return blocksize*totalsize;} /** * Get the remaining capacity of SD
.
Propertyconfigurator. getconfigurator (this). Configure ();
4. Put the microlog. properties file in the assets folder.
Note: The assets folder is the same as the res folder.
Then change the microlog. properties file to the following:
Microlog. Level = debugMicrolog. appender = logcatappender; fileappenderMicrolog. formatter = patternformatterMicrolog. formatter. patternformatter. pattern = % C [% P] % m % t
5. Write log records
Logger. debug ("My debug ");
6. Add
The specific usage is as follows:
1. Download
Download the http://code.google.com/p/microlog4android/downloads/list and microlog. properties files to the microlog4android-1.0.0.jar
2. Create a logger object
Private Static final logger = loggerfactory. getlogger (main. Class );
3.ProgramThe initialization method in the oncreate method of the first activity
Propertyconfigurator. getconfigurator (this). Configure ();
4. Put the microlog. properties file in the assets folder.
Note: Th
Objective:Use the activity of the Openfileoutput () method to save the file, the file is stored in the mobile phone space, the general phone storage space is not very large, storage of small files is OK, if you want to store large files such as video, it is not feasible. For large files like video, we can store it in SDcard. What is sdcard for? You can think of it as a removable hard drive or USB stick.To use SDcard in the simulator, you need to first create a SDcard
modified:This project is compiled through, can be deployed to the mobile phone!Finally, I followed the previous method to do it again, found a one-time solution to the problem, what files do not have to modify!Iv. Final SummaryWhether to import a project or a new project to die, found that it is to download: Gradle-xxx-all.zip when the best solution is to follow the above method to download the corresponding version, and then put it in that directory, this eliminates the need to modify this, mo
5 floor
, awesome bird. 2016-12-20 09:31 published [Reply]
First Floor said the right, thank Bo Master!!!
4 floor
Woshishuaibi2016-11-04 10:16 published [Reply]
solved, worship landlord!
3 floor
wangyunzan1232016-10-09 11:58 published [Reply]
Thank you very much!!!
2 Floor
Wheat Field _ Watch 2016-09-13 15:22 published [Reply]
Likes
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.