CN103970836A - Method for accelerating multimedia scanning process in Android - Google Patents
Method for accelerating multimedia scanning process in Android Download PDFInfo
- Publication number
- CN103970836A CN103970836A CN201410144924.9A CN201410144924A CN103970836A CN 103970836 A CN103970836 A CN 103970836A CN 201410144924 A CN201410144924 A CN 201410144924A CN 103970836 A CN103970836 A CN 103970836A
- Authority
- CN
- China
- Prior art keywords
- scanning
- storage volume
- directory
- level sub
- multimedia
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/40—Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a method for accelerating a multimedia scanning process in Android. According to the method, scanning workload is reduced by controlling the multimedia scanning range, and accordingly scanning time is reduced. According to the technical scheme, a storage volume which does not need multimedia scanning is determined in advance according to special purposes and other characteristics of outside storage volumes, and multimedia scanning is not carried out on the storage volume after a Media Provider receives broadcasts mounted on the storage volume; as for a storage volume needing scanning, directories which do not need media scanning in a first-level subdirectory are determined in advance, particularly the directories which contain a large number of files but do not contain multimedia files; when media scanning is carried out on the storage volume, the first-level storage subdirectory which does not need to be scanned is skipped. By means of the method, medium scanning time can be effectively shortened.
Description
Technical field
The present invention relates to a kind of method of accelerating multimedia scanning process, in particular in a kind of Android, accelerate the method for multimedia scanning process.
Background technology
Android system is after system starts, need to carry out a multimedia scanning to memory device, and the media files such as the audio frequency and video that scan are recorded to database, and then offer other application (such as music player, video player etc.) and system call with a kind of unified form (MediaProvider).At present, Android system is widely used in all kinds of built-in fields, and hardware configuration also constantly promotes, and memory device quantity and storage space also constantly increase, and start after multimedia scanning process required time also constantly increase, and then have influence on some multimedia application user experience.
Current multimedia scanning process is: system is sent respective broadcast (ACTION_BOOT_COMPLETED) after starting, and the MediaScannerReceiver in MediaProvider starts traverse scanning storage inside after receiving broadcast; After exterior storage carry, also can send respective broadcast (ACTION_MEDIA_MOUNTED), the MediaScannerReceiver in MediaProvider starts traverse scanning exterior storage after receiving broadcast.In order better to support multiple storage devices, some manufacturers revise the latter, after each certain external storage volume carry, only can scan this storage volume, instead of scan whole external memory space guaranteeing, the present invention also based on this.But no matter be which kind of method, its scanning process is all the traversal completely that does not add screening, therefore have in the traversal that time waste there is no need at some, especially in the time that some storage volume is respectively had its own special purpose, and determine when some file directory of certain storage volume there is no need scanning (such as there not being multimedia file under this catalogue, or multimedia file under this catalogue should be ignored).
Summary of the invention
In order to overcome the deficiency of existing multimedia scanning process overlong time, the invention provides a kind of method of accelerating multimedia scanning process, reduce the workload of scanning by controlling the scope of multimedia scanning, thereby reduce sweep time.
The technical scheme that technical solution problem of the present invention adopts is: a kind of method of accelerating multimedia scanning process, determine without the storage volume of carrying out multimedia scanning according to characteristics such as the special purposes of each external storage volume in advance, after MediaProvider receives the broadcast of this volume carry, this is not involved in the scanning of row multimedia; The storage volume scanning for needs, pre-determine in its one-level sub-directory without the catalogue of carrying out Media Survey, especially those comprise heap file does not but have the catalogue of multimedia file, in the time that this is involved in to row Media Survey, skips these one-level sub-directories without scanning.By this method, can effectively reduce the time of Media Survey.
Accelerate a method for multimedia scanning process, its step is as follows:
Step 1, determines in all memory devices without the storage volume scanning, and records the name of storage volume;
Step 2, for the storage volume of needs scanning, determines in its all one-level sub-directories without the one-level sub-directory scanning, and records the name of this storage volume and the name of corresponding all one-level sub-directories without scanning;
Step 3, Android system starts when complete, sends respective broadcast (ACTION_BOOT_COMPLETED);
Step 4, MediaScannerReceiver receives broadcast (ACTION_BOOT_COMPLETED), and creates MediaScanner, starts to scan storage inside (storage inside must scan);
Step 5, when MediaScanner scanning storage inside, whether the one-level sub-directory that judgement scans is included under this volume that step 2 records in the one-level sub-directory without scanning, if do not comprised, this one-level sub-directory of traverse scanning, if comprised, skips this one-level sub-directory;
Step 6, in the time having external storage volume carry to complete, system is sent respective broadcast (ACTION_MEDIA_MOUNTED);
Step 7, MediaScannerReceiver receives broadcast (ACTION_MEDIA_MOUNTED), the path that then draws this Uri according to the additional Uri data of this Intent, then draw the name of corresponding storage volume according to this path;
Step 8, if the name of this storage volume is included in the name of the storage volume without scanning of record in step 1, does not scan and enters step 11 to it, otherwise, enter step 9;
Step 9, creates MediaScanner, starts to scan this external storage volume;
Step 10, when MediaScanner scanning external storage volume, whether the one-level sub-directory that judgement scans is included under this volume that step 2 records in the one-level sub-directory without scanning, if do not comprised, this one-level sub-directory of traverse scanning, if comprised, skips this sub-directory;
Step 11, storage volume has scanned, and sends broadcast (ACTION_MEDIA_SCANNER_FINISHED);
Step 12, multimedia application receives after broadcast (ACTION_MEDIA_SCANNER_FINISHED), i.e. the addressable multimedia database multi-medium data after upgrading, and then can carry out the operation such as analysis, demonstration, broadcasting of data.
Compare with conventional art, the invention has the beneficial effects as follows: the method has effectively reduced the time of Media Survey process, has reduced the stand-by period of multimedia application, and then promoted user's experience of multimedia application.Especially when file amount in memory device is huge and it is clear and definite to press catalog classification, maybe ought exist multiple memory devices and each memory device to have in the situation of its special purpose, promote effect particularly evident.
Brief description of the drawings
Fig. 1 is the process flow diagram that the present invention accelerates multimedia scanning process.
Embodiment
Be elaborated with reference to accompanying drawing below in conjunction with embodiment, to technical characterictic of the present invention and advantage are interpretated more in-depth.
A kind of method of accelerating multimedia scanning process, first determine the storage volume without scanning in all memory devices, and determine in the file directory that needs the storage volume scanning without the one-level sub-directory scanning, then in operation, when scanning, skip these volumes and catalogue, reduce with this scanning there is no need, and save sweep time.
The present invention accelerate multimedia scanning process method process flow diagram as shown in Figure 1, its step is as follows:
Step 1, analyzes and determines in all memory devices without the storage volume scanning, and recording the name of storage volume, and the name of these storage volume is all stored in a static array, and this array define is in MediaScannerReceiver;
Step 2, for the storage volume of needs scanning, determine in its all one-level sub-directories without the one-level sub-directory scanning, record the name of the name of this storage volume and all one-level sub-directories without scanning of correspondence, form with key-value pair mapping is stored in a HashMap, wherein key is the name of storage volume, and value is an array, under this volume of this storage of array without scanning one-level sub-directory.A key-value pair in the corresponding HashMap of each like this storage volume.This HashMap is defined in MediaScanner;
Step 3, Android system starts when complete, sends respective broadcast (ACTION_BOOT_COMPLETED);
Step 4, MediaScannerReceiver receives broadcast (ACTION_BOOT_COMPLETED), and creates MediaScanner, starts to scan storage inside (storage inside must scan);
Step 5, when MediaScanner scanning storage inside volume, first obtain array corresponding in HashMap according to the name of storage volume, whether the one-level sub-directory that then judgement scans is included in array, if do not comprised, this one-level sub-directory of traverse scanning, if comprised, skips this sub-directory;
Step 6, in the time having External memory equipment carry to complete, system is sent respective broadcast (ACTION_MEDIA_MOUNTED);
Step 7, MediaScannerReceiver receives broadcast (ACTION_MEDIA_MOUNTED), the path that then draws this Uri according to the additional Uri data of this Intent, then draw the name of corresponding storage volume according to this path;
Step 8, judges whether the name of this storage volume is included in the storage volume array that need to ignore scanning, if comprised, it is not scanned and is entered step 11, if do not comprised, enters step 9;
Step 9, creates MediaScanner, starts to scan this external storage volume;
Step 10, when MediaScanner scanning external storage volume, first obtain array corresponding in HashMap according to the name of storage volume, whether the one-level sub-directory that then judgement scans is included in array, if do not comprised, this one-level sub-directory of traverse scanning, if comprised, skips this sub-directory;
Step 11, when a storage volume completes after scanning, sends broadcast (ACTION_MEDIA_SCANNER_FINISHED);
Step 12, multimedia application receives after broadcast (ACTION_MEDIA_SCANNER_FINISHED), i.e. the addressable multimedia database multi-medium data after upgrading, and then can carry out the operation such as analysis, demonstration, broadcasting of data.
By the description of above embodiment, those skilled in the art can be well understood to the present invention and can effectively reduce the time of Media Survey, and the user who promotes multimedia application experiences, especially when file amount in memory device is huge and it is clear and definite to press catalog classification, maybe ought exist multiple memory devices and each memory device to have in the situation of its special purpose, promote effect particularly evident.
Claims (1)
1. a method of accelerating multimedia scanning process in Android, is characterized in that comprising following steps:
Step 1, determines in all memory devices without the storage volume scanning, and records the name of storage volume;
Step 2, for the storage volume of needs scanning, determines in its all one-level sub-directories without the one-level sub-directory scanning, and records the name of this storage volume and the name of corresponding all one-level sub-directories without scanning;
Step 3, Android system starts when complete, sends respective broadcast (ACTION_BOOT_COMPLETED);
Step 4, MediaScannerReceiver receives broadcast (ACTION_BOOT_COMPLETED), and creates MediaScanner, starts to scan storage inside;
Step 5, when MediaScanner scanning storage inside, whether the one-level sub-directory that judgement scans is included under this volume that step 2 records in the one-level sub-directory without scanning, if do not comprised, this one-level sub-directory of traverse scanning, if comprised, skips this one-level sub-directory;
Step 6, in the time having external storage volume carry to complete, system is sent respective broadcast (ACTION_MEDIA_MOUNTED);
Step 7, MediaScannerReceiver receives broadcast (ACTION_MEDIA_MOUNTED), the path that then draws this Uri according to the additional Uri data of this Intent, then draw the name of corresponding storage volume according to this path;
Step 8, if the name of this storage volume is included in the name of the storage volume without scanning of record in step 1, does not scan and enters step 11 to it, otherwise, enter step 9;
Step 9, creates MediaScanner, starts to scan this external storage volume;
Step 10, when MediaScanner scanning external storage volume, whether the one-level sub-directory that judgement scans is included under this volume that step 2 records in the one-level sub-directory without scanning, if do not comprised, this one-level sub-directory of traverse scanning, if comprised, skips this sub-directory;
Step 11, storage volume has scanned, and sends broadcast (ACTION_MEDIA_SCANNER_FINISHED);
Step 12, multimedia application receives after broadcast (ACTION_MEDIA_SCANNER_FINISHED), i.e. the addressable multimedia database multi-medium data after upgrading, and then can carry out the operation such as analysis, demonstration, broadcasting of data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410144924.9A CN103970836A (en) | 2014-04-13 | 2014-04-13 | Method for accelerating multimedia scanning process in Android |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410144924.9A CN103970836A (en) | 2014-04-13 | 2014-04-13 | Method for accelerating multimedia scanning process in Android |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103970836A true CN103970836A (en) | 2014-08-06 |
Family
ID=51240333
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410144924.9A Pending CN103970836A (en) | 2014-04-13 | 2014-04-13 | Method for accelerating multimedia scanning process in Android |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103970836A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106502582A (en) * | 2016-09-30 | 2017-03-15 | 维沃移动通信有限公司 | A kind of directory scan method and mobile terminal |
CN111596961A (en) * | 2019-02-20 | 2020-08-28 | 青岛海信移动通信技术股份有限公司 | Media scanning method and electronic equipment |
EP4002158A1 (en) | 2020-11-11 | 2022-05-25 | Arçelik Anonim Sirketi | Computing device for handling multimedia files and method thereof |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080229016A1 (en) * | 2007-03-16 | 2008-09-18 | Nigel Waites | Boot in a media player with external memory |
CN102411628A (en) * | 2011-12-19 | 2012-04-11 | Tcl集团股份有限公司 | Android system-based file scanning method and device |
CN102970420A (en) * | 2012-11-07 | 2013-03-13 | 广东欧珀移动通信有限公司 | Picture filter method and system in Android system |
CN103514270A (en) * | 2013-09-13 | 2014-01-15 | 广东欧珀移动通信有限公司 | Multimedia database scanning method and device |
CN103577554A (en) * | 2013-10-19 | 2014-02-12 | 广东欧珀移动通信有限公司 | Method and device for triggering multimedia database scanning of Android equipment |
-
2014
- 2014-04-13 CN CN201410144924.9A patent/CN103970836A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080229016A1 (en) * | 2007-03-16 | 2008-09-18 | Nigel Waites | Boot in a media player with external memory |
CN102411628A (en) * | 2011-12-19 | 2012-04-11 | Tcl集团股份有限公司 | Android system-based file scanning method and device |
CN102970420A (en) * | 2012-11-07 | 2013-03-13 | 广东欧珀移动通信有限公司 | Picture filter method and system in Android system |
CN103514270A (en) * | 2013-09-13 | 2014-01-15 | 广东欧珀移动通信有限公司 | Multimedia database scanning method and device |
CN103577554A (en) * | 2013-10-19 | 2014-02-12 | 广东欧珀移动通信有限公司 | Method and device for triggering multimedia database scanning of Android equipment |
Non-Patent Citations (1)
Title |
---|
ZXJGOODBOY: "Android (MediaScanner)多媒体扫描过程", 《百度文库》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106502582A (en) * | 2016-09-30 | 2017-03-15 | 维沃移动通信有限公司 | A kind of directory scan method and mobile terminal |
CN111596961A (en) * | 2019-02-20 | 2020-08-28 | 青岛海信移动通信技术股份有限公司 | Media scanning method and electronic equipment |
CN111596961B (en) * | 2019-02-20 | 2023-09-19 | 青岛海信移动通信技术有限公司 | Media scanning method and electronic equipment |
EP4002158A1 (en) | 2020-11-11 | 2022-05-25 | Arçelik Anonim Sirketi | Computing device for handling multimedia files and method thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10452609B2 (en) | Method and system for scanning local media file | |
CN102289484B (en) | Method for scanning multimedia files of storage equipment based on android system | |
CN102761623B (en) | Resource self-adaptive joins method for down loading, system, data storage server and communication system | |
CN102411629A (en) | File scanning method and device based on android system | |
CN105049903A (en) | Method and system for cross-device synchronization of media files and media playing device | |
CN112714359B (en) | Video recommendation method and device, computer equipment and storage medium | |
CN103945259A (en) | Online video playing method and device | |
CN105025319A (en) | Video pushing method and device | |
CN103338394A (en) | Application startup method and device | |
CN102340699A (en) | Method and system for storing historical use information of television user | |
CN103970836A (en) | Method for accelerating multimedia scanning process in Android | |
CN103634647A (en) | Method and device for synchronizing playing records of mobile terminal and smart television | |
CN103744912A (en) | Video file scanning method and electronic device | |
CN106254948A (en) | A kind of terminal unit plays control method and the device of start video | |
CN104811789A (en) | Method and device for managing multimedia files | |
CN106331089A (en) | Video play control method and system | |
CN102830943B (en) | Method and system for playing multimedia files in external USB (universal serial bus) storage on the basis of Android platform | |
CN103473240A (en) | Storage-equipment-based file scanning method and device | |
DE102018119101A1 (en) | IMPLEMENTING ACTION ON ACTIVE MEDIA CONTENT | |
CN103220587A (en) | Method and device for obtaining time shifting contents | |
CN103246729A (en) | Method and system for processing multi-media files of android mobile terminal | |
CN103092988A (en) | Realizing method of directly managing mobile phone media resources on desktop | |
CN103729418A (en) | Vehicular platform media file managing method | |
CN103136264A (en) | Accessory inquiring method and user terminal | |
CN103747342A (en) | Program list arranging method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140806 |