CN103577554A - Method and device for triggering multimedia database scanning of Android equipment - Google Patents
Method and device for triggering multimedia database scanning of Android equipment Download PDFInfo
- Publication number
- CN103577554A CN103577554A CN201310491783.3A CN201310491783A CN103577554A CN 103577554 A CN103577554 A CN 103577554A CN 201310491783 A CN201310491783 A CN 201310491783A CN 103577554 A CN103577554 A CN 103577554A
- Authority
- CN
- China
- Prior art keywords
- scanning
- file
- multimedia
- android equipment
- path
- 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.)
- Granted
Links
Images
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/10—File systems; File servers
- G06F16/14—Details of searching files based on file metadata
- G06F16/148—File search processing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Library & Information Science (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 discloses a method and a device for triggering multimedia database scanning of Android equipment. The method comprises the following steps: establishing a scanner client class to inherit a multimedia database inquiry service class; establishing a scanning class to instantiate the scanner client class; writing a scanning service background; modifying an adb push command; copying a file to the Android equipment through the adb push command; when the file data of push is finished, acquiring the route of the file; when judging that the route of the file is legal, transmitting the file route parameter to the scanning service background and starting the scanning service background; according to the file route parameter, setting the scanning route through the scanner client class; according to the scanning route, establishing connection between the scanner client class and background multimedia service through the scanning class and triggering multimedia database scanning. According to the method and the device, the resource-critical problem of a system caused by full scanning when data is acquired every time can be avoided.
Description
Technical field
The present invention relates to a kind of method of triggered multimedia scan database, especially a kind of method and device that triggers the scanning of Android equipment multimedia database.Belong to mobile device technical field.
Background technology
Current Android equipment, take mobile phone as example, and various mobile phone assistance application are a lot, as 91 assistants, pea pods, 360 mobile phone assistants, the mobile phone assistant of Tengxun etc.; These mobile phones assistant can operate mobile phone file system, substantially be all by pc adb(Android Debug Bridge) client, connect with mobile phone adb server, by obtaining mobile phone file system directories, use adb order (push, pull etc.), file is uploaded to down operation; When user holds mobile phone assistant by pc, by certain file push in mobile phone, many files in cellphone directory.But similar photograph album, music, the application such as video but do not find that new file is copied into mobile phone timely, because these application all depend on the multimedia database (this database has been preserved the fileinfo used in T card and mobile phone) of Android, but multimedia database only can be in start, when switching, usb memory module just can initiatively to mobile phone, be stored into line scanning, when mobile phone assistant is by adb push order, while copying new file to mobile phone, multimedia database does not scan, therefore, file does not update in database, cause user cannot use in time file, to user, bring puzzlement to a certain extent, and the main method addressing this is that is at present carried out scan full hard disk to mobile phone storage and T card exactly, thereby renewal multimedia database, but this method is not only consuming time but also waste system resource, affected the use of mobile phone.
Chinese Patent Application No. is 201110221093.7 application for a patent for invention, " a kind of scan method of multimedia file of the memory device based on Android system " disclosed, its technical characterstic is that scanning process is divided into two stages, in the first stage first by document classification to be scanned, obtain respectively the corresponding information updating of each class in database, and set up corresponding file directory, the information that wherein picture file and video file add database to only includes file name and path, and without adding metdata information, greatly save the needed time of scanning, institute's build file catalogue offers user with thumbnail form, user recognizes whether be file to be scanned by thumbnail, confirm as after file to be scanned and check and just obtain metdata information, solve prior art duration for scanning process, had the problem of the wasting of resources, therefore, what this application for a patent for invention was emphasized is the realization of scanning process, does not have the technology enlightenment of timely triggered multimedia scan database.
Summary of the invention
The object of the invention is in order to solve the defect of above-mentioned prior art, a kind of method of the Android of triggering equipment multimedia database scanning is provided, the method multimedia database that can upgrade in time, avoid obtaining data at every turn and need to carry out scan full hard disk, thereby cause system resource nervous, the problem that impact application is used.
Another object of the present invention is to provide a kind of device of the Android of triggering equipment multimedia database scanning.
Object of the present invention can be by taking following technical scheme to reach:
The method that triggers the scanning of Android equipment multimedia database, is characterized in that: described method comprises:
1) create class, write backstage and revise order
1.1) create the multimedia database inquiry service class MediaScannerConnectionClient that a scanning client class ScannerClient inherits Android equipment;
1.2) create a scanning class ScanFile instantiation ScannerClient;
1.3) write a scan service backstage FileScanService, make this backstage when starting, according to the path parameter of file, by ScanFile triggered multimedia scan database;
1.4) revise adb push order, make the path of file when legal, the path parameter of file is sent to FileScanService;
2) triggered multimedia scan database
2.1) by adb push order, copy files to Android equipment;
2.2), when the file data of push completes, obtain file in the path of Android equipment;
2.3) in the path of judgement file, when legal, the path parameter of file issued to FileScanService, and start FileScanService;
2.4), according to the file path parameter of FileScanService, the path of scanning is set by ScannerClient;
2.5) according to the scanning pattern arranging, by ScanFile, the backstage multimedia service of ScannerClient and Android equipment is connected, triggered multimedia scan database;
2.6), after scanning completes, the backstage multimedia service of ScannerClient and Android equipment disconnects.
Preferably, step 1.1) scanning client class ScannerClient of described establishment, comprising:
Define a method onMediaScannerConnected, connect with the backstage multimedia service of Android equipment;
Define a method onScanCompleted, disconnect with the backstage multimedia service of Android equipment;
Define a method setScanPath, so that the path of scanning to be set.
Preferably, step 1.2) scanning class ScanFile of described establishment, comprising:
Define a method beginScanFile, with triggered multimedia scan database.
Another object of the present invention can be by taking following technical scheme to reach:
The device that triggers the scanning of Android equipment multimedia database, is characterized in that: described device comprises:
Scanning client class creation module, for creating the multimedia database inquiry service class MediaScannerConnectionClient of a scanning client class ScannerClient succession Android equipment;
Scanning class creation module, for creating a scanning class ScanFile instantiation ScannerClient;
Module is write on scan service backstage, for writing a scan service backstage FileScanService, makes this backstage when starting, according to the path parameter of file, by ScanFile triggered multimedia scan database;
Order modified module, for revising adb push order, makes the path of file when legal, and the path parameter of file is sent to FileScanService;
File copy module, for copying files to Android equipment by adb push order;
Path acquisition module, while completing for the file data as push, obtains file in the path of Android equipment;
Path parameter sending module, when legal for the path at judgement file, issue FileScanService by the path parameter of file, and starts FileScanService;
Scanning pattern arranges module, for according to the path parameter of file, the path of scanning is set by ScannerClient;
Multimedia database scanning trigger module, for according to the scanning pattern arranging, connects the backstage multimedia service of ScannerClient and Android equipment by ScanFile, triggered multimedia scan database;
Connect and disconnect module, after completing in scanning, the backstage multimedia service of ScannerClient and Android equipment disconnects.
Preferably, described scanning client class creation module comprises:
The first definition unit, for defining a method onMediaScannerConnected, connects with the backstage multimedia service of Android equipment;
The second definition unit, for defining a method onScanCompleted, disconnects with the backstage multimedia service of Android equipment;
The 3rd definition unit, for defining a method setScanPath, so that the path of scanning to be set.
Preferably, described scanning class creation module comprises:
The 4th definition unit, for defining a method beginScanFile, with triggered multimedia scan database
The present invention has following beneficial effect with respect to prior art:
The inventive method and device, by creating the adb order of new class and modification, can be in time and accurately obtain the latest data of the application (photograph album, video, music) based on development of Multimedia Databases, avoid prior art copied files multimedia database not upgrade, obtain data at every turn and need to carry out scan full hard disk, thereby cause system resource nervous, the problem that impact application is used.
Accompanying drawing explanation
The schematic flow sheet that Fig. 1 is the present invention's establishment class of triggering Android equipment multimedia database scan method, write backstage and revise order.
Fig. 2 is the triggered multimedia scan database schematic flow sheet that the present invention triggers Android equipment multimedia database scan method.
Fig. 3 is the apparatus structure block diagram of triggering Android equipment multimedia database of the present invention scanning.
Embodiment
Embodiment 1:
The method of the triggering Android equipment multimedia database scanning of the present embodiment, comprising:
1) create class, write backstage and revise order, as shown in Figure 1, specific as follows:
1.1) create the multimedia database inquiry service class MediaScannerConnectionClient that a scanning client class ScannerClient inherits Android equipment, specific as follows:
Wherein, method onMediaScannerConnected is for connecting with the backstage multimedia service of Android equipment; Method onScanCompleted is for disconnecting with the backstage multimedia service of Android equipment; Method setScanPath is for arranging the path of scanning;
1.2) create a scanning class ScanFile instantiation ScannerClient, specific as follows:
Wherein, beginScanFile method is for triggered multimedia scan database.
1.3) write a scan service backstage FileScanService, make this backstage when starting, according to the path parameter of file, by ScanFile triggered multimedia scan database;
1.4) revise adb push order, make the path of file when legal, the path parameter of file is sent to FileScanService, as follows:
If (being push order)
Does if(show help information?) show help information, and return to 1;
Whether do push data complete if(?)
Obtain the Android device path of file, judge that whether path is legal, illegally return to 1;
Path is legal, and path is sent to FileScanService, starts multimedia database scanning }
}
2) triggered multimedia scan database, as shown in Figure 2, specific as follows:
2.1) by adb push order, copy files to Android equipment;
2.2), when the file data of push completes, obtain file in the path of Android equipment;
2.3) in the path of judgement file, when legal, the path parameter of file issued to FileScanService, and start FileScanService;
2.4), according to the file path parameter of FileScanService, the path of scanning is set by ScannerClient;
2.5) according to the scanning pattern arranging, by ScanFile, the backstage multimedia service of ScannerClient and Android equipment is connected, call ScanFile.beginScanFile () method scanning document, triggered multimedia scan database;
2.6), after scanning completes, the backstage multimedia service of ScannerClient and Android equipment disconnects.
As shown in Figure 3, the device of the triggering Android equipment multimedia database scanning that the present embodiment is corresponding, comprise that scanning client class creation module, scanning class creation module, scan service backstage write module, order modified module, document transmission module, path acquisition module, path parameter sending module, scanning pattern and module, multimedia database scanning trigger module are set and connect and disconnect module, wherein:
Described scanning client class creation module, for creating the multimedia database inquiry service class MediaScannerConnectionClient of a scanning client class ScannerClient succession Android equipment, comprising:
The first definition unit, for defining a method onMediaScannerConnected, connects with the backstage multimedia service of Android equipment;
The second definition unit, for defining a method onScanCompleted, disconnects with the backstage multimedia service of Android equipment;
The 3rd definition unit, for defining a method setScanPath, so that the path of scanning to be set;
Described scanning class creation module, for creating a scanning class ScanFile instantiation ScannerClient, comprising:
The 4th definition unit, for defining a method beginScanFile, with triggered multimedia scan database.
Module is write on described scan service backstage, for writing a scan service backstage FileScanService, makes this backstage when starting, according to the path parameter of file, by ScanFile triggered multimedia scan database;
Described order modified module, for revising adb push order, makes the path of file when legal, and the path parameter of file is sent to FileScanService;
Described file copy module, for copying files to Android equipment by adb push order;
Described path acquisition module, while completing for the file data as push, obtains file in the path of Android equipment;
Described path parameter sending module, when legal for the path at judgement file, issue FileScanService by the path parameter of file, and starts FileScanService;
Described scanning pattern arranges module, for according to the path parameter of file, the path of scanning is set by ScannerClient;
Described multimedia database scanning trigger module, for according to the scanning pattern arranging, connects the backstage multimedia service of ScannerClient and Android equipment by ScanFile, triggered multimedia scan database;
Described connection disconnects module, and after completing in scanning, the backstage multimedia service of ScannerClient and Android equipment disconnects.
Android equipment described in the present embodiment can be that the mobile phone that uses Android system, e-book, PDA, human-computer interaction terminal or other have the hand held terminal unit of Presentation Function.
In addition, one of ordinary skill in the art will appreciate that all or part of step realizing in the various embodiments described above method is to come the hardware that instruction is relevant to complete by program, corresponding program can be stored in a computer read/write memory medium, described storage medium, as ROM/RAM, disk or CD etc.
The above; it is only patent preferred embodiment of the present invention; but the protection domain of patent of the present invention is not limited to this; anyly be familiar with those skilled in the art in the disclosed scope of patent of the present invention; according to the present invention, the technical scheme of patent and patent of invention design thereof are equal to replacement or are changed, and all belong to the protection domain of patent of the present invention.
Claims (6)
1. the method that triggers the scanning of Android equipment multimedia database, is characterized in that: described method comprises:
1) create class, write backstage and revise order
1.1) create the multimedia database inquiry service class MediaScannerConnectionClient that a scanning client class ScannerClient inherits Android equipment;
1.2) create a scanning class ScanFile instantiation ScannerClient;
1.3) write a scan service backstage FileScanService, make this backstage when starting, according to the path parameter of file, by ScanFile triggered multimedia scan database;
1.4) revise adb push order, make the path of file when legal, the path parameter of file is sent to FileScanService;
2) triggered multimedia scan database
2.1) by adb push order, copy files to Android equipment;
2.2), when the file data of push completes, obtain file in the path of Android equipment;
2.3) in the path of judgement file, when legal, the path parameter of file issued to FileScanService, and start FileScanService;
2.4), according to the file path parameter of FileScanService, the path of scanning is set by ScannerClient;
2.5) according to the scanning pattern arranging, by ScanFile, the backstage multimedia service of ScannerClient and Android equipment is connected, triggered multimedia scan database;
2.6), after scanning completes, the backstage multimedia service of ScannerClient and Android equipment disconnects.
2. the method for triggering Android equipment multimedia database according to claim 1 scanning, is characterized in that: step 1.1) scanning client class ScannerClient of described establishment, comprising:
Define a method onMediaScannerConnected, connect with the backstage multimedia service of Android equipment;
Define a method onScanCompleted, disconnect with the backstage multimedia service of Android equipment;
Define a method setScanPath, so that the path of scanning to be set.
3. the method for triggering Android equipment multimedia database according to claim 1 scanning, is characterized in that: step 1.2) scanning class ScanFile of described establishment, comprising:
Define a method beginScanFile, with triggered multimedia scan database.
4. the device that triggers the scanning of Android equipment multimedia database, is characterized in that: described device comprises:
Scanning client class creation module, for creating the multimedia database inquiry service class MediaScannerConnectionClient of a scanning client class ScannerClient succession Android equipment;
Scanning class creation module, for creating a scanning class ScanFile instantiation ScannerClient;
Module is write on scan service backstage, for writing a scan service backstage FileScanService, makes this backstage when starting, according to the path parameter of file, by ScanFile triggered multimedia scan database;
Order modified module, for revising adb push order, makes the path of file when legal, and the path parameter of file is sent to FileScanService;
File copy module, for copying files to Android equipment by adb push order;
Path acquisition module, while completing for the file data as push, obtains file in the path of Android equipment;
Path parameter sending module, when legal for the path at judgement file, issue FileScanService by the path parameter of file, and starts FileScanService;
Scanning pattern arranges module, for according to the path parameter of file, the path of scanning is set by ScannerClient;
Multimedia database scanning trigger module, for according to the scanning pattern arranging, connects the backstage multimedia service of ScannerClient and Android equipment by ScanFile, triggered multimedia scan database;
Connect and disconnect module, after completing in scanning, the backstage multimedia service of ScannerClient and Android equipment disconnects.
5. the device that triggering Android equipment multimedia database according to claim 4 scans, is characterized in that: described scanning client class creation module comprises:
The first definition unit, for defining a method onMediaScannerConnected, connects with the backstage multimedia service of Android equipment;
The second definition unit, for defining a method onScanCompleted, disconnects with the backstage multimedia service of Android equipment;
The 3rd definition unit, for defining a method setScanPath, so that the path of scanning to be set.
6. the device that triggering Android equipment multimedia database according to claim 4 scans, is characterized in that: described scanning class creation module comprises:
The 4th definition unit, for defining a method beginScanFile, with triggered multimedia scan database.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310491783.3A CN103577554B (en) | 2013-10-19 | 2013-10-19 | Trigger the method and device of Android device multimedia database scanning |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310491783.3A CN103577554B (en) | 2013-10-19 | 2013-10-19 | Trigger the method and device of Android device multimedia database scanning |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103577554A true CN103577554A (en) | 2014-02-12 |
CN103577554B CN103577554B (en) | 2017-09-29 |
Family
ID=50049330
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310491783.3A Active CN103577554B (en) | 2013-10-19 | 2013-10-19 | Trigger the method and device of Android device multimedia database scanning |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103577554B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103970836A (en) * | 2014-04-13 | 2014-08-06 | 数源科技股份有限公司 | Method for accelerating multimedia scanning process in Android |
CN105391832A (en) * | 2015-11-24 | 2016-03-09 | 湖北大学 | Hardware information detection system used for detecting hardware state of smartphone |
CN105868143A (en) * | 2015-12-15 | 2016-08-17 | 乐视致新电子科技(天津)有限公司 | Method and system for stopping media scanner after USB device ejection in Android system |
CN105868135A (en) * | 2015-12-15 | 2016-08-17 | 乐视致新电子科技(天津)有限公司 | Method and system for stopping media scanner after USB device ejection in Android system |
CN106502808A (en) * | 2016-10-28 | 2017-03-15 | 广东欧珀移动通信有限公司 | A kind of method of copied files, device and terminal |
CN107451475A (en) * | 2017-06-15 | 2017-12-08 | 努比亚技术有限公司 | Multimedia file scan method and equipment, computer-readable recording medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102289484A (en) * | 2011-08-03 | 2011-12-21 | Tcl集团股份有限公司 | Method for scanning multimedia files of storage equipment based on android system |
CN102289481A (en) * | 2011-08-02 | 2011-12-21 | Tcl集团股份有限公司 | Method and device for acquiring media information of media files in peripheral equipment, and multimedia equipment |
CN103246483A (en) * | 2013-04-24 | 2013-08-14 | Tcl集团股份有限公司 | Method, system and intelligent terminal for scanning files |
-
2013
- 2013-10-19 CN CN201310491783.3A patent/CN103577554B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102289481A (en) * | 2011-08-02 | 2011-12-21 | Tcl集团股份有限公司 | Method and device for acquiring media information of media files in peripheral equipment, and multimedia equipment |
CN102289484A (en) * | 2011-08-03 | 2011-12-21 | Tcl集团股份有限公司 | Method for scanning multimedia files of storage equipment based on android system |
CN103246483A (en) * | 2013-04-24 | 2013-08-14 | Tcl集团股份有限公司 | Method, system and intelligent terminal for scanning files |
Non-Patent Citations (1)
Title |
---|
ANDROID DEVELOPERS: "MediaScannerConnection", 《ANDROID SDK文档》, 16 March 2012 (2012-03-16) * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103970836A (en) * | 2014-04-13 | 2014-08-06 | 数源科技股份有限公司 | Method for accelerating multimedia scanning process in Android |
CN105391832A (en) * | 2015-11-24 | 2016-03-09 | 湖北大学 | Hardware information detection system used for detecting hardware state of smartphone |
CN105868143A (en) * | 2015-12-15 | 2016-08-17 | 乐视致新电子科技(天津)有限公司 | Method and system for stopping media scanner after USB device ejection in Android system |
CN105868135A (en) * | 2015-12-15 | 2016-08-17 | 乐视致新电子科技(天津)有限公司 | Method and system for stopping media scanner after USB device ejection in Android system |
CN106502808A (en) * | 2016-10-28 | 2017-03-15 | 广东欧珀移动通信有限公司 | A kind of method of copied files, device and terminal |
CN106502808B (en) * | 2016-10-28 | 2019-10-15 | Oppo广东移动通信有限公司 | A kind of method, apparatus and terminal of copied files |
CN107451475A (en) * | 2017-06-15 | 2017-12-08 | 努比亚技术有限公司 | Multimedia file scan method and equipment, computer-readable recording medium |
Also Published As
Publication number | Publication date |
---|---|
CN103577554B (en) | 2017-09-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103577554A (en) | Method and device for triggering multimedia database scanning of Android equipment | |
JP4818278B2 (en) | Application linkage method and system | |
CN106445663A (en) | Application data migration method and device | |
CN105787091A (en) | Content publishing system and method supporting multiple terminals | |
US20140075301A1 (en) | Information processing apparatus, control method, and recording medium | |
CN107748780B (en) | Recovery method and device for file of recycle bin | |
WO2017185272A1 (en) | Man-machine interaction method and device therefor | |
CN105760232A (en) | Offline cache method and system for IOS application | |
CN103064738A (en) | Method and system for embedding local application program window into browser in Linux | |
CN103530160A (en) | Page loading method and device | |
CN103051652A (en) | Mobile terminal cloud commuting delivery platform | |
US20160224554A1 (en) | Search methods, servers, and systems | |
CN110941629A (en) | Metadata processing method, device, equipment and computer readable storage medium | |
CN110825600B (en) | Page information processing method, server and page display device | |
US20100017863A1 (en) | Portable storage apparatus for providing working environment migration service and method thereof | |
CN103246729A (en) | Method and system for processing multi-media files of android mobile terminal | |
CN103123651A (en) | Method of rapidly searching multiple same-kind paper, device and mobile equipment | |
CN113656005B (en) | Application component library construction method, application component configuration method and related devices | |
WO2018180023A1 (en) | File management device, file management method, and file management program | |
CN103136264A (en) | Accessory inquiring method and user terminal | |
CN113268232B (en) | Page skin generation method and device and computer readable storage medium | |
CN110941471A (en) | Method and device for internationalizing basic data of software system | |
CN105740251B (en) | Method and system for integrating different content sources in bus mode | |
WO2015035899A1 (en) | Search methods and terminals | |
US10275127B2 (en) | Client apparatus, information processing system, information processing method, and non-transitory computer readable medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd. |
|
CP01 | Change in the name or title of a patent holder |