CN107092501A - The implementation method and device of advertisement general-purpose interface in a kind of android system - Google Patents

The implementation method and device of advertisement general-purpose interface in a kind of android system Download PDF

Info

Publication number
CN107092501A
CN107092501A CN201710165497.6A CN201710165497A CN107092501A CN 107092501 A CN107092501 A CN 107092501A CN 201710165497 A CN201710165497 A CN 201710165497A CN 107092501 A CN107092501 A CN 107092501A
Authority
CN
China
Prior art keywords
advertisement
general
loading
purpose interface
function
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
Application number
CN201710165497.6A
Other languages
Chinese (zh)
Other versions
CN107092501B (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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710165497.6A priority Critical patent/CN107092501B/en
Publication of CN107092501A publication Critical patent/CN107092501A/en
Application granted granted Critical
Publication of CN107092501B publication Critical patent/CN107092501B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0241Advertisements
    • G06Q30/0277Online advertisement

Abstract

The invention discloses a kind of implementation method of advertisement general-purpose interface in android system and device, it is related to the interface exploitation technical field of android system.This method includes:Advertisement loading readjustment general-purpose interface is first created, and sets it to realize that function is:Complete the readjustment of advertisement loading result;Create again it is abstract enumerate class general-purpose interface, and set it to realize that function is:Create the advertisement loader of advertising platform itself and load the advertisement of correspondence advertising platform;The general loader of advertisement is finally created, and sets it to realize that function is:Create the corresponding abstract example for enumerating class general-purpose interface, and the abstract advertisement loading realized function, complete the advertising platform for enumerating class general-purpose interface by calling the example to be inherited.The invention enables the advertisement loading problem that developer can simply handle different advertising platforms, not only size of code is few, development efficiency is high, and the maintainability of Android applications is strong.

Description

The implementation method and device of advertisement general-purpose interface in a kind of android system
Technical field
It is specifically wide in a kind of android system the present invention relates to the interface exploitation technical field of android system Accuse the implementation method and device of general-purpose interface.
Background technology
At present, during the use that Android is applied, application is strengthened using more or less may require that addition advertisement Income.But, in the market advertising platform is numerous, Android apply in order to the filling rate of advertisement may add simultaneously it is many Individual advertising platform, and the SDK (Software Development Kit, SDK) of each advertising platform realization But there is larger difference.In general, developer needs to go to realize corresponding a set of logic for each advertising platform Code, and if necessary to replace Current ad platform also need to rewrite advertisement load logic, size of code is larger, development efficiency compared with It is low.Moreover, with the increase of advertising business, logic interfacing becomes increasingly complex, the maintainability that this causes Android to apply is more next It is poorer.
Therefore, the general scheme of an ad interface how is realized in android system, be those skilled in the art urgently To be solved the problem of.
The content of the invention
The invention aims to overcome the shortcomings of that above-mentioned background technology is logical there is provided advertisement in a kind of android system With the implementation method and device of interface so that developer can simply handle the advertisement loading problem of different advertising platforms, no But size of code is few, development efficiency is high, and the maintainability of Android applications is strong.
To achieve the above objectives, the present invention is adopted the technical scheme that:There is provided in a kind of android system that advertisement is general to be connect The implementation method of mouth, the implementation method comprises the following steps:S1, establishment advertisement loading readjustment general-purpose interface, and set it to realize Function is:Complete the readjustment of advertisement loading result;S2, create it is abstract enumerate class general-purpose interface, and set it to realize that function is:Wound Build the advertisement loader of advertising platform itself;By calling the advertisement load logic of advertising platform itself to load correspondence advertising platform Advertisement, and realize the readjustment of advertisement loading result by calling advertisement loading readjustment general-purpose interface in loading procedure; S3, the establishment general loader of advertisement, and set it to realize that function is:According to the information of the advertising platform loaded the need for incoming ginseng Number, creates the corresponding abstract example for enumerating class general-purpose interface;Then led to by the abstract class of enumerating for calling the example to be inherited Function is realized with interface, the advertisement loading of the advertising platform is completed.
On the basis of above-mentioned technical proposal, step S1 specifically includes following operation:S101, one advertisement of definition are loaded back into Adjust general-purpose interface;S102, two call back functions of establishment in the advertisement loading readjustment general-purpose interface of definition:Load and successfully adjust back letter Number and loading failure call back function;S103, realize that function is configured to load successful call back function, make it be used to complete wide Accuse the successful result readjustment of loading;Function, which is configured, to be realized to loading failure call back function, makes it be used to completing advertisement adding Carry the result readjustment of failure.
On the basis of above-mentioned technical proposal, step S2 specifically includes following operation:S201, define one and abstract enumerate class General-purpose interface;S202, in abstract enumerate of definition two abstract method functions are created in class general-purpose interface:Advertisement loader is created Function and advertisement loading function;S203, function is created to advertisement loader realize that function is configured, make it be used to create wide Accuse the advertisement loader of platform itself;Function, which is configured, to be realized to advertisement loading function, it is used for by calling advertisement The advertisement of the advertisement load logic loading correspondence advertising platform of platform itself, and by calling advertisement loading readjustment in loading procedure General-purpose interface, realizes the readjustment of advertisement loading result.
On the basis of above-mentioned technical proposal, step S3 specifically includes following operation:S301, define an advertisement it is general plus Carry device;S302, the incoming parameter for setting the general loader of advertisement, the incoming parameter include:Need the advertising platform of loading Information parameter and advertisement loading readjustment general-purpose interface parameter;S303, by the function setting of realizing of the general loader of advertisement it is:According to The information parameter of the advertising platform loaded the need for incoming, creates that corresponding abstract to enumerate class general using Java reflection technology The example of interface;Then function is created by the abstract advertisement loader for enumerating class general-purpose interface for calling the example to be inherited, Create the advertisement loader for the advertising platform for needing to load;Again abstract class general-purpose interface is enumerated by call that the example inherited Advertisement loading function, complete correspondence advertising platform advertisement loading and advertisement loading result readjustment.
On the basis of above-mentioned technical proposal, the information parameter of the advertising platform includes advertising platform type and advertisement position ID。
What the present invention also provided advertisement general-purpose interface in a kind of android system realizes device, and it is wide that this realizes that device includes Accuse loading readjustment general-purpose interface creation module, abstract enumerate class general-purpose interface creation module and the general loader of advertisement creates mould Block;
The advertisement loading readjustment general-purpose interface creation module is used for:Advertisement loading readjustment general-purpose interface is created, it is set Realize that function is:Complete the readjustment of advertisement loading result;And to it is abstract enumerate class general-purpose interface creation module and send enumerate class and connect Mouth creates signal;
The abstract class general-purpose interface creation module of enumerating is used for:Receive and enumerate after class interface establishment signal, create abstract Class general-purpose interface is enumerated, and sets it to realize that function is:Create the advertisement loader of advertising platform itself;By calling advertisement to put down The advertisement of the advertisement load logic loading correspondence advertising platform of platform itself, and by calling the advertisement to be loaded back into loading procedure General-purpose interface is adjusted, the readjustment of advertisement loading result is realized;General loader is sent to the general loader creation module of advertisement to create Signal;
The general loader creation module of advertisement is used for:Receive general loader to create after signal, create advertisement general Loader, and set it to realize that function is:According to the information parameter of the advertising platform loaded the need for incoming, corresponding takes out is created Example as enumerating class general-purpose interface;Then by call that the example inherited it is abstract enumerate class general-purpose interface realize work( Can, complete the advertisement loading of the advertising platform.
On the basis of above-mentioned technical proposal, the advertisement loading readjustment general-purpose interface creation module creates and sets advertisement Loading readjustment general-purpose interface idiographic flow be:Define an advertisement loading readjustment general-purpose interface;It is loaded back into the advertisement of definition Adjust and two call back functions are created in general-purpose interface:Load successfully call back function and loading failure call back function;Successfully returned to loading Letter of transfer number realizes that function is configured, and makes it be used to completing advertisement loading successful result readjustment;Letter is unsuccessfully adjusted back to loading Several realizes that function is configured, the result readjustment for making it be used to complete advertisement loading failure.
On the basis of above-mentioned technical proposal, the abstract class general-purpose interface creation module of enumerating creates and sets abstract piece Lift class general-purpose interface idiographic flow be:Definition one is abstract to enumerate class general-purpose interface;Abstract in definition enumerates that class is general to be connect Two abstract method functions are created in mouthful:Advertisement loader creates function and advertisement loading function;Letter is created to advertisement loader Several realizes that function is configured, the advertisement loader for making it be used to create advertising platform itself;To the reality of advertisement loading function Existing function is configured, and it is used for by calling the advertisement load logic of advertising platform itself to load the wide of correspondence advertising platform Accuse, and the readjustment of advertisement loading result is realized by calling advertisement loading readjustment general-purpose interface in loading procedure.
On the basis of above-mentioned technical proposal, the general loader creation module of advertisement creates and sets advertisement is general to add Carry device idiographic flow be:Define a general loader of advertisement;The incoming parameter of the general loader of advertisement is set, it is described incoming Parameter includes:Need the information parameter and advertisement loading readjustment general-purpose interface parameter of the advertising platform of loading;By advertisement it is general plus Carry device function setting of realizing be:According to the information parameter of the advertising platform loaded the need for incoming, Java reflection skill is utilized Art creates the corresponding abstract example for enumerating class general-purpose interface;Then by call that the example inherited abstract to enumerate class general The advertisement loader of interface creates function, creates the advertisement loader for the advertising platform for needing to load;Again by calling the example The abstract advertisement loading function for enumerating class general-purpose interface inherited, completes the advertisement loading and advertisement loading of correspondence advertising platform As a result readjustment.
On the basis of above-mentioned technical proposal, the information parameter of the advertising platform includes advertising platform type and advertisement position ID。
The beneficial effects of the present invention are:
(1) present invention enumerates technology by introducing the abstract of Java, creates and a kind of abstract enumerates class general-purpose interface, solution The interface of different advertising platforms, which is realized, to differ, ununified base class, also ununified to realize interface so be from face The problem of alignment is uniformly processed on to object thinking, has reached optimal autgmentability, the convenient system to different advertising platforms One processing.On this basis, invention further creates a general loader of unified advertisement, the general loader of the advertisement passes through Its implementation is called to the abstract instantiation for enumerating class general-purpose interface, so as to reach the advertisement loading mesh of different advertising platforms 's.
Compared with prior art, the advertisement loading that can simply handle different advertising platforms the invention enables developer is asked Topic, not only size of code is few, development efficiency is high, and code logic is clear, facilitates follow-up maintenance to update, less code completion More work, can reduce bug generations, and then cause the maintainable enhancing of Android applications.
(2) it is that the general loader of advertisement is set when the general loader of advertisement to establishment is configured in the present invention To create the corresponding abstract example for enumerating class general-purpose interface using Java reflection technology.Using Java reflection technology, It can avoid needing to change advertisement general loader generation repeatedly because directly realizing by Java branching logic sentence well The problem of code, the code degree of coupling is reduced, autgmentability is further increased.
(3) implementation method autgmentability of the invention is strong, can arbitrarily increase or delete advertising platform, need to only realize correspondence advertisement The increase or deletion of the enumeration object of platform;And the replacement of advertising platform is simple, when needing from an advertising platform When being switched to another advertising platform, it is only necessary to perform incoming Platform Type, simple operation.
Brief description of the drawings
Fig. 1 is the flow chart of the implementation method of advertisement general-purpose interface in android system in the embodiment of the present invention;
Fig. 2 is the structured flowchart for realizing device of advertisement general-purpose interface in android system in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawings and specific embodiment the present invention is described in further detail.
Shown in Figure 1, the embodiment of the present invention provides a kind of implementation method of advertisement general-purpose interface in android system, Comprise the following steps:
Step S1, one advertisement loading readjustment general-purpose interface of establishment, and the realization for adjusting back general-purpose interface is loaded to the advertisement Function is configured so that the advertisement loading readjustment general-purpose interface function of realizing be:Complete the readjustment of advertisement loading result.
Specifically, step S1 includes following operation:
Step S101, one advertisement loading readjustment general-purpose interface of definition, for example, can be named as NativeAdListener。
Step S102, two call back functions of establishment in the advertisement loading readjustment general-purpose interface of definition:Load and successfully adjust back Function and loading failure call back function, for example, onNativeAdLoaded, loading failure can be named as by loading successfully call back function Call back function can be named as onNativeAdFail.
Step S103, realize that function is configured to load successful call back function (such as onNativeAdLoaded), make It is used to complete the successful result readjustment of advertisement loading;Work(is realized to loading failure call back function (such as onNativeAdFail) It can be configured, the result readjustment for making it be used to complete advertisement loading failure.
Step S2, one the abstract of internal system of establishment enumerate class general-purpose interface, and the abstract class of enumerating is to all advertisements Platform it is abstract;To this it is abstract enumerate class general-purpose interface realize that function is configured so that this is abstract to enumerate class general-purpose interface Function of realizing be:The advertisement loader for creating advertising platform itself is (i.e. internal to be automatically forwarded to corresponding advertising platform SDK's Loader);By calling the advertisement load logic of advertising platform itself to load the advertisement of correspondence advertising platform, and in loading procedure By calling advertisement loading readjustment general-purpose interface, the readjustment of advertisement loading result is realized.
It is understood that deleted or modification advertising platform to increase, to reach optimal autgmentability, Here introduce the abstract of Java and enumerate technology.Differ because the interface of different advertising platforms is realized, their ununified base class, It is ununified realize interface and be uniformly processed so can not be alignd from object-oriented thinking yet, and enumerated by abstract Mode can solve this problem.
Based on above-mentioned principle design, step S2 specifically includes below scheme in the embodiment of the present invention:
Step S201, define one it is abstract enumerate class general-purpose interface, for example, can by it is abstract enumerate class general-purpose interface name For AdPlatform.
Step S202, in abstract enumerate of definition two abstract method functions are created in class general-purpose interface:Advertisement loader Function and advertisement loading function are created, for example, advertisement loader establishment function can be named as in practical operation CreateLoader, can be named as loadAd by advertisement loading function.
Step S203, function (such as createLoader) is created to advertisement loader realize that function is configured, make it Advertisement loader for creating advertising platform itself;Function, which is configured, to be realized to advertisement loading function (such as loadAd), It is set to be used for the advertisement by calling the advertisement load logic of advertising platform itself to load correspondence advertising platform, and in loading procedure By calling advertisement loading readjustment general-purpose interface, the readjustment of advertisement loading result is realized.If failing that is, advertisement is loaded, Advertisement loading function (such as loadAd) will call the loading of advertisement loading readjustment general-purpose interface (such as NativeAdListener) Failure call back function (such as onNativeAdFail) readjustment tells upper strata advertisement loading failure;If advertisement is loaded successfully, advertisement adds Carrying function (such as loadAd) will call the loading of advertisement loading readjustment general-purpose interface (such as NativeAdListener) successfully to return Letter of transfer number (such as onNativeAdLoaded) readjustment tells upper strata advertisement to load successfully.
Step S3:A general loader of advertisement is created, and function, which is configured, to be realized to the general loader of the advertisement, So that the function of realizing of the general loader of the advertisement is:According to the information parameter of the advertising platform loaded the need for incoming, create The corresponding abstract example for enumerating class general-purpose interface is (it is understood that the abstract example for enumerating class general-purpose interface created It is to inherit to have abstract to enumerate all of class general-purpose interface and realize function);Then by call that the example inherited abstract piece That lifts class general-purpose interface realizes function (or implementation method), to complete the advertisement loading of the advertising platform.
Although it is understood that the SDK of advertising platform all in android system realizes different, each side Legitimate name is different from, but it has a component for being similar to loader etc.It is convenient and this programme is for unified interface Developer can simply handle the advertisement loading problem of different advertising platforms, create the general loading of a unified advertisement Device, the general loader of the advertisement to the abstract instantiation for enumerating class general-purpose interface by calling its implementation, so as to realize The real ad loader of advertising platform itself is created, i.e., the internal advertisement loading for being automatically forwarded to corresponding advertising platform SDK Device;And complete the advertisement loading of correspondence advertising platform.
Based on above-mentioned principle design, step S3 specifically includes below scheme in the embodiment of the present invention:
Step S301, one general loader of advertisement of definition, for example, the general loader of advertisement can be named as NativeLoader。
Step S302, the incoming parameter for setting the general loader of advertisement, the incoming parameter include:Need the advertisement of loading The information parameter of platform and advertisement loading readjustment general-purpose interface parameter (such as NativeAdListener).Wherein, advertising platform Information parameter includes advertising platform type (such as adType) and advertisement position ID.Further it will be understood that the general loader of advertisement Incoming parameter include advertisement loading readjustment general-purpose interface parameter, be because advertisement loading readjustment general-purpose interface connect as bottom Mouth can indirectly be called by the general loader of advertisement, accordingly, it would be desirable to incoming as parameter.
Step S303, by the function setting of realizing of the general loader of advertisement it is:Put down according to the advertisement loaded the need for incoming The information parameter of platform, the corresponding abstract example for enumerating class general-purpose interface is created using Java reflection technology;Then by adjusting The abstract advertisement loader for enumerating class general-purpose interface inherited with the example creates function (such as createLoader), and creating needs The advertisement loader for the advertising platform to be loaded;The abstract advertisement for enumerating class general-purpose interface by calling the example to be inherited again Loading function (such as loadAd), completes the advertisement loading of correspondence advertising platform and the readjustment of advertisement loading result.
It is understood that in step S303, the general loader of advertisement is set to create using Java reflection technology Build the corresponding abstract example for enumerating class general-purpose interface.Why Java reflection technology is used, if being because here directly If being realized by Java branching logic sentence, then increase every time or delete new advertising platform will to change advertisement general The code of loader, so just without good autgmentability, the degree of coupling is higher.In order that the general loader of advertisement can be unified to locate Reason loading, used here as Java reflection technology, the forName methods of the Class classes provided first by Java find correspondence The abstract object for enumerating class general-purpose interface (object is pair that is created of information parameter of the advertising platform loaded as needed Answer the abstract object for enumerating class general-purpose interface of advertising platform), its newInstance method is then called to create this abstract piece Lift the example of class general-purpose interface.
Using the method for the embodiment of the present invention, the advertisement loading problem of different advertising platforms can be handled convenient and simplely.Example Such as:When needing one google advertising platform of increase in Android applications, one google advertisement of addition is only needed to here and is put down The abstract enumeration type of platform, that is, add an abstract object for enumerating class general-purpose interface;Then it is general using the advertisement set Loader completes the instantiation of object, then realizes that advertisement loader creates function and advertisement loading function successively, and advertisement adds The realization for carrying device establishment function is exactly the logic for the establishment loader for calling google advertising platforms itself, and advertisement loading function Realization be also call its advertisement load logic complete google advertisements loading, and when advertisement load failure, then call The loading failure call back function readjustment for loading readjustment general-purpose interface with advertisement tells upper strata advertisement loading failure, when advertisement is loaded into Work(, then call the loading success call back function readjustment of advertisement loading readjustment general-purpose interface to tell upper strata advertisement to load successfully.Entirely The code logic of processing procedure is clear, facilitates follow-up maintenance to update, and less code completes more work, can reduce bug Produce.Also, autgmentability is strong, can arbitrarily increase deletion advertising platform, the increasing of the enumeration object of correspondence advertising platform need to be only realized Plus or delete;Replace simple, when needing to be switched to another advertising platform from an advertising platform, it is only necessary to hold The incoming Platform Type of row is just.
Shown in Figure 2, the embodiment of the present invention also provides a kind of realization dress of advertisement general-purpose interface in android system Put, including advertisement loading readjustment general-purpose interface creation module, abstract enumerate class general-purpose interface creation module and the general loading of advertisement Device creation module.
Wherein, advertisement loading readjustment general-purpose interface creation module is used for:Advertisement loading readjustment general-purpose interface is created, it is set Realize that function is:Complete the readjustment of advertisement loading result;And to it is abstract enumerate class general-purpose interface creation module and send enumerate class and connect Mouth creates signal.
Specifically, the advertisement loading readjustment general-purpose interface creation module creates and sets advertisement loading readjustment is general to connect Mouthful idiographic flow be:Define an advertisement loading readjustment general-purpose interface;Created in the advertisement loading readjustment general-purpose interface of definition Build two call back functions:Load successfully call back function and loading failure call back function;Work(is realized to load successful call back function It can be configured, make it be used to complete the successful result readjustment of advertisement loading;Function, which is entered, to be realized to loading failure call back function Row is set, the result readjustment for making it be used to complete advertisement loading failure.
Abstract class general-purpose interface creation module of enumerating is used for:Receive and enumerate after class interface establishment signal, create abstract enumerates Class general-purpose interface, and set it to realize that function is:Create the advertisement loader of advertising platform itself;By calling advertising platform certainly The advertisement of the advertisement load logic loading correspondence advertising platform of body, and by calling the advertisement loading readjustment logical in loading procedure With interface, the readjustment of advertisement loading result is realized;General loader, which is sent, to the general loader creation module of advertisement creates signal.
Specifically, the abstract class general-purpose interface creation module enumerated creates and sets abstract class general-purpose interface of enumerating Idiographic flow is:Definition one is abstract to enumerate class general-purpose interface;In abstract enumerate of definition two are created in class general-purpose interface take out As method function:Advertisement loader creates function and advertisement loading function;Function is created to advertisement loader realizes that function is entered Row is set, the advertisement loader for making it be used to create advertising platform itself;Function, which is configured, to be realized to advertisement loading function, It is set to be used for the advertisement by calling the advertisement load logic of advertising platform itself to load correspondence advertising platform, and in loading procedure By calling advertisement loading readjustment general-purpose interface, the readjustment of advertisement loading result is realized.
The general loader creation module of advertisement is used for:Receive general loader to create after signal, create the general loading of advertisement Device, and set it to realize that function is:According to the information parameter of the advertising platform loaded the need for incoming, corresponding abstract piece is created Lift the example of class general-purpose interface;Then it is complete by the abstract function of realizing of enumerating class general-purpose interface of calling the example to be inherited Advertisement into the advertising platform is loaded.
Specifically, the general loader creation module of the advertisement creates and sets the idiographic flow of the general loader of advertisement For:Define a general loader of advertisement;The incoming parameter of the general loader of advertisement is set, and the incoming parameter includes:Need The information parameter of the advertising platform of loading and advertisement loading readjustment general-purpose interface parameter;The general loader of advertisement is realized into function It is set to:According to the information parameter of the advertising platform loaded the need for incoming, corresponding take out is created using Java reflection technology Example as enumerating class general-purpose interface;Then loaded by the abstract advertisement for enumerating class general-purpose interface for calling the example to be inherited Device creates function, creates the advertisement loader for the advertising platform for needing to load;Again by call that the example inherited abstract piece The advertisement loading function of class general-purpose interface is lifted, the advertisement loading of correspondence advertising platform and the readjustment of advertisement loading result is completed.
It should be noted that:What above-described embodiment was provided realizes device when carrying out practical operation, only with above-mentioned each function The division progress of module is for example, in practical application, as needed can distribute above-mentioned functions by different function moulds Block is completed, i.e., the internal structure of device is divided into different functional modules, to complete all or part of work(described above Energy.
The present invention is not limited to the above-described embodiments, for those skilled in the art, is not departing from On the premise of the principle of the invention, some improvements and modifications can also be made, these improvements and modifications are also considered as the protection of the present invention Within the scope of.
The content not being described in detail in this specification belongs to prior art known to professional and technical personnel in the field.

Claims (10)

1. the implementation method of advertisement general-purpose interface in a kind of android system, it is characterised in that the implementation method includes following step Suddenly:
S1, establishment advertisement loading readjustment general-purpose interface, and set it to realize that function is:Complete the readjustment of advertisement loading result;
S2, create it is abstract enumerate class general-purpose interface, and set it to realize that function is:Create the advertisement loading of advertising platform itself Device;By calling the advertisement load logic of advertising platform itself to load the advertisement of correspondence advertising platform, and pass through in loading procedure The advertisement loading readjustment general-purpose interface is called, the readjustment of advertisement loading result is realized;
S3, the establishment general loader of advertisement, and set it to realize that function is:According to the letter of the advertising platform loaded the need for incoming Parameter is ceased, the corresponding abstract example for enumerating class general-purpose interface is created;Then abstract enumerated by call that the example inherited The advertisement loading realized function, complete the advertising platform of class general-purpose interface.
2. the implementation method of advertisement general-purpose interface in android system as claimed in claim 1, it is characterised in that step S1 Specifically include following operation:
S101, one advertisement loading readjustment general-purpose interface of definition;
S102, two call back functions of establishment in the advertisement loading readjustment general-purpose interface of definition:Load successfully call back function and add Carry failure call back function;
S103, realize that function is configured to load successful call back function, make it be used to completing advertisement loading successful result Readjustment;Function, which is configured, to be realized to loading failure call back function, the result readjustment for making it be used to complete advertisement loading failure.
3. the implementation method of advertisement general-purpose interface in android system as claimed in claim 1, it is characterised in that step S2 Specifically include following operation:
S201, define one and abstract enumerate class general-purpose interface;
S202, in abstract enumerate of definition two abstract method functions are created in class general-purpose interface:Advertisement loader creates function With advertisement loading function;
S203, function is created to advertisement loader realize that function is configured, make it be used to create the wide of advertising platform itself Accuse loader;Function, which is configured, to be realized to advertisement loading function, it is used for the advertisement by calling advertising platform itself The advertisement of load logic loading correspondence advertising platform, and realized in loading procedure by calling advertisement loading readjustment general-purpose interface The readjustment of advertisement loading result.
4. the implementation method of advertisement general-purpose interface in android system as claimed in claim 3, it is characterised in that step S3 Specifically include following operation:
S301, one general loader of advertisement of definition;
S302, the incoming parameter for setting the general loader of advertisement, the incoming parameter include:Need the letter of the advertising platform of loading Cease parameter and advertisement loading readjustment general-purpose interface parameter;
S303, by the function setting of realizing of the general loader of advertisement it is:According to the information of the advertising platform loaded the need for incoming Parameter, the corresponding abstract example for enumerating class general-purpose interface is created using Java reflection technology;Then by calling the example The abstract advertisement loader for enumerating class general-purpose interface inherited creates function, and the advertisement for creating the advertising platform for needing to load adds Carry device;Again by the abstract advertisement loading function for enumerating class general-purpose interface for calling the example to be inherited, complete correspondence advertisement and put down The advertisement loading of platform and the readjustment of advertisement loading result.
5. the implementation method of advertisement general-purpose interface in android system as claimed in claim 4, it is characterised in that:It is described wide Accusing the information parameter of platform includes advertising platform type and advertisement position ID.
6. advertisement general-purpose interface realizes device in a kind of android system, it is characterised in that:This realizes that device adds including advertisement Carry readjustment general-purpose interface creation module, abstract enumerate class general-purpose interface creation module and the general loader creation module of advertisement;
The advertisement loading readjustment general-purpose interface creation module is used for:Advertisement loading readjustment general-purpose interface is created, sets it to realize Function is:Complete the readjustment of advertisement loading result;And to it is abstract enumerate class general-purpose interface creation module send enumerate class interface wound Build signal;
The abstract class general-purpose interface creation module of enumerating is used for:Receive and enumerate after class interface establishment signal, create abstract enumerates Class general-purpose interface, and set it to realize that function is:Create the advertisement loader of advertising platform itself;By calling advertising platform certainly The advertisement of the advertisement load logic loading correspondence advertising platform of body, and by calling the advertisement loading readjustment logical in loading procedure With interface, the readjustment of advertisement loading result is realized;General loader, which is sent, to the general loader creation module of advertisement creates signal;
The general loader creation module of advertisement is used for:Receive general loader to create after signal, create the general loading of advertisement Device, and set it to realize that function is:According to the information parameter of the advertising platform loaded the need for incoming, corresponding abstract piece is created Lift the example of class general-purpose interface;Then it is complete by the abstract function of realizing of enumerating class general-purpose interface of calling the example to be inherited Advertisement into the advertising platform is loaded.
7. advertisement general-purpose interface realizes device in android system as claimed in claim 6, it is characterised in that:It is described wide Accuse loading readjustment general-purpose interface creation module creates and set advertisement loading adjust back general-purpose interface idiographic flow be:
Define an advertisement loading readjustment general-purpose interface;Two readjustment letters are created in the advertisement loading readjustment general-purpose interface of definition Number:Load successfully call back function and loading failure call back function;Realize that function is configured to load successful call back function, make It is used to complete the successful result readjustment of advertisement loading;Function, which is configured, to be realized to loading failure call back function, it is used In the result readjustment for completing advertisement loading failure.
8. advertisement general-purpose interface realizes device in android system as claimed in claim 6, it is characterised in that:It is described to take out Create as enumerating class general-purpose interface creation module and set the abstract idiographic flow for enumerating class general-purpose interface to be:
Definition one is abstract to enumerate class general-purpose interface;Two abstract method letters are created in class general-purpose interface in abstract enumerate of definition Number:Advertisement loader creates function and advertisement loading function;Function is created to advertisement loader realizes that function is configured, and makes It is used for the advertisement loader for creating advertising platform itself;Function, which is configured, to be realized to advertisement loading function, is used for it By calling the advertisement load logic of advertising platform itself to load the advertisement of correspondence advertising platform, and by calling in loading procedure Advertisement loading readjustment general-purpose interface, realizes the readjustment of advertisement loading result.
9. advertisement general-purpose interface realizes device in android system as claimed in claim 8, it is characterised in that:It is described wide Accusing general loader creation module creates and sets the idiographic flow of the general loader of advertisement be:
Define a general loader of advertisement;The incoming parameter of the general loader of advertisement is set, and the incoming parameter includes:Need The information parameter of the advertising platform of loading and advertisement loading readjustment general-purpose interface parameter;The general loader of advertisement is realized into function It is set to:According to the information parameter of the advertising platform loaded the need for incoming, corresponding take out is created using Java reflection technology Example as enumerating class general-purpose interface;Then loaded by the abstract advertisement for enumerating class general-purpose interface for calling the example to be inherited Device creates function, creates the advertisement loader for the advertising platform for needing to load;Again by call that the example inherited abstract piece The advertisement loading function of class general-purpose interface is lifted, the advertisement loading of correspondence advertising platform and the readjustment of advertisement loading result is completed.
10. advertisement general-purpose interface realizes device in android system as claimed in claim 9, it is characterised in that:It is described wide Accusing the information parameter of platform includes advertising platform type and advertisement position ID.
CN201710165497.6A 2017-03-20 2017-03-20 The implementation method and device of advertisement general-purpose interface in a kind of android system Active CN107092501B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710165497.6A CN107092501B (en) 2017-03-20 2017-03-20 The implementation method and device of advertisement general-purpose interface in a kind of android system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710165497.6A CN107092501B (en) 2017-03-20 2017-03-20 The implementation method and device of advertisement general-purpose interface in a kind of android system

Publications (2)

Publication Number Publication Date
CN107092501A true CN107092501A (en) 2017-08-25
CN107092501B CN107092501B (en) 2019-04-23

Family

ID=59646270

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710165497.6A Active CN107092501B (en) 2017-03-20 2017-03-20 The implementation method and device of advertisement general-purpose interface in a kind of android system

Country Status (1)

Country Link
CN (1) CN107092501B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107730315A (en) * 2017-10-18 2018-02-23 深圳大宇无限科技有限公司 Information displaying method and device
CN107977274A (en) * 2017-10-19 2018-05-01 北京奇艺世纪科技有限公司 The control method and device that SDK is called
CN108287710A (en) * 2018-02-11 2018-07-17 北京恒华伟业科技股份有限公司 A kind of Java module communications method and system
CN108462894A (en) * 2018-03-30 2018-08-28 武汉斗鱼网络科技有限公司 Direct broadcasting room broadcast processing method, device and readable storage medium storing program for executing
CN109445845A (en) * 2018-09-10 2019-03-08 深圳市智美达科技股份有限公司 Interface call method, device, computer equipment and storage medium
CN110737428A (en) * 2019-10-21 2020-01-31 Oppo广东移动通信有限公司 Hidl-based universal interface design method, device, terminal and readable storage medium
CN111031358A (en) * 2019-12-13 2020-04-17 北京奇艺世纪科技有限公司 Data playing method and device, electronic equipment and storage medium
CN112435071A (en) * 2020-12-02 2021-03-02 上海哔哩哔哩科技有限公司 Promotion data creating method and system
CN113435937A (en) * 2021-07-05 2021-09-24 上海哔哩哔哩科技有限公司 Advertisement creating method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7499992B1 (en) * 2008-02-27 2009-03-03 International Business Machines Corporation Association traversal translation for common information model
CN102436370A (en) * 2011-08-12 2012-05-02 北京思创银联科技股份有限公司 Dynamic enumeration method
CN103077673A (en) * 2012-12-30 2013-05-01 乐视网信息技术(北京)股份有限公司 Method and system for playing advertisements corresponding to articles in videos
CN103365662A (en) * 2013-07-11 2013-10-23 合一信息技术(北京)有限公司 Method and device for advertisement putting based on stream media advertisement template
CN103546782A (en) * 2013-07-31 2014-01-29 Tcl集团股份有限公司 Method and system for dynamically adding advertisements during video playing
CN105843654A (en) * 2016-04-14 2016-08-10 广州市久邦数码科技有限公司 Method and system for implementing dynamic loading of advertisement SDK (software development kit)

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7499992B1 (en) * 2008-02-27 2009-03-03 International Business Machines Corporation Association traversal translation for common information model
CN102436370A (en) * 2011-08-12 2012-05-02 北京思创银联科技股份有限公司 Dynamic enumeration method
CN103077673A (en) * 2012-12-30 2013-05-01 乐视网信息技术(北京)股份有限公司 Method and system for playing advertisements corresponding to articles in videos
CN103365662A (en) * 2013-07-11 2013-10-23 合一信息技术(北京)有限公司 Method and device for advertisement putting based on stream media advertisement template
CN103546782A (en) * 2013-07-31 2014-01-29 Tcl集团股份有限公司 Method and system for dynamically adding advertisements during video playing
CN105843654A (en) * 2016-04-14 2016-08-10 广州市久邦数码科技有限公司 Method and system for implementing dynamic loading of advertisement SDK (software development kit)

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
宋波: "《Java程序设计 基于JDK 6和NetBeans实现》", 28 February 2011, 清华大学出版社 *
欧二强等: "《Java编程手记 从实践中学习Java》", 30 June 2013, 清华大学出版社 *

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107730315A (en) * 2017-10-18 2018-02-23 深圳大宇无限科技有限公司 Information displaying method and device
CN107977274A (en) * 2017-10-19 2018-05-01 北京奇艺世纪科技有限公司 The control method and device that SDK is called
CN108287710A (en) * 2018-02-11 2018-07-17 北京恒华伟业科技股份有限公司 A kind of Java module communications method and system
CN108287710B (en) * 2018-02-11 2021-02-12 北京恒华伟业科技股份有限公司 Java module communication method and system
CN108462894A (en) * 2018-03-30 2018-08-28 武汉斗鱼网络科技有限公司 Direct broadcasting room broadcast processing method, device and readable storage medium storing program for executing
CN108462894B (en) * 2018-03-30 2020-07-31 武汉斗鱼网络科技有限公司 Live broadcast room broadcast processing method and device and readable storage medium
CN109445845A (en) * 2018-09-10 2019-03-08 深圳市智美达科技股份有限公司 Interface call method, device, computer equipment and storage medium
CN110737428B (en) * 2019-10-21 2023-08-15 Oppo广东移动通信有限公司 Hidl-based universal interface design method, device, terminal and readable storage medium
CN110737428A (en) * 2019-10-21 2020-01-31 Oppo广东移动通信有限公司 Hidl-based universal interface design method, device, terminal and readable storage medium
CN111031358A (en) * 2019-12-13 2020-04-17 北京奇艺世纪科技有限公司 Data playing method and device, electronic equipment and storage medium
CN111031358B (en) * 2019-12-13 2022-07-12 北京奇艺世纪科技有限公司 Data playing method and device, electronic equipment and storage medium
CN112435071A (en) * 2020-12-02 2021-03-02 上海哔哩哔哩科技有限公司 Promotion data creating method and system
CN113435937A (en) * 2021-07-05 2021-09-24 上海哔哩哔哩科技有限公司 Advertisement creating method and device

Also Published As

Publication number Publication date
CN107092501B (en) 2019-04-23

Similar Documents

Publication Publication Date Title
CN107092501B (en) The implementation method and device of advertisement general-purpose interface in a kind of android system
CN111614718B (en) Enterprise communication channel fusion method, device, equipment and readable storage medium
CN102799962A (en) Configuration type business flow system and realization method thereof
CN107222530A (en) Service asynchronous exchange method, equipment, system and computer-readable recording medium
CN108804322A (en) Automated testing method, device, computer equipment and storage medium
CN106161480A (en) SMS platform service scheduling method based on gateway resource pond
CN103530097B (en) The implementation method and device of a kind of component across middleware platform
CN109710235B (en) Transaction implementation system and method based on Java intelligent contract service logic
CN103780686A (en) Method and system for customizing application approval procedure in cloud organization
CN109471626A (en) Page logic structure, page generation method, page data processing method and device
CN103970545A (en) LTE Modem method adopting JNI invoking mode and used in Android system
CN107145353A (en) Software frame and Design of Software Framework method
CN107632817A (en) A kind of Mobile solution efficient iterative Spark frameworks
CN112511596A (en) Method and equipment for creating cloud resources in cloud platform
CN102945264B (en) Method for intelligently starting distributed transaction
CN112035090A (en) Intelligent contract management system and method based on containerization technology
CN111027284B (en) Standardized output method based on flexible data access
CN106714123A (en) Message transmission method and communication device
CN102135939B (en) Test case operation dispatching device and method
CN105975277A (en) Template-based mixed cloud elastic telescoping set building method
CN102999371B (en) Interface Development method and system based on Lua script
CN106293658A (en) A kind of interface assembly generates method and equipment thereof
CN105677505B (en) A method of based on serial interface management IPMI
CN109684609B (en) ASP (active Server Page) and NET (Internet vehicle networking) MVC (model view controller) based Excel template generation and data conversion and import method
CN111381863A (en) APP transaction and automatic online method and system based on block chain technology

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