How to use the PhoneGap build

Source: Internet
Author: User
Tags build gradle admob

The plugin can be used to configure the plug-in in config. phonegap build service for each application, you need to have a config. ins file in your root folder.

According to Cordova, the Cordova registry is obsolete and all plugins have been moved to NPM and renamed "Cordova-plugin-xxx".

In your CONFIG. config file:
<uses-permission android:name= "Android.permission.RECORD_AUDIO"/> or
<uses-feature android:name= "Android.hardware.microphone" android:required= "false"/>

Use that plugin logo?
Please note that there are some subtle differences between the two plugins:
Cordova-plugin-admobpro, it uses the default jar in your Android SDK and needs to build Gradle Android APK. See It's plugin.xml:
<uses-permission android:name= "Android.permission.ACCESS_NETWORK_STATE"/>

Cordova-plugin-admob, which relies on a plug-in that contains the Google-play-services.jar, can use these tools instead of Gradle. See It's plugin.xml:
<uses-permission android:name= "Android.permission.ACCESS_WIFI_STATE"/>

Does the PhoneGap build support Gradle?
Please check the news from PhoneGap build on their page: https://github.com/
2015/9/29:android is built using phonegap4+ and now uses the gradle! on @phonegapbuild View Blog: https://github.com/... More information and warnings!

2015/9/30: There are some problems with the new Android Gradle build! We have restored the default build with Ant again. I'm sorry for the trouble.

2015/9/30: @PhoneGapBuild will sort the gradle issue update.

Example
View all config: https://github.com/
You can then call the AdMob plugin in your JavaScript code (after the Deviceready event is triggered).
Your index.html:
Keymob.isinterstitialready (function (isReady) {
if (IsReady) {
Alert ("Interstitial is the load success,you can show it Now");
}
});

Keymob.showinterstitial ()
Keymob.isinterstitialready (function (isReady) {
if (IsReady) {
Keymob.showinterstitial ();
}
});

function onadreceive (message) {
if (Message.adtype==keymob. Adtypes.interstitial) {
Alert (Message.adtype + message.adapter+ ", can show it Now");
}
Keymob.showinterstitial ();//show it when received
}
Document.addeventlistener (Keymob. Adevent.on_loaded_success, onadreceive, false);

Build and build phonegap with apps
Put your code in https://github.com/and add the app from the PhoneGap built from https://github.com/.
This is a simple phonegap to build a demo project (with Index.html and config. s).
https://github.com/build and get your app package if the build passes.

How to use the PhoneGap build

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.