KeyMob mobile advertising platform is an accurate and stable advertising SDK and mobile advertising platform, committed to shaping the most influential mobile advertising platform in China. It mainly engages in mobile advertising services, spanning two major platforms: IOS and Android, including banners, interlaced screens, full screens, video advertising, banners and other advertising forms.
1. Import JAR package
Users who use Eclipse for development first decompress the download into the libs subdirectory in the local project directory (for example, your project directory is D:workspaceXXproject, please put it in the D:workspaceXXprojectlibs directory), and then open the project project where the App application you developed is located in Eclipse.
Right-click the root directory of the project in Package Explorer, select Properties, then click Java Build Path -> Libraries -> Add External JARs, select the local file, and finally click OK to import successfully.
2. Configuration
Version requirements:
android:minSdkVersion = 8:Requires support for Android 2.2 and above.
Permission Requirements:
- .ACCESS_NETWORK_STATE: Used to obtain network link status and send statistics.
- .ACCESS_WIFI_STATE: Used to obtain network link status and send statistical data.
- : Used for network communication and sending statistical data.
- .READ_PHONE_STATE: Used to obtain hardware information of the mobile phone, mainly used to distinguish users.
- .ACCESS_COARSE_LOCATION: Used to obtain rough geographic information. (Optional, recommended)
Meta data:
- CNZZ_APP_KEY: Please fill in the App Key you got when registering the App.
- CNZZ_CHANNEL_ID: The corresponding channel name can be filled in according to the different distribution channels of the App, and used for data published by the back-end statistics channel. (If you use the packaging tool to automatically package it, you can not fill in the channel name).
Code:
<manifest …> <uses-SDK android:minSdkVersion="8" android:targetSdkVersion="8" /> <uses-permission android:name=".GET_TASKS"/> <uses-permission android:name=""></uses-permission> <uses-permission android:name=".READ_PHONE_STATE"></uses-permission> <uses-permission android:name=".ACCESS_NETWORK_STATE"></uses-permission> <uses-permission android:name=".ACCESS_WIFI_STATE"></uses-permission> <application …> <activity …/> <meta-data android:value="cnzz.a_6bf43dcde8e085951522422e" android:name="CNZZ_APP_KEY"></meta-data> <meta-data android:value="cnzz" android:name="CNZZ_CHANNEL_ID"></meta-data> </application> </manifest>
1). Data collection and burial point
Introduce data acquisition packages in the code.
import ;
2). Basic statistics
Just call the corresponding acquisition function in the onCreate method in the entry Activity class of the program, and other activities do not need to be buried:
MobileProbe. startStatistic (Activity activity, String appkey, String channel)
The parameters are: reference to the current Activity, application APPKEY, application channel.
Sample code:
Public class DemoActivity extends Activity{ Public void Create(Bundle savedInstanceState){ (savedInstanceState); (this,”cnzz.a_099b46617ca2180c7d741936”,”cnzz”); setContentView(); } }
3).Phonegap can be added as follows:
public void onCreate(Bundle savedInstanceState) { (savedInstanceState); (this,"cnzz.a_qwv6we0tnlqkeu2qzp2wchrb","niulanapp"); ("splashscreen", ); ("file:///android_asset/www/", 3000); }
3. Test
1. Whether to import the JAR package correctly
2. Whether the correct permissions are added to:ACCESS_NETWORK_STATE、ACCESS_WIFI_STATE、INTERNET、READ_PHONE_STATE、GET_TASKS。
3. Whether to call the startStatistic point buried function in the onCreate function of the main Activity class
4. Whether the appkey is correctly filled in the buried point function
5. Confirm the network status of Android emulator (or test the phone)
6. Start the application and do more attempts (switch the page, open and close the application)
KeyMob mobile advertising platform is an accurate and stable advertising SDK and mobile advertising platform, committed to shaping the most influential mobile advertising platform in China. It mainly engages in mobile advertising services, spanning two major platforms: IOS and Android, including banners, interlaced screens, full screens, video advertising, banners and other advertising forms.
The above is all the content of this article. I hope it will be helpful to everyone's learning and help you install it quickly.