Recently, we are studying the driver of pxa300 SD card.Program, Figured out the SD card initialization process, the record is as follows
1. The pxamci_probe () function calls mmc_alloc_host () to allocate the mmc_host structure and initializes the mmc_rescan latency task.
2. initialize the mmc_host structure, initialize the MMC hardware controller registers,
storage method:
Storage Method:Sharedpreference
Advantages: simple, convenient, and suitable for quick storage of simple data
Disadvantages: 1. The number of stored files can only be used in the same package, not between different packages!
2. By default, data is stored in the system path/data/COM. himi/. No method for storing the data on the SD card is found.
Summary: in fact, this storage method is jus
the underlying function is sd_init.
Simply let it return 0 in Disk_status, indicating success.
Disk_read can see that the input has four parameter values, namely the device type PDRV, the data buffer pointer buff, the sector address sector, and the number of sectors count. This shows that Disk_read can read more than one sector at a time, adding in the function body
for (cnt=0; cnt
Res =sd_readsingleblock (sector+cnt, buff+cnt*512);
if (res! = RES_OK) return res_error;
}
Similarly, this is also
can store more data.
2. Store database files in the SD card!
What is sqlitedatabase?
An instance of sqlitedatabase represents an SQLite database. Through some methods of the sqlitedatabase instance, we can execute SQL statements to add, delete, query, and modify data databases. Note that the database is private to an application, and the database name is unique in an application.
What is sqliteopenhelpe
. Export files to the SD card
In cmd, the command is as follows: F: \ Program Files \ Android-SDK \ platform-tools>ADB push 1.png sdcard/cloth/1. PNG
This command copies the 1.png file under F: \ Program Files \ Android-SDK \ platform-toolsto the cloth directory of the sdcard.
Note: The cloth directory is self-built, and the directory name must exist.Run the command after the application run.
(Note
Step one: Turn on your computer's data-dog data recovery software, enter the main interface of the software, select the "delete recovery" mode, as shown in the following figure.
The second step: in the Region 1 selected SD card, click on the Region 2 key to enter the data recovery progress bar.
Step three: Wait for the data scan progress
SD card driver recently writtenProgram. After reading datasheet, sort it as follows:
The first thing you need to know is:SD card ProtocolAndHarddisk (File System)Block and sectorIt does not mean anything.
For sdks, see "Maid physical_layer_simplified_specification_ver_3.020.final_100518.pdf" (click to download)
The meanings of block and sector in the
I found that I could not write files to the USB flash drive/SD card today. I carefully checked that the USB flash drive is read-only. I tried to solve this problem using n methods:
1. chmod U + x/Media/usbdisk
The prompt "read-only file system" cannot be changed.
2. sudo Mount-o rw-O remount-o User-T vfat/dev/sdb1/Media/usbdiskA prompt is displayed for the read-only file system.
3. Formatting also promp
each time through the output stream to the SD card to write files, connected to the computer, using MTP to simulate a mobile disk, open the disk but there is no such a file, and the way to see through the ADB, the cause of this phenomenon is that after each write, the MTP database is not updated, Because the update of the MTP database requires a large price ratio, so only in the restart, mount and the user
each time through the output stream to the SD card to write files, connected to the computer, using MTP to simulate a mobile disk, open the disk but there is no such a file, and the way to see through the ADB, the cause of this phenomenon is that after each write, the MTP database is not updated, Because the update of the MTP database requires a large price ratio, so only in the restart, mount and the user
Each time through the output stream to the SD card to write files, connected to the computer, using MTP to simulate a mobile disk, open the disk but there is no such a file, and the way to see through the ADB, the cause of this phenomenon is that after each write, the MTP database is not updated, Because the update of the MTP database requires a large price ratio, so only in the restart, mount and the user
the volume label of the virtual disk. This parameter does not exist.
4. Suffix of the Virtual File. img
Input mksdcard help in DOS.
2. After creating the sdcard, We need to load the sdcard in the simulator.
Window-> AVD Manager-select the simulator you are using-> Edit
Select File in the SD card option, select the newly created sdcard. IMG, and click Edit AVD to save the configuration.
3. Add files to the
When you save the picture after opening gallery, some will automatically refresh you, some do not, so that the picture saved to the SD card, not in time to see in gallery, encountered this situation is best to refresh themselves.
Full SD card scanning via intent.action_media_mounted:
The code is as follow
recover the photos on the camera memory card, the detailed steps are as follows:1, download and install the "Le Isia digital Photo Recovery" software.Http://www.lyj-soft.com/download/downphoto.html2. Connect your camera memory card to your computer using a card reader.3, run the "Le Isia digital Photo Recovery" software, the following interface appears.If your m
parameter does not exist.
4. Suffix of the Virtual File. img
Input mksdcard help in DOS.
II,After creating the sdcard, We need to load the sdcard in the simulator.
Window-> AVD Manager-select the simulator you are using-> Edit
Select File in the SD card option, select the newly created sdcard. IMG, and click Edit AVD to save the configuration.
3. Add files to the sdcard of the simulator. (Note:
The following is a tool class. It uses recursion to scan the APK file on the SD card to determine whether the application has been installed on the mobile phone. If so, it determines whether the application can be upgraded. DetailsCodeAs follows:
/*** Obtain the APK File Information class on the mobile phone, mainly to determine whether or not to install i
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.