I would like to add a PhoneGap plug-in for Android to my DevExtreme project. How can I do it?
[Updated by Uriah (DevExpress Support)]
Starting from version 14.2, we suggest using the built-in feature to include PhoneGap plug-ins into a DevExtreme application. This feature is described in our online documentation: Set Required Plugins.
[Old content]1. Prepare Zip for PhoneGap Build. Please see Prepare Zip for PhoneGap Build.
There are three ways to add a plugin to your project:
I. Following recommendations from Prepare Zip for PhoneGap Build.
II. Modifying the config.xml file in Zip for the PhoneGap Build service.
The following steps are required:
2. Open the config.xml file in your archive and add references for the required plugin. For example, you wish to add the DatePicker plugin. In this case, your config.xml should be modified in the following manner:
3. Save config.xml in your archive and use PhoneGap Build for building a native package. The full list of plugins can be found here.[XML]
<?xml version="1.0" encoding="UTF-8"?> <widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" ...> ... <gap:plugin value="com.dileep.plugins.datepicker" /> </widget>
III. Using a custom template. You can use this approach for Cordova 2.9.0. Starting with DevExtreme 14.1, please use the approach from one previous sections.
It is possible to accomplish this task using the Eclipse IDE.1. Download and install Android SDK.
Please perform the following steps:
2. Open the Eclipse IDE.
3. Click the File -> Import... menu item.
4. In the Import window, select the Projects from Git item and click the Next button.
5. In the Import projects from Git window, select the URI item and click the Next button.
6. Click the DevExtreme-ApplicationTemplate-Android on GitHub.
7. Click the Git Read-Only button and then click the copy to clipboard button.
8. Paste URL to the URI field and click the Next button.
9. Follow the recommendations of the wizard.
10. In the Cloning from... window, click the Finish button.
If you get the Android requires compiler compliance level ... error in the console, right-mouse click your project in the Package Explorer window and click the Android Tools -> Fix Project Properties menu item.
Now your project is ready for adding a required plug-in. Let's add the DatePickerplug-in. Follow the recommendations from the readme.md file to adjust your project structure. When all the modifications are complete, save your project.
11. Click the File -> Export menu item.
12. In the Export window, select the Export Android Application item and click the Next button. Follow the recommendations of the wizard.
13. In the Keystore selection section, specify a corresponding key store and click the Next button.
14. In the Key Creation section, specify fields that are shown in the image below and click the Next button.
15. In the Destination and key/certificate checks, specify a location where you want to save your APK file and click the Finish button.
Now your package is built and you can use as an application template in Visual Studio. See the How to add a custom template to a DevExtreme application article to learn more.
In the attachment you will find a project that was created in the Eclipse IDE using the approach described above and a project that was created in Visual Studio using the template from the Eclipse IDE.
Manually install Device plugin (and others) into cordova 3.0
How to add PhoneGap plug-in for iOS to a DevExtreme project