CN106959824A - A kind of method for ensureing to obtain various Android mobile phone external memory card paths - Google Patents

A kind of method for ensureing to obtain various Android mobile phone external memory card paths Download PDF

Info

Publication number
CN106959824A
CN106959824A CN201710158545.9A CN201710158545A CN106959824A CN 106959824 A CN106959824 A CN 106959824A CN 201710158545 A CN201710158545 A CN 201710158545A CN 106959824 A CN106959824 A CN 106959824A
Authority
CN
China
Prior art keywords
path
external memory
list
memory card
card
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
Application number
CN201710158545.9A
Other languages
Chinese (zh)
Inventor
林冬娴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Bee Assistant Network Technology Ltd By Share Ltd
Original Assignee
Guangdong Bee Assistant Network Technology Ltd By Share Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangdong Bee Assistant Network Technology Ltd By Share Ltd filed Critical Guangdong Bee Assistant Network Technology Ltd By Share Ltd
Priority to CN201710158545.9A priority Critical patent/CN106959824A/en
Publication of CN106959824A publication Critical patent/CN106959824A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0605Improving or facilitating administration, e.g. storage management by facilitating the interaction with a user or administrator

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

A kind of method for ensureing to obtain various Android mobile phone external memory card paths, the step of including obtaining SD card path list, the step of higher than 4.3 system acquisition approach, the step of default method acquisition approach, the step of reading CONFIG.SYS acquisition approach, obtain the abnormal step of system file, the step of path Map of acquisition system, and by writing and checking that specific file carries out the checking in path, logical various ways obtain external memory card path, it ensure that different brand mobile phones can obtain available external memory card path, used for developer, it is easy to the optimization to application program, and the protection of cell phone system internal memory.The logical various ways of the present invention obtain external memory card path, it is ensured that different brand mobile phones can obtain available external memory card path, be used for developer, are easy to the optimization to application program, and cell phone system internal memory protection.

Description

A kind of method for ensureing to obtain various Android mobile phone external memory card paths
Technical field
Various Android mobile phone external memory card roads are obtained the present invention relates to field of computer technology, more particularly to a kind of guarantee The method in footpath.
Background technology
With the popularization of smart mobile phone, in the market occurs in that the mobile phone of various brands and type, and these mobile phones are most of All it is the smart mobile phone of Android system.Because manufacturer is different, the operating system used by different brands is also all different, and Each self-defined folder path all makes a big difference, and is obtained which results in the commonsense method provided with Google less than effective External memory card path, the present invention is exactly, in order to solve this problem, to go to obtain the external memory card of mobile phone by a variety of methods Path, it is ensured that find the path of effective external storage card.
The content of the invention
It is an object of the invention to propose a kind of method for ensureing to obtain various Android mobile phone external memory card paths.
For up to this purpose, the present invention uses following technical scheme:
A kind of method for ensureing to obtain various Android mobile phone external memory card paths, comprises the following steps:
Step one:The step of obtaining SD card path list
A, higher than 4.3 system acquisition approachs:
If Android system is higher than 4.3, the SDK carried by Android system obtains external memory card path;
B, default method acquisition approach:
For various Android mobile phones, general external memory card path is obtained by the mobile phone A PI default methods provided;
C, reading CONFIG.SYS acquisition approach:
Cell phone system profile information is obtained, external memory card path is obtained;
D, acquisition system file are abnormal:
Implement after above-mentioned steps A, B and C, path acquisition is unsuccessful, is judged as exception occur, abnormal then execution E and F occur, it is no Then perform G;
E, the path Map for obtaining system:
Cell phone system configuration file is obtained, key-value pair is obtained, the value according to each keyword obtains the path of system;
F, according to file obtain specified path:
According to the SD card path of common external memory card route matching current system;
Individual handset specific aim sets particular path:
The mode specified one by one is taken to obtain SD card road for individual handset;
G, list are less than 2:
The list in the possible SD card path of generation, only provides 2 available SD card paths in list;
H, return list:
When getting available SD card list, return to user and use;
Step 2:The step of verifying SD card path list
A, obtain SD card path:
The SD card path list obtained using in step one writes the specific file for difference as checking target to SD card path; Step A-each the steps of F are received must just write this file behind path, this file is used as a unique mark;
B, check specific file:
Check SD card path whether a containing step write-in specific file, illustrate that the path is present in list containing the specific file In;
C, to obtained catalogue write specific file:
Do not contain specific file, then write specific file to the catalogue;
D, active path, add list:
Write successfully, then path is read-write path, as active path, adds list.
E, invalid catalogue:
Write-in failure, then the path can not be read and write, and be considered as idle task, abandon path.
Keyword described in step F includes storage, secure, asec, firmware, shell or obb.
The logical various ways of the present invention obtain external memory card path, it is ensured that different brand mobile phones can obtain available External memory card path, is used for developer, is easy to the optimization to application program, and cell phone system internal memory protection.
Brief description of the drawings
Fig. 1 is the flow chart of the step one of the present invention;
Fig. 2 is the flow chart of the step two of the present invention.
Embodiment
Further illustrate technical scheme below in conjunction with the accompanying drawings and by embodiment.
A kind of method for ensureing to obtain various Android mobile phone external memory card paths, comprises the following steps:
Step one:The step of obtaining SD card path list
A, higher than 4.3 system acquisition approachs:
If Android system is higher than 4.3, the SDK carried by Android system(Software development kit softwares are opened Send out kit)Obtain external memory card path;There is the instrument in acquisition external memory card path higher than the SDK versions of 4.3 systems.
B, default method acquisition approach:
For various Android mobile phones, pass through mobile phone A PI(Application Programming Interface application programs are compiled Journey interface)The default method of offer obtains general external memory card path;Have one inside the API of any version Android mobile phone It is individual to obtain the instrument on external memory card road, but differ and surely obtain successfully
C, reading CONFIG.SYS acquisition approach:
Cell phone system profile information is obtained, external memory card path is obtained;
D, acquisition system file are abnormal:Obtain abnormal just for step C methods, because reading system file individual handset does not have Open authority, or without this file, or error is opened, at this moment system will report an error, for the method energy of let us Enough correct execution are gone down, and we can capture these exceptions, and D steps are exactly the operation performed after capture.
Implement after above-mentioned steps A, B and C, path obtains unsuccessful, be judged as occurring it is abnormal, occur it is abnormal then perform E and F, otherwise performs G;
E, the path Map for obtaining system:
Cell phone system configuration file is obtained, key-value pair is obtained, the value according to each keyword obtains the path of system;
F, according to file obtain specified path:Here matching is to obtain one on all of system directory with cmd orders File stream, then matched from these file streams(Storage, secure, asec, firmware, shell or obb)Contain these The introductory path of field is used as external memory card path.
According to the SD card path of common external memory card route matching current system;
Individual handset specific aim sets particular path:
The mode specified one by one is taken to obtain SD card road for individual handset;
The primary Android system of Google has been rewritten by some mobile phones such as Huawei, millet, and defines the file directory system of oneself, because This can award specified specific external memory card path after obtaining mobile phone business men model.
G, list are less than 2:
The list in the possible SD card path of generation, only provides 2 available SD card paths in list;
H, return list:
When getting available SD card list, return to user and use;
Step 2:The step of verifying SD card path list
A, obtain SD card path:
Using the SD card path list of step one acquisition as checking target, the specific file for difference is write to SD card path;
In step A-F, each step, which is received, must just write this file behind path, and this file is made as a unique mark With there is two, first this path of confirmation can be read and write, and be available.Second, it is ensured that the path got will not be weighed It is multiple, obtain the list in an external memory card path without weight;
B, check specific file:
Check SD card path whether a containing step write-in specific file, illustrate that the path is present in list containing the specific file In;
C, to obtained catalogue write specific file:
Do not contain specific file, then write specific file to the catalogue;
D, active path, add list:
Write successfully, then path is read-write path, as active path, adds list.
E, invalid catalogue:
Write-in failure, then the path can not be read and write, and be considered as idle task, abandon path.
Keyword described in step F includes storage, secure, asec, firmware, shell or obb.
For the numerous different vendors in market, the mobile phone of different brands, the Android system after modification can not be obtained successfully Take effective external memory card path, the present invention makes corresponding method for all types of cell phone system of in the market and goes the acquisition to have The outer handset storage card path of effect, be is exactly to preserve any Android mobile phone, can be taken readable or read-write External memory card path.
Obtain the advantage in outer handset storage card path have it is following some:
(1)If the authority that mobile phone storage does not obtain keeper can not be written and read to it.
(2)Application data be stored in it is built-in store to be cleaned out by internal memory cleaning tool cause loss of data.
(3)When application data has mobile phone storage, when application unloading, the data of application remove whole doors, only.
(4)Be there is into external memory card in number, could installed again when applying, reuse the legacy data of application.
The know-why of the present invention is described above in association with specific embodiment.These descriptions are intended merely to explain the present invention's Principle, and limiting the scope of the invention can not be construed in any way.Based on explanation herein, the technology of this area Personnel, which would not require any inventive effort, can associate other embodiments of the present invention, and these modes are fallen within Within protection scope of the present invention.

Claims (2)

1. a kind of method for ensureing to obtain various Android mobile phone external memory card paths, it is characterised in that:Comprise the following steps:
Step one:The step of obtaining SD card path list
A, higher than 4.3 system acquisition approachs:
If Android system is higher than 4.3, the SDK carried by Android system obtains external memory card path;
B, default method acquisition approach:
For various Android mobile phones, general external memory card path is obtained by the mobile phone A PI default methods provided;
C, reading CONFIG.SYS acquisition approach:
Cell phone system profile information is obtained, external memory card path is obtained;
D, acquisition system file are abnormal:
Implement after above-mentioned steps A, B and C, path acquisition is unsuccessful, is judged as exception occur, abnormal then execution E and F occur, it is no Then perform G;
E, the path Map for obtaining system:
Cell phone system configuration file is obtained, key-value pair is obtained, the value according to each keyword obtains the path of system;
F, according to file obtain specified path:
According to the SD card path of common external memory card route matching current system;
Individual handset specific aim sets particular path:
The mode specified one by one is taken to obtain SD card road for individual handset;
G, list are less than 2:
The list in the possible SD card path of generation, only provides 2 available SD card paths in list;
H, return list:
When getting available SD card list, return to user and use;
Step 2:The step of verifying SD card path list
A, obtain SD card path:
The SD card path list obtained using in step one writes the specific file for difference as checking target to SD card path; Step A-each the steps of F are received must just write this file behind path, this file is used as a unique mark;
B, check specific file:
Check SD card path whether a containing step write-in specific file, illustrate that the path is present in list containing the specific file In;
C, to obtained catalogue write specific file:
Do not contain specific file, then write specific file to the catalogue;
D, active path, add list:
Write successfully, then path is read-write path, as active path, adds list;
E, invalid catalogue:
Write-in failure, then the path can not be read and write, and be considered as idle task, abandon path.
2. a kind of method for ensureing to obtain various Android mobile phone external memory card paths according to claim 1, its feature It is:Keyword described in step F includes storage, secure, asec, firmware, shell or obb.
CN201710158545.9A 2017-03-17 2017-03-17 A kind of method for ensureing to obtain various Android mobile phone external memory card paths Pending CN106959824A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710158545.9A CN106959824A (en) 2017-03-17 2017-03-17 A kind of method for ensureing to obtain various Android mobile phone external memory card paths

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710158545.9A CN106959824A (en) 2017-03-17 2017-03-17 A kind of method for ensureing to obtain various Android mobile phone external memory card paths

Publications (1)

Publication Number Publication Date
CN106959824A true CN106959824A (en) 2017-07-18

Family

ID=59470942

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710158545.9A Pending CN106959824A (en) 2017-03-17 2017-03-17 A kind of method for ensureing to obtain various Android mobile phone external memory card paths

Country Status (1)

Country Link
CN (1) CN106959824A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902488A (en) * 2012-08-06 2013-01-30 广东欧珀移动通信有限公司 Memory card of handheld equipment and dynamic mounting method of memory card
CN103699418A (en) * 2013-12-27 2014-04-02 飞天诚信科技股份有限公司 Method and device of retrieving external SD cards

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902488A (en) * 2012-08-06 2013-01-30 广东欧珀移动通信有限公司 Memory card of handheld equipment and dynamic mounting method of memory card
CN103699418A (en) * 2013-12-27 2014-04-02 飞天诚信科技股份有限公司 Method and device of retrieving external SD cards
US20160342331A1 (en) * 2013-12-27 2016-11-24 Feitian Technologies Co., Ltd. Method and device for indexing external sd card

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
CSDN博客: "Android获取内置外置SD卡路径以及读写测试", 《CSDN博客》 *
XQ1990111: "android开发想得到sd卡路径?", 《百度知道》 *
刷了牙就睡FDD: "Android 内部存储(外置SD卡)和扩展存储卡(TF卡)路径的获取 - CSDN博客", 《微软BING》 *
热木星: "Anroid获取内置外置SD卡路径以及读写测试-CSDN博客", 《微软BING》 *
爱程序网: "Android内部存储(外置SD卡)和扩展存储卡(TF卡)路径的获取", 《爱程序网》 *

Similar Documents

Publication Publication Date Title
US9104329B2 (en) Mount-time reconciliation of data availability
US9710256B2 (en) Software upgrade method and system for mobile terminal
CN101369246B (en) System and method for using a memory mapping function to map memory defects
CN102707963B (en) Device flags
US8266391B2 (en) Method for writing data of an atomic transaction to a memory device
TWI423026B (en) Data writing method, memory controller and memory storage apparatus
US8122181B2 (en) Systems and methods for enhancing a data store for handling semantic information
TWI459202B (en) Data processing method, memory controller and memory storage device
CN103777971A (en) Electronic device, method for updating firmware, and recording medium capable of being read by computer
US20110093675A1 (en) Method for protecting redundant data
US20120221609A1 (en) Data Storage System and Method
CN102609275A (en) BIOS updating system and method thereof
CN102667720A (en) Consistency without ordering dependency
CN102279757B (en) The method and device that a kind of system program starts
CN106126277A (en) Multi-microprocessor and the upgrade method of external memory system
CN103455750B (en) The high peace verification method of a kind of embedded device and device
CN105653539A (en) Index distributed storage implement method and device
CN102567081B (en) Based on overall method to set up and the system of multi-process
CN106557572A (en) A kind of extracting method and system of Android application program file
US9535796B2 (en) Method, apparatus and computer for data operation
CN106959824A (en) A kind of method for ensureing to obtain various Android mobile phone external memory card paths
CN110704686A (en) Quality detection method and device for semi-structured data, storage medium and equipment
CN101299190B (en) Software upgrading method, system and built-in equipment of read-only file system
CN102073541A (en) Data access method and mobile terminal
US20140108711A1 (en) Portable secure device providing storage service

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170718

RJ01 Rejection of invention patent application after publication