ISN (International Social Networking Services - Interactive Apps and Websites)
Getting started with PhoneGap in Eclipse for AndroidRequirements
Prerequisite knowledge
While not required, some knowledge of HTML, JavaScript, CSS, XML, and Eclipse will help you make the most of this article.
Additional required other products Eclipse Classic //www.eclipse.org/downloads/ Android SDK //developer.android.com/sdk/index.html PhoneGap //phonegap.com/download
User level : All
Eclipse is an open source integrated development environment (IDE) that supports many technologies, but this article is focused on its support of Java, the native language for Android applications. Android is Google's open source mobile operating system. Android is the operating system for many smartphone and tablet devices, including the Samsung Galaxy line of phones and tablets, the Amazon Kindle Fire tablet, and the Barnes and Noble Nook tablet, as well as many other devices from numerous manufacturers. PhoneGap is an open source application platform that enables you to create natively-installed mobile applications using HTML and JavaScript.
Setting up Eclipse
The first step in setting up your development environment for PhoneGap applications on Android is to download and install the Eclipse IDE.
Android development with PhoneGap can be done in Windows, OS X, or Linux. There are many different installation packages for Eclipse. While PhoneGap may work with other package configurations, the Eclipse Classic package is recommended and already includes tools that you need to get started and be productive with PhoneGap application development.
Setting up Android Tools
After you have downloaded and set up Eclipse, you will need to configure your environment to use Google's Android development tools. There are two steps to this process. First, you download and install the Android SDK. Second, you install the ADT plugin for Eclipse.
Download and configure the Android SDK
The first step in configuring Android tools on your system is to download the Android SDK.
Configure the ADT Plugin for Eclipse
Next, you need to set up the ADT (Android Development Tools) plugin for Eclipse. The ADT plugin must be installed through the Eclipse Install New Software wizard.
Once you've installed the ADT plugin and restarted Eclipse, you need to configure it to use reference the Android SDK that you have already downloaded to your local file system.
Downloading and installing PhoneGap
The next step is to download and set up PhoneGap.
You are now ready to create your first PhoneGap project for Android within Eclipse.
Note: The steps that follow are for PhoneGap 1.5, but the process should be applicable or similar for all versions of PhoneGap.
Creating the project in Eclipse
Follow these steps to create a new Android project in Eclipse:
Figure 1. Creating a new Android project.
After you create a new, standard Android project you will update that project to use PhoneGap.
Figure 2. The New Android Project dialog box.
Note: Choosing the Android 2.2 build target will configure the compiler to target the Android 2.2 SDK, and will ensure that your PhoneGap application will work on devices running Android 2.2 and newer versions of the operating system.
Figure 3. Selecting a build target
Edit your project's main Java file found in the src folder in Eclipse:
Hello World
|