Android Apps

Generate Codova.jar file from Phonegap project using ant

December 8, 2014 by Sarath DR in Android Apps, Tips with 0 Comments

There might be a simple method already available for this, but I would like to write down this method somewhere. This will be useful when you do Phonegap development for Android in Android studio.

You can generate library file by following the below steps.

Step 1: Make sure that you have installed apache cordova in your machine. You can follow the below link to install cordova using node.js.

http://cordova.apache.org/docs/en/4.0.0//guide_cli_index.md.html#The%20Command-Line%20Interface

Step 2: Create a new project and add platform android platform files inside the project

 
 $ cordova create hello com.sarathdr.hello HelloWorld
 
 $ cd hello
 
 $ cordova platform add android

Step 3: Go to the CodovaLib folder and run the following command

 
$ android update project

Step 4: If you check the folder, you can see that a build.xml file is auto generated and add the below lines into that file.

	<target name="jar" depends="-compile">
           <jar
		basedir="bin/classes"
		excludes="org/apache/cordova/R.class,org/apache/cordova/R$*.class"
		jarfile="cordova.jar" />
	</target>

Step 5: Run the below command to generate the jar files.

 
$ ant jar

This will create a jar file inside your CordovaLib folder.

Tagged ,

Share this to

Related Posts

Leave a reply

Your email address will not be published. Required fields are marked *

*

About
View Sarath D R's profile on LinkedIn

I am a technology consultant and an entrepreneur focused on the following technologies Java,Spring, Android, Angular, Asterisk, Symfony, Cake , Code-Igniter, Jquery , XAMPP, XHTML, AJAX, MySql, Seo, Web Design, Wordpress, iPhone development.

Today’s Tips
  • Generate Codova.jar file from Phonegap project using ant
  • Google map javascript client  to find the geographic co-ordinates  from  Address or post code
  • Update Android main UI from Webview – Phonegap Plugin
  • Jplayer is not working  with HTC One Android 4.3 version browser
  • Regular expression to validate mobile phone numbers starting with + ( plus ) – php
  • Simple pagination script for PHP
  • Useful adb ( Android Debug Bridge ) commands
  • Change the javascript files url to absolute url – Symfony 1.4
  • Set Http authentication header from Client – PHP / CURL

This site uses cookies from Google to deliver its services, to personalise ads and to analyse traffic. Information about your use of this site is shared with Google. By using this site, you agree to its use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.This site also uses cookies from Google to deliver its services, to personalise ads and to analyse traffic. Information about your use of this site is shared with Google. By using this site, you agree to its use of cookies.

Close