CN112948021A - Android mobile terminal development method for configurated access to SDKs of the same type - Google Patents
Android mobile terminal development method for configurated access to SDKs of the same type Download PDFInfo
- Publication number
- CN112948021A CN112948021A CN202110294953.3A CN202110294953A CN112948021A CN 112948021 A CN112948021 A CN 112948021A CN 202110294953 A CN202110294953 A CN 202110294953A CN 112948021 A CN112948021 A CN 112948021A
- Authority
- CN
- China
- Prior art keywords
- sdk
- same type
- sdks
- resources
- target
- 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
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/34—Graphical or visual programming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Telephone Function (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention relates to an android mobile terminal development method for configurating access to SDKs of the same type, which comprises the following steps: selecting a third-party SDK as a target SDK according to the required function; designing a set of framework on a basic warehouse, abstracting basic capability and opening an abstract interface; setting a target SDK as a default SDK; when the SDK configuration command exists, the service module calls the related resource which is appointed by the SDK configuration command and is accessed into the SDK as the resource with the required function to be packaged; otherwise, the service module calls the relevant resources of the default SDK as the resources of the required functions to package. In the invention, the service replacement can be realized by adopting a mode of configurating and accessing the SDK of the same type through minor configuration change; in addition, only one third-party SDK resource is packaged during packaging of the basic warehouse, and the situation that the size of the installation package is increased due to coexistence of multiple SDKs of the same type can be avoided.
Description
Technical Field
The invention belongs to the technical field of android mobile terminal development, and relates to an android mobile terminal development method for configuratively accessing SDKs of the same type.
Background
At present, modular development in the industry has become mainstream, and project architecture is mainly divided into two layers: base warehouse + business module. The capabilities provided by the third-party SDK, such as message pushing, data reporting, etc., are often used in service development, and these capabilities can be deposited as part of the base repository for multiplexing of multiple items. The third-party SDK has instability and uncontrollable property (such as change of charge of a service provider, termination of an item, unavailability of a service overseas, etc.), and other technologies need to be introduced when the currently used technical solution does not meet the requirements.
There are two current approaches to dealing with such problems:
1. deleting the original SDK service and accessing a new SDK service;
2. two SDK service schemes coexist, and the service to be used is controlled through a code;
scheme 1 is simple and direct, but can cause great change of the base warehouse, and influence is caused on other projects which reuse the base warehouse. While scheme 2 may lead to redundant SDK service introduction items, introduce greater instability, and may lead to increased installation package volume.
Disclosure of Invention
In view of the above, the present invention is to provide an android mobile terminal development method for configuring and accessing SDKs of the same type, which can efficiently switch third-party SDKs without introducing redundant services.
In order to achieve the purpose, the invention provides the following technical scheme:
an android mobile terminal development method for configuratively accessing SDKs of the same type comprises the following steps:
step S1, according to the function that needs to be realized by the third-party SDK, selecting two or more third-party SDKs realizing the function as the target SDK, and obtaining the related resource of the target SDK;
step S2, designing a set of frame in the basic warehouse, abstracting the basic capability, opening the abstract interface accessed by the third-party SDK, assembling the abstract interface into a service for calling through an interface manager, and storing the relevant resources of each target SDK into the basic warehouse;
step S3, setting a target SDK as a default SDK and setting a directory of related resources of the target SDK in a script configuration mode;
step S4, the service module quotes the basic warehouse service and detects whether there is SDK configuration command, if there is SDK configuration command, then step S5 is executed; otherwise, go to step S6;
step S5, calling related resources which are specified by the SDK configuration command and accessed into the SDK as resources with required functions to be packaged, and generating an android mobile terminal installation package;
and step S6, calling related resources of the default SDK as resources with the required functions to package, and generating an android mobile terminal installation package.
Further, when the target SDK accessed by the basic service needs to be changed, a configuration command is added into the construction script file under the project root directory, and another target SDK is appointed to be used as the access SDK.
Further, the relevant resources of the SDK include logic code, manifest files, and resource files.
Further, in the step S1, the abstract interface is an API interface, and the interface manager is a unified API for external services.
Further, in step S1, when storing the relevant resources of each target SDK, an independent directory is first created in the base warehouse, and then a directory of each target SDK is created under the independent directory for storing the relevant resources.
Has the advantages that: in the invention, a mode of configuratively accessing the SDKs of the same type is adopted, the needed third-party SDK can be quickly switched by only adding one configuration command, the basic warehouse does not need to be greatly changed, the service replacement can be realized by minor configuration change, and an efficient configurated access solution of the SDKs of the same type is provided. In addition, only one resource of the third-party SDK is packaged when the base warehouse is packaged, so that the method is suitable for the situation that the base warehouse is precipitated and a plurality of projects can be reused, and is a general industrial solution. By using the method and the system, some functions with alternative schemes can realize rapid scheme replacement, redundant service import is avoided, and the situation that multiple SDKs of the same type coexist due to scheme switching, so that the size of the installation package is increased, can be avoided.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objectives and other advantages of the invention may be realized and attained by the means of the instrumentalities and combinations particularly pointed out hereinafter.
Drawings
For the purposes of promoting a better understanding of the objects, aspects and advantages of the invention, reference will now be made to the following detailed description taken in conjunction with the accompanying drawings in which:
FIG. 1 is a flowchart of an embodiment of the method for developing android mobiles configured for accessing SDKs of the same type according to the present invention;
fig. 2 is a block diagram of an abstract interface that abstracts basic capabilities and opens third party SDK access.
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention in a schematic way, and the features in the following embodiments and examples may be combined with each other without conflict.
Wherein the showings are for the purpose of illustrating the invention only and not for the purpose of limiting the same, and in which there is shown by way of illustration only and not in the drawings in which there is no intention to limit the invention thereto; to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product; it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The same or similar reference numerals in the drawings of the embodiments of the present invention correspond to the same or similar components; in the description of the present invention, it should be understood that if there is an orientation or positional relationship indicated by terms such as "upper", "lower", "left", "right", "front", "rear", etc., based on the orientation or positional relationship shown in the drawings, it is only for convenience of description and simplification of description, but it is not an indication or suggestion that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes, and are not to be construed as limiting the present invention, and the specific meaning of the terms may be understood by those skilled in the art according to specific situations.
As shown in fig. 1, a preferred embodiment of the method for developing an android mobile terminal configured to access an SDK of the same type according to the present invention includes the following steps:
step S1, according to the function that needs to be realized by the third-party SDK, selecting two or more third-party SDKs realizing the function as the target SDK, and obtaining the related resource of the target SDK; relevant resources of the SDK include logic code, manifest files, and resource files. Taking the function of realizing message pushing by a third-party SDK in a Java environment as an example, two third-party SDKs capable of realizing the message pushing function, namely SDK1 and SDK2, are selected as target SDKs, and certainly, more third-party SDKs with the message pushing function may also be selected as target SDKs. In this embodiment, SDK1 is "homing pigeon push" and SDK2 is "member push".
Step S2, designing a set of framework in the base warehouse for SDK1 (i.e., "homing pigeon push") and SDK2 (i.e., "member push") that need to be accessed, as shown in fig. 2, abstracting the base capabilities needed by SDK1 and SDK2, opening the abstract interface that third party SDKs access, and assembling into a service for calling through the interface manager; the abstract interface is preferably an API interface, and the interface manager is a unified API for external services.
Storing the related resources of each target SDK to a basic warehouse; preferably, an independent directory "SDK" is first established in the base warehouse, and then directories (i.e., "SDK 1" and "SDK 2") of each target SDK are respectively established under the independent directories, and are respectively used for storing relevant resources of "carrier pigeon push" and "member push". The directory structure is as follows:
step S3, setting a target SDK as a default SDK in a gradle script configuration mode; and setting a directory where related resources of the target SDK are located so as to lead in the specified resources accurately during project construction and eliminate the introduction of other unrelated services. Assume that "carrier pigeon push" (i.e., SDK1) is set to the default SDK; the following code is written in the build.
Step S4, the service module quotes the basic warehouse service and detects whether there is SDK configuration command, if there is SDK configuration command, then step S5 is executed; otherwise, go to step S6;
step S5, calling related resources which are specified by the SDK configuration command and accessed into the SDK as resources with required functions to be packaged, and generating an android mobile terminal installation package;
and step S6, calling related resources of the default SDK as resources with the required functions to package, and generating an android mobile terminal installation package.
In this embodiment, since the configuration command is not set, when an android mobile terminal installation package is generated, a relevant resource of the SDK1 (that is, "homing pigeon push") is called as a resource of the message push function to be packaged.
When a target SDK accessed by the basic service needs to be changed, the basic warehouse does not need to be changed greatly, only a configuration command needs to be added in a build script file build. Assuming that "member push" (i.e., SDK2) needs to be switched as an access SDK, the following code is added to the build script file build.gradle under the project root directory:
ext{
SDK _ TYPE ═ SDK2'// optional configuration, selected according to project needs
}
At this time, when step S4 is executed, since the SDK configuration command is detected, step S5 is executed, and when the android mobile terminal installation package is generated, the relevant resource that is specified by the configuration command and is accessed to the SDK2 (i.e., "alliance push") is called to pack the resource of the message push function, and the resource of the "pigeon push" is not packed.
It can be seen that in the embodiment, a manner of configuratively accessing SDKs of the same type is adopted, a third-party SDK can be quickly switched to by adding only one configuration command, a base warehouse does not need to be greatly changed, service replacement can be realized through a small configuration change, and an efficient solution for configuratively accessing SDKs of the same type is provided. In addition, only one resource of the third-party SDK is packaged when the base warehouse is packaged, so that the method is suitable for the situation that the base warehouse is precipitated and a plurality of projects can be reused, and is a general industrial solution. By using the method and the system, some functions with alternative schemes can realize rapid scheme replacement, redundant service import is avoided, and the situation that multiple SDKs of the same type coexist due to scheme switching, so that the size of the installation package is increased, can be avoided.
Finally, the above embodiments are only intended to illustrate the technical solutions of the present invention and not to limit the present invention, and although the present invention has been described in detail with reference to the preferred embodiments, it will be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions, and all of them should be covered by the claims of the present invention.
Claims (5)
1. An android mobile terminal development method for configuratively accessing SDKs of the same type is characterized by comprising the following steps:
step S1, according to the function that needs to be realized by the third-party SDK, selecting two or more third-party SDKs realizing the function as the target SDK, and obtaining the related resource of the target SDK;
step S2, designing a set of frame in the basic warehouse, abstracting the basic capability, opening the abstract interface accessed by the third-party SDK, assembling the abstract interface into a service for calling through an interface manager, and storing the relevant resources of each target SDK into the basic warehouse;
step S3, setting a target SDK as a default SDK and setting a directory of related resources of the target SDK in a script configuration mode;
step S4, the service module quotes the basic warehouse service and detects whether there is SDK configuration command, if there is SDK configuration command, then step S5 is executed; otherwise, go to step S6;
step S5, calling related resources which are specified by the SDK configuration command and accessed into the SDK as resources with required functions to be packaged, and generating an android mobile terminal installation package;
and step S6, calling related resources of the default SDK as resources with the required functions to package, and generating an android mobile terminal installation package.
2. The android mobile terminal development method for configuring access to the SDKs of the same type as in claim 1, wherein when a target SDK for basic service access needs to be changed, a configuration command is added to a build script file under a project root directory, and another target SDK is designated as an access SDK.
3. The android mobile-side development method for configuring access to the same type of SDK as in claim 1, wherein the relevant resources of the SDK include logic codes, manifest files, and resource files.
4. The method for developing android mobile terminals configured to access the same type of SDK as in claim 1, wherein in step S1, the abstract interface is an API interface, and the interface manager is a unified API for external services.
5. The method for developing android mobiles configured to access SDKs of the same type as in claim 1, wherein in step S1, when storing relevant resources of each target SDK, an independent directory is first established in a base warehouse, and then directories of each target SDK are respectively established under the independent directory for storing the relevant resources.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110294953.3A CN112948021B (en) | 2021-03-19 | 2021-03-19 | Android mobile terminal development method for configuratively accessing SDK of the same type |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110294953.3A CN112948021B (en) | 2021-03-19 | 2021-03-19 | Android mobile terminal development method for configuratively accessing SDK of the same type |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112948021A true CN112948021A (en) | 2021-06-11 |
CN112948021B CN112948021B (en) | 2022-10-04 |
Family
ID=76226631
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110294953.3A Active CN112948021B (en) | 2021-03-19 | 2021-03-19 | Android mobile terminal development method for configuratively accessing SDK of the same type |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112948021B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090083700A1 (en) * | 2007-09-26 | 2009-03-26 | Ncr Corporation | Automated code generation for an automated teller machine |
WO2015168251A1 (en) * | 2014-04-30 | 2015-11-05 | Twitter, Inc. | Software development kit platform |
CN105068818A (en) * | 2015-08-26 | 2015-11-18 | 网易(杭州)网络有限公司 | Channel package generation method and apparatus and channel package batch generation method and system |
CN108829405A (en) * | 2018-06-04 | 2018-11-16 | 网易(杭州)网络有限公司 | The generation method and device of channel packet, storage medium, electronic device |
US10585727B1 (en) * | 2015-06-08 | 2020-03-10 | Google Llc | API manager |
CN111427580A (en) * | 2020-03-24 | 2020-07-17 | Oppo广东移动通信有限公司 | Software development kit access method and device and storage medium |
CN111443939A (en) * | 2020-04-16 | 2020-07-24 | 视若飞信息科技(上海)有限公司 | Configuration method and device of software development kit and storage medium |
CN111443918A (en) * | 2018-12-29 | 2020-07-24 | 北京奇虎科技有限公司 | Channel access method and device for business object installation package |
-
2021
- 2021-03-19 CN CN202110294953.3A patent/CN112948021B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090083700A1 (en) * | 2007-09-26 | 2009-03-26 | Ncr Corporation | Automated code generation for an automated teller machine |
WO2015168251A1 (en) * | 2014-04-30 | 2015-11-05 | Twitter, Inc. | Software development kit platform |
US10585727B1 (en) * | 2015-06-08 | 2020-03-10 | Google Llc | API manager |
CN105068818A (en) * | 2015-08-26 | 2015-11-18 | 网易(杭州)网络有限公司 | Channel package generation method and apparatus and channel package batch generation method and system |
CN108829405A (en) * | 2018-06-04 | 2018-11-16 | 网易(杭州)网络有限公司 | The generation method and device of channel packet, storage medium, electronic device |
CN111443918A (en) * | 2018-12-29 | 2020-07-24 | 北京奇虎科技有限公司 | Channel access method and device for business object installation package |
CN111427580A (en) * | 2020-03-24 | 2020-07-17 | Oppo广东移动通信有限公司 | Software development kit access method and device and storage medium |
CN111443939A (en) * | 2020-04-16 | 2020-07-24 | 视若飞信息科技(上海)有限公司 | Configuration method and device of software development kit and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112948021B (en) | 2022-10-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9420399B2 (en) | Generic mobile devices customization framework | |
US7752616B2 (en) | Update system capable of updating software | |
US7542758B2 (en) | Field downloading of wireless device software | |
US9612816B2 (en) | Method for operating software defined radio application | |
CN102054173B (en) | Smart card and method for integrating multiple telecom applications on same | |
CN104750528A (en) | Management method and device for components in Android program | |
US5991541A (en) | Dynamically modifiable call processing methods and apparatus | |
US11956114B2 (en) | Device management method, apparatus, and system, device, and storage medium | |
CN108089873A (en) | A kind of method and terminal of application component immediate updating | |
CN112363728B (en) | Cross-platform compiling method and system supporting continuous integrated construction | |
CN108845800B (en) | Method, device, equipment and storage medium for realizing component extension function | |
CN114756374A (en) | Method, device, equipment and medium for scheduling heterogeneous CPU | |
CN101339508B (en) | Java2 miniature edition application operation method and device | |
CN116107590A (en) | Implementation method and system for compatible micro-service and monomer architecture in software product development and deployment | |
CN112948021B (en) | Android mobile terminal development method for configuratively accessing SDK of the same type | |
US11259160B1 (en) | Provisioning a voicemail platform | |
CN100568178C (en) | A kind of control adding method | |
CN109976820B (en) | Application program running method and application program framework | |
CN102684913B (en) | Method for processing business and relevant apparatus and related system | |
CN117354358A (en) | SMF network element selection method and device, electronic equipment and storage medium | |
CN111367577A (en) | Method, device and terminal for loading plug-in of application | |
US6330319B1 (en) | System and method for adding services to computer telephone systems | |
CN110399161A (en) | A kind of generation method of mapping relations, call method and device | |
CN114416219B (en) | System function calling method, device, electronic equipment and readable medium | |
CN104053135A (en) | Method and device for realizing unstructured supplementary service data |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |