2. NATIVE PLATFORM
There are many platforms available
for developing mobile applications.
It’s a tedious job for the developer
to code a application/idea on all
platform.
Each platform has its own native
api which are used for developing
applications.
Some of the Mobile Platforms:
Symbian
Android
IOS
Blackberry
Web OS
Windows Phone
Bada
Meego
4. CROSS PLATFORM???
<html>
..
.. Compiler
..
<html>
Definition:-A cross mobile platform is a platform that
helps developer to develop the applications in one
common language that would be supported by all the
popular platform.
One piece of code compiled on different platforms.
5. FEATURES
Free and open source
Create apps with jquery mobile or HTML, CSS & JS
Reduce development and long-term maintenance cost
Reduce technical barriers and the number of required
skills for the development team
Single code for building mobile apps for iPhone, Android
and other platform
Supports all major mobile platforms.
6. STRATEGY
Utilize open source technologies
Write code once and cross-compile on multiple
mobile platforms
Reduce the number of skills for development team
DESIGN
Use single codebase for different versions of
applications on different platforms
Provide same functionality to all platforms
Cross browser compatibility
7. DEVELOPMENT
• Create native mobile apps for multiple devices &
operating systems.
• Access to native APIs using Phonegap.
• Build apps using HTML, Javascript and CSS.
PROMOTION
• Publish apps for iOS, Android, Blackberry etc.
• Service customers in a variety of marketplaces.
8. PHONEGAP???
• An open source Platform which
makes use of web technologies
like jquery mobile,html5,css,
and javascript to create native
apps.
• A Native library for every
platform.
• A javaScript ibrary/wrapper.
• Currently known as Apache
Cordova
10. PHONEGAP HISTORY!!!
• First developed at an iPhoneDevCamp event in San
Francisco
• IOS running out of Iphone Developer.
• There are lots more web developers out there than
there are Objective-C ones.
• Need to develop a framework that allowed web
developers to leverage all their knowledge of HTML,
CSS, and JavaScript that could also interact with the
important native parts of an iPhone.
11. PLATFORM SUPPORT
• IOS
• Android
• Symbian
• Blackberry
• Windows Phone
• Web OS
• Bada
• Tizen
13. 1. Requirements
Eclipse 3.4+
2. Install SDK + Cordova
Download and install Eclipse Classic
Download and install Android SDK
Download and install ADT Plugin
Download the latest copy of Cordova and extract its
contents.
14. 3. Setup New Project
Launch Eclipse, and select menu item New Project
15. Then specify an Application Name, a Project Name and
Package Name with Namespace
18. Make sure the activity doesn't inherit from
anything. You most likely won't have PhoneGap on
your Eclipse Workspace. Once this is done, click
finish
In the root directory of your project, create two
new directories:
/libs
assets/www
Copy cordova-2.0.0.js from your Cordova
download earlier to assets/www
19. Copy cordova-2.0.0.jar from your Cordova
download earlier to /libs
Copy xml folder from your Cordova
download earlier to /res
21. Edit your project's main Java file found in the src folder in
Eclipse:
Add import org.apache.cordova.*;
Change the class's extend from Activity to DroidGap
Replace the setContentView() line with
super.loadUrl("file:///android_asset/www/index.html");
22.
23. •Right click on AndroidManifest.xml and select Open
With > Text Editor
•Paste the following permissions between the <uses-
sdk.../> and <application.../> tags.
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:resizeable="true"
android:anyDensity="true" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
24.
25. 4. Hello World
•Create and open a new file named index.html in the
assets/www directory. Paste the following code:
<!DOCTYPE HTML>
<html>
<head>
<title>Cordova</title>
<script type="text/javascript" charset="utf-8" src="cordova-1.9.0.js"></script>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
26. 5A. Deploy to Simulator
Right click the project and go to Run As > Android Application
Eclipse will ask you to select an appropriate AVD. If there isn't
one, then you'll need to create it.
5B. Deploy to Device
Make sure USB debugging is enabled on your device and plug
it into your system. (Settings > Applications > Development)
Right click the project and go to Run As > Android Application