CN112948021B - Android mobile terminal development method for configuratively accessing SDK of the same type - Google Patents

Android mobile terminal development method for configuratively accessing SDK of the same type Download PDF

Info

Publication number
CN112948021B
CN112948021B CN202110294953.3A CN202110294953A CN112948021B CN 112948021 B CN112948021 B CN 112948021B CN 202110294953 A CN202110294953 A CN 202110294953A CN 112948021 B CN112948021 B CN 112948021B
Authority
CN
China
Prior art keywords
sdk
target
mobile terminal
same type
sdks
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.)
Active
Application number
CN202110294953.3A
Other languages
Chinese (zh)
Other versions
CN112948021A (en
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.)
Guangzhou Grandhall Information Technology Co ltd
Original Assignee
Guangzhou Grandhall Information Technology Co 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 Guangzhou Grandhall Information Technology Co ltd filed Critical Guangzhou Grandhall Information Technology Co ltd
Priority to CN202110294953.3A priority Critical patent/CN112948021B/en
Publication of CN112948021A publication Critical patent/CN112948021A/en
Application granted granted Critical
Publication of CN112948021B publication Critical patent/CN112948021B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation 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)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (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 frames in 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, a mode of configuratively accessing the same type of SDK is adopted, and service replacement can be realized 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

Android mobile terminal development method for configuratively accessing SDK of the same type
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: basic 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:
s1, selecting two or more third-party SDKs for realizing the function as target SDKs according to the function required to be realized by the third-party SDKs, and acquiring related resources of the target SDKs;
s2, designing a set of framework in the basic warehouse, abstracting basic capability, opening an abstract interface accessed by the third-party SDK, assembling the abstract interface into a service for calling through an interface manager, and storing related resources of each target SDK into the basic warehouse;
s3, setting a target SDK as a default SDK in a script configuration mode, and setting a directory where related resources of the target SDK are located;
step S4, the service module quotes the basic warehouse service and detects whether there is an SDK configuration command, if there is an SDK configuration command, step S5 is executed; otherwise, executing step S6;
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 S6, calling related resources of the default SDK as resources of the required functions to be packaged, 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 established in the base warehouse, and then directories of each target SDK are respectively established under the independent directory for storing the relevant resources.
Has the beneficial effects 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 a better understanding of the objects, aspects and advantages of the present 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 the underlying 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:
s1, selecting two or more third-party SDKs for realizing the function as target SDKs according to the function required to be realized by the third-party SDKs, and acquiring related resources of the target SDKs; relevant resources of the SDK include logic code, manifest files, and resource files. The following description will be given by taking an example of a function of requiring a third-party SDK to implement message pushing in a Java environment, where two third-party SDKs capable of implementing a message pushing function, namely SDK1 and SDK2, are selected as target SDKs, and certainly, more third-party SDKs having a message pushing function may also be selected as target SDKs. In this embodiment, SDK1 is "carrier pigeon push", and SDK2 is "member push".
Step S2, designing a set of framework in a basic warehouse aiming at SDK1 (namely 'homing pigeon push') and SDK2 (namely 'member push') which need to be accessed, abstracting basic capability needed by the SDK1 and the SDK2 as shown in figure 2, opening an abstract interface accessed by the SDK of a third party, and assembling into service for calling through an 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., "SDK1" 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:
Figure BDA0002983980360000041
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 designated resources accurately during project construction and eliminate introduction of other unrelated services. Assume that "carrier pigeon push" (i.e., SDK 1) is set to the default SDK; the following code is written in the build.gradle configuration file under the warehouse component directory:
Figure BDA0002983980360000042
Figure BDA0002983980360000051
step S4, the service module quotes the basic warehouse service and detects whether there is an SDK configuration command, if there is an SDK configuration command, step S5 is executed; otherwise, executing step S6;
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 S6, calling related resources of the default SDK as resources of the required functions to be packaged, 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, "pigeon push") is called as a resource of the message push function to package.
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" (namely, SDK 2) needs to be switched as an access SDK, the following codes are added to the build script file build under the project root directory:
ext{
SDK _ TYPE = 'SDK2'// optional configuration, and selection is performed according to project requirements
}
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., "member push") is called to be packaged as the resource of the message push function, and the resource of the "pigeon push" is not packaged.
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. The method and the device can realize rapid scheme replacement for some functions with alternative schemes, do not bring redundant service import, and can avoid the situation that the scheme switching causes coexistence of multiple SDKs of the same type, thereby causing the size of the installation package to be increased.
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 (4)

1. A method for developing an android mobile terminal for configuratively accessing the SDK of the same type is characterized by comprising the following steps:
s1, selecting two or more third-party SDKs for realizing the function as target SDKs according to the function required to be realized by the third-party SDKs, and acquiring related resources of the target SDKs;
s2, designing a set of framework in the basic warehouse, abstracting basic capability, opening an abstract interface accessed by the third-party SDK, assembling the abstract interface into a service for calling through an interface manager, and storing related resources of each target SDK into the basic warehouse; when storing the related resources of each target SDK, establishing an independent directory in a basic warehouse, and then respectively establishing the directory of each target SDK under the independent directory for storing the related resources;
s3, setting a target SDK as a default SDK in a script configuration mode, and setting a directory where related resources of the target SDK are located;
s4, the service module quotes the basic warehouse service and detects whether an SDK configuration command exists, and if the SDK configuration command exists, the step S5 is executed; otherwise, executing step S6;
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 S6, calling related resources of the default SDK as resources of the required functions to be packaged, 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 method for developing the android mobile terminal configured to access the same type of SDK as claimed in claim 1, wherein the relevant resources of the SDK include logic codes, manifest files, and resource files.
4. The method for developing the android mobile terminal configured to access the same type of SDK as claimed in claim 1, wherein in the step S1, the abstract interface is an API interface, and the interface manager is a unified API for external services.
CN202110294953.3A 2021-03-19 2021-03-19 Android mobile terminal development method for configuratively accessing SDK of the same type Active CN112948021B (en)

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 CN112948021A (en) 2021-06-11
CN112948021B true 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 (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068818A (en) * 2015-08-26 2015-11-18 网易(杭州)网络有限公司 Channel package generation method and apparatus and channel package batch generation method and system
CN111443939A (en) * 2020-04-16 2020-07-24 视若飞信息科技(上海)有限公司 Configuration method and device of software development kit and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8832650B2 (en) * 2007-09-26 2014-09-09 Ncr Corporation Automated code generation for an automated teller machine
EP3138056A1 (en) * 2014-04-30 2017-03-08 Twitter, Inc. Software development kit platform
US10585727B1 (en) * 2015-06-08 2020-03-10 Google Llc API manager
CN108829405B (en) * 2018-06-04 2021-12-21 网易(杭州)网络有限公司 Channel package generation method and device, storage medium and 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

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068818A (en) * 2015-08-26 2015-11-18 网易(杭州)网络有限公司 Channel package generation method and apparatus and channel package batch generation method and system
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
CN112948021A (en) 2021-06-11

Similar Documents

Publication Publication Date Title
US7752616B2 (en) Update system capable of updating software
US6567075B1 (en) Feature access control in a display-based terminal environment
CN102054173B (en) Smart card and method for integrating multiple telecom applications on same
US5991541A (en) Dynamically modifiable call processing methods and apparatus
CN104750528A (en) Management method and device for components in Android program
CN111797173B (en) Alliance chain sharing system, method and device, electronic equipment and storage medium
US11956114B2 (en) Device management method, apparatus, and system, device, and storage medium
CN105426244A (en) Application process management method and application process management device
CN108089873A (en) A kind of method and terminal of application component immediate updating
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
CN112363728B (en) Cross-platform compiling method and system supporting continuous integrated construction
CN111124618B (en) Resource deployment method, device, storage medium and equipment
CN116233217B (en) Page jump method and device based on route, electronic equipment and storage medium
CN100568178C (en) A kind of control adding method
CN109976820B (en) Application program running method and application program framework
US6330319B1 (en) System and method for adding services to computer telephone systems
CN111857941B (en) Security policy management method and device
US20030046443A1 (en) Updating mobile agents
CN104053135A (en) Method and device for realizing unstructured supplementary service data
CN114416219B (en) System function calling method, device, electronic equipment and readable medium
CN113626105B (en) SDK system of mobile terminal mixed mode and mobile device

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