[Tutorial] [original] completely solves the power consumption of media scanning (Shen Jing) and completely solves Shen Jing

Source: Internet
Author: User

[Tutorial] [original] completely solves the power consumption of media scanning (Shen Jing) and completely solves Shen Jing

Http://bbs.gfan.com/android-6740350-1-1.html

Original virgin stickers, haha...
I have been studying 4.1.2 for some time. I am quite satisfied with all the functions of 4.1.2. It is quite easy to use. Occasionally, I saw some people saying that 4.1.2 had a media scanning power-consuming bug. At that time, I did not agree, but I was glad that my version was correct until one day, this bug broke out...
On that day, I went to a software program named "Hundred-Byte". After Entering the software, I ordered offline data packet download. After a while, all the data was downloaded, And the nightmare began. Mobile phones have serious fever, and 20% of the power is down in an hour. At first, I thought it was a ghost with a hundred buzzwords, and the power consumption remained after uninstallation. Depending on the battery usage, it is found that the power consumption of a system application called "Media" is severe, far exceeding the screen power consumption. However, after entering the system, Shuang Qing found that the power consumption remained. I can't help this time...
So far, I started to study this consumable application and found that this is a media application. On the other hand, a MediaScannnerService in mediaprovider.apk is consistently running in the background. If the service is disabled, the power consumption immediately stops. However, after restarting, I found that images, videos, and sounds could not be viewed, and even the camera could not take pictures. Google knows that this service is actually used to prepare media for Android. It is estimated that it should be used to scan media files in the background and provide them to graphic programs and playing programs. So why is this service no longer consumes power now? I felt that the problem was still caused by the hacking of hundreds of words, so I carefully checked the sd card and found that a large number of files were downloaded from my sd card (in sdcard0 \ baicizhan ), the size is not very big, that is, several hundred megabytes, but there are too many files and tens of thousands of files. As a result, the problem was found, that is, when the media scanned the SD card, due to too many files, resulting in scanning blocking, occupying resources, resulting in fever.
  
The cause is found, and the problem also arises. Since this service cannot be stopped, it is inevitable that many files will be copied on the SD card. Can I exclude files or folders that users do not want to scan during the scan? I asked du Niang and worshipped Gu Ge. Although I found some clues, most of them were also vague and could not be solved. As a result, I began to explore it myself. After countless modifications and restarts, I finally found two ways to completely solve this problem:
  
The first is what Netizens call the. nomedia method. That is, create a file named. nomedia in a folder that does not want the system to scan. There are two online statements about this file: Create a. nomedia empty file and create a. nomedia folder. I personally think that it is enough to create a. nomedia empty file, because the system uses this method to avoid searching for data files. Let's take a look. Open this directory \ sdcard0 \ Android \ Data and find there is a. nomedia empty file in it. Because this file starts with., Android will regard it as a hidden file and you need to use the re manager to see it. You can directly copy this file or create an empty file by yourself and change it to this name. Some netizens also said that even if the file is created under the folder, the system will still scan the folder, so the next two important steps will be taken.
The system has scanned the folder and the folder already exists in the Database. Therefore, even if the. nomedia file exists, the system still scans the folder. Solution: Go to the Application Manager, find the media storage application, and click clear cache. In this way, all scanned data files are cleared, this restart will not scan.
  
The second method is described below: This method is only applicable to models above 4.1 and is root. It can be implemented by modifying the/system/csc/feature. xml file.
Modify: <CscFeature_MediaScanner_SkipFolder4>/storage/sdcard0/autonavidata50/,/storage/sdcard0/DioDict3B/</CscFeature_MediaScanner_SkipFolder4>
We can see that android uses this configuration to prohibit scanning of navigation data and Dictionary data to improve system performance. So we can also imitate it. For example, if we don't want the system to scan the baicizhan directory on sdcard0, add or rewrite one.
<CscFeature_MediaScanner_SkipFolder4>/storage/sdcard0/baicizhan/,/storage/sdcard0/DioDict3B/</CscFeature_MediaScanner_SkipFolder4>
Because I didn't use the navigation provided by Samsung, I changed it here. Note that the directory must be written to the correct directory. Similarly, after modification, you need to go to the Application Manager to clear the media storage cache and restart.
After the device is started, how long is the media scan time? Is it much better than before? If you are not sure whether the media has scanned this folder, you can copy several images to this folder, check whether the image in the excluded folder is loaded to the image library.
The above two methods have been successfully tested. What is the difference between the two methods. the nomedia method is relatively simple, and there are also dedicated management tools, such as: Bear. nomedia management tools, etc. There are many nomedia searches on googlplay. The disadvantage of this method is that the media must scan the. nomedia file in the folder before scanning the folder. In contrast, the second method is to skip scanning, but it is complicated to set up. Both methods need to clear the media storage cache and restart.
All texts are original. For reprinted texts, please include my name Niky. To help more people, we will not set the reply to be visible. Please review your conscience and reply.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.