Cordova andriod new version code set
Here is an example of how to set up a new Cordova Android project with the latest version of Cordova and Android SDK:
Step 1: Install Node.js and npm
If you haven't already, install Node.js and npm (the package manager for Node.js) from the official website: https://nodejs.org/en/download/
Step 2: Install Cordova
Open a terminal or command prompt and run the following command to install Cordova:
npm install -g cordova
This will install the latest version of Cordova globally on your system.
Step 3: Create a new Cordova project
Create a new directory for your project and navigate to it in the terminal or command prompt:
mkdir myandroidapp
cd myandroidapp
Then, run the following command to create a new Cordova project:
cordova create myandroidapp com.example.myandroidapp MyAndroidApp
This will create a new Cordova project with the name "MyAndroidApp" and the package name "com.example.myandroidapp".
Step 4: Add the Android platform
Run the following command to add the Android platform to your project:
cordova platform add android
This will download and install the Android SDK and set up your project to build for Android.
Step 5: Set up the Android SDK
Make sure you have the Android SDK installed on your system. You can download it from the official Android website: https://developer.android.com/studio
Once you have the SDK installed, set the ANDROID_HOME
environment variable to point to the location of the SDK on your system. For example:
export ANDROID_HOME=/path/to/android-sdk
Step 6: Build and run the app
Run the following command to build and run the app on an emulator or physical device:
cordova run android
This will build the app and launch it on an emulator or physical device. You can also specify a specific emulator or device to run the app on:
cordova run android --emulator="Nexus 5"
Step 7: Configure the app
Open the config.xml
file in the root of your project and configure the app as needed. For example, you can set the app name, version, and icon:
<widget id="com.example.myandroidapp" version="1.0.0" xmlns="http://www.w3.org/ns/widgets">
<name>My Android App</name>
<icon src="res/icon.png" />
</widget>
That's it! You now have a new Cordova Android project set up with the latest version of Cordova and Android SDK.