Why PhoneGap

baroohspottyMobile - Wireless

Jul 19, 2012 (5 years and 5 days ago)

459 views

Why  PhoneGap
 
 
 
©
 descartes,  2010  

 
www.
descartes.co.uk
 
-­‐
 +44
 
(0)845  430  9240
 
Summary
 
The  rapidly  growing  smartphone  market  is  having  a  profound  impact  on  how  
people  access  &  manage  information.  With  5  distinct  operating  systems  to  develop  
for,  PhoneGap  provides  a  proven  universal  solution.  It  allows  web  developers  to  
build  &  deploy  applications  using  a  common  set  of  standards  based
 on  HTML,  CSS
 
and  JavaScript,  maximising  code  reuse  between  platforms.  This  provides  a  faster  
time  to  market  and  a  reduction  in  development  costs  in  terms  of  time  &  hourly  
rate.
 
These  apps  ar
e  not  
running  
native
 device  code
 and  there  are  varying  levels  of  
functionality  support  &  performance.  However  PhoneGap  allows  straightforward  
access  to  the  underlying  native  code  for  individual  platform  tweaks  as  required.
 
PhoneGap  is  not  a  hack,  bypassing
 normal  development  practises:  BlackBerry,  
Symbian  &  Palm  already  provide  a  framework  for  web  based  apps  and  the  iPhone  
&  Android  provide  mechanisms  that  facilitate  it.
 
If  you  only  want  to  deploy  to  one  platform  
and/or
 you  have  a  healthy  bank  balance  
then  
native  code  is  the  way  to  go.
 
If  you  want  to  produce  a  v1  app  and/or  deploy  to  multiple  platforms  at  reasonable  
cost  then  PhoneGap  is  the  way  to  go.
 
Some  numbers
 


Quarter  2,  2010  total  smartphone  sales  of  61  million  units.
1
 


An  increase  of  50%  over  previous
 year.
2
 


Smartphones  more  
prevalent
 for  accessing  the  internet  than  standard  
phones.
3
 


Tablets  (iPad  et  al)  to  outsell  netbooks  &  desktop  systems  by  2013.
4
 


By  2014,  it  is  estimated  that  there  will  be  1  billion  smartphone  users.  
5
 


Apples  App  store  hit  3  billi
on  downloads  in  
January  2010.  
6
 
 


Market  share:
7
 
o

Despite  all  the  hoopla,  Apple  only  has  14
%.
 
o

Symbian  (No
kia  &  others)  leading  with  41%.
 
o

RIM  (BlackBerry)  at  18
%.
 
o

Andr
oid  (Google’s  OS)  at  17%.
 
o

Windows  Mobile  holds  6.8%  but  as  
Windows  7  Phone  was  released  in
 October  
2010  
this
 is  reasonably  ex
pected  to  become  
a  major  player  very  quickly.
 
                                                           
                                                 
 
1
 
http://www.gartner.com/it/page.jsp?id=1421013
 
2
 Gartner  report  as  above
 
3
 
http://www.comscore.com/Press_Events/Press_Releases/2010/10/Smartphone_Subscribers_Now_Comprise_Majority_of
_
Mobile_Browser_and_Application_Users_in_U.S
 
4
 
http://www.mobile
-­‐
computing
-­‐
news.co.uk/mobile
-­‐
computer
-­‐
news/5180/tablets
-­‐
to
-­‐
outsell
-­‐
netbooks
-­‐
and
-­‐
desktops
-­‐
by
-­‐
2013.html
 
5
 
http://www.marketwire.com/press
-­‐
release/Number
-­‐
of
-­‐
Smartphone
-­‐
Users
-­‐
to
-­‐
Quadruple
-­‐
Exceedin
g
-­‐
1
-­‐
Billion
-­‐
Worldwide
-­‐
by
-­‐
2014
-­‐
1136308.htm
 
6
 
http://www.apple.com/pr/library/2010/01/05appstore.html
 
7
 Gartner  report  as  above
 
Why  PhoneGap
 
 
 
©
 descartes,  2010  

 
www.
descartes.co.uk
 
-­‐
 +44
 
(0)845  430  9240
 


Android  is  considered  by  72%  of  developers  to  have  more  potential  than  
iOS.
8
 
Native  development
 
Creating  a  well  designed  app  for  a  device  requires  good  knowledge  of  the  native
 
programming  language.  For  the  various  devices  this  is:
 


iPhone/iPad/iPod  =  Objective
-­‐
C
 


Android  =  Java
 


BlackBerry  =  Java
 


Symbian  =  C++
 


Windows  7  Phone  =  C#
 
In  addition,  each  platform  has  its  own  application  programming  interfaces  (api’s)  
that  have  to  be  lea
rn’t.
 
Given  the  rapid  development  of  these  environments  it  is  not  feasible  to  master  
more  than  one  platform.  It  is  reasonable  to  be  able  to  create  v1  apps  on  a  variety  of  
platforms  but  nothing  more.
 
Native  programming  in  the  iPhone  market  place  commands  a  
rate  around  
$125/hour.
 
Enter  PhoneGap
 
As  each  platform  has  a  web  browser  &  a  native  code  interface  to  allow  web  pages  
to  be  displayed  in  a  standalone  app,  Nitobi,  the  creators  of  PhoneGap,  have  created  
a  framework  that  bundles  up  HTML5,  CCS3  &  JavaScript  w
ith  images,  sounds  &  
movies  as  required  and  presents  them  as  a  native  app  for  a  device.
 
This  presentation  layer  is  consistent  across  all  platforms  and  provides  access  to  
key  features  such  as  GPS,  accelerometer,  camera,  contacts,  initiating  calls  or  
sending
 email  or  text  message,  
 
This  allows  web  developers  to  be  used  to  create  an  app  and  for  the  code  to  be  
transferrable  between  platforms,  typically  75%  code  reuse.
 
Web  developers
 
are  more  plentiful  so  don’t  command  a  premium  in  the  market  
place,  projects  are
 not  held  up  waiting  for  availability  and  the  web  assets  can  be  
planned  &  created  with  a  mind  to  deploy  to  several  platforms  with  considerable  
savings.
 
Getting  started  is  very  simple  

 you  can  use  FireFox  or  Safari  to  check  your  app  
initially,  the  developm
ent  environments  are  free  to  download  and  include  device  
simulators.
 
PhoneGap  is  open  source  so  there  are  no  run  time  or  licensing  costs,  there  is  a  
community  of  25+  active  developers  contributing  to  the  base  code  and  100+  
developers  using  &
 supporting  the
 developer  base.
 
As  the  source  code  is  available  and  because  a  plug
-­‐
in  architecture  is  in  place,  it  is  
possible  to  extend  a  platforms  functionality  with  native  code  if  required.
 
                                                           
                                                 
 
8
 
http://www.appcelerator.com/mobile
-­‐
developer
-­‐
report
-­‐
September
-­‐
2010/
 
Why  PhoneGap
 
 
 
©
 descartes,  2010  

 
www.
descartes.co.uk
 
-­‐
 +44
 
(0)845  430  9240
 
Perceived  drawbacks
 
Not  all  platforms  provide  the  same  level  of  functionality.
 This  is  true  regardless  of  
how  the  app  is  developed  

 native  code  or  via  the  PhoneGap  framework.
 
The  iPhone  has,  with  Apple’s  usual  strategy,  spoilt  us  with  slick  hardware  based  
animations  (at  the  cost  of  battery  life).  Most  other  devices  do  not  have  the  
power
 
to  produce  such  a  smooth  &  responsive  interface  if  you  wish  to  replicate  such  
features.  
 
Complete,  good
-­‐
looking,  functional,  useful  apps  can  be  created  that  can
 then
 be  
quickly  deployed  across  a  number  of  platforms.
 
Trying  to  reach  native  iPhone  nirv
ana
 on  all  platforms
 is  not  possible,  even  if  you  
go  to  native  code  on  each  platform.  Ignoring  other  platforms  is  ignoring  8
6
%  of  the  
users.
 
What  PhoneGap  is  not
 
PhoneGap  does  not  run  any  sort  of  web
 server  on  the  phone  so  you  
cannot
 just  
move  your  PHP/myS
QL/Ruby/Rails/Perl/ASP/ASP.NET/JSP  website  to  the  
framework  and  have  it  run.
 
PhoneGap  does  not  provide  a  bypass  to  the  app  store  approval  requirements.  Your  
app  will  be  judged  on  the  same  criteria  as  native  code  apps.
 
Apple  app  store  approval  is  not  grante
d  for  apps  that  just  redisplay  a  website  or  
that  downloads  layouts  &/or  functionality  so  you  
cannot
 create  an  app  that  can  
change  when  you  feel  like  it.
 
PhoneGap  is  not  suitable  for  graphic  intense  applications  like  action  games.
 
Alternatives  to  PhoneGap
 
For  iPhone  only  there  is  a  similar  framework  called  NimbleKit.  For  iPhone  &  
Android  there  is  
Appcelerator
.  For  all  platforms  there  is  RhoMobile.
 
Appcelerator  &  RhoMobile  both  wrap  the  develo
pment  environment  very  tightly  
introducing  a  much  steeper  learning
 curve.
 
Web  d
eveloper,  not  
web  
designer
 
An  important  distinction  should  be  drawn  between  someone  who  can  create  a  
de
sign  and  someone  who  can  code  a
 website.
 
Many  great  designs  can’t  be  feasibly  implemented  in  web  code.
 
Much  of  the  functionality  of  the  app  
needs  to  be  created  in  JavaScript
,
 a  
programming  
language,  which
 is  very  well  understood  &  resourced,  but  not  
created  with  drawing
 &  layout
 tools  
like
 PhotoShop  or  Dreamweaver.
 
Whilst  a  designer  can  be  involved  in  the  process,  the  main  build  of  an  app  is  go
ing  
to  require  a  web  developer  who  can  code  HTML  &  CSS  as  well  as  write  JavaScript.  
Knowledge  of  a  number  of  JavaScript  frameworks  such  as  XUI,  GloveBox,  
Lawnchair,  jQTouch,  JQuery  and  so  forth  is  recommended.
 Database  work  will  
require  an  understanding  of
 SQL.
 
No
 
native  code  
knowledge  is  required  
by  the  web  developer  to  compile  &  run  an  
app.  The  ability  to  follow  written  instructions  is  an  advantage.
 
Why  PhoneGap
 
 
 
©
 descartes,  2010  

 
www.
descartes.co.uk
 
-­‐
 +44
 
(0)845  430  9240
 
On  the  desktop
 &  at  home
 
The  web  code  created  can  be  quickly  deployed  to  
Adobe  Air
,  wrapping  it  up  as  an  
ap
p  for  Windows  or  Mac  OS  on  the  desktop.  A  useful  win.
 
Sony  &  Samsung  have  been  shipping  internet  enabled  TV’s  for  two  years  now.  
Google’s  Android  is  free  to  licence  for  use  

 how  long  will  it  be
 before
 apps  for  TVs  
start  to  appear?
 
Games  consoles  may  well  
be  extended  to  run  apps.  You  can  buy  internet  enabled  
fridge/freezers,  
h
ow  soon  before  they  are  app  enabled?
 
 
descartes,  PhoneGap  &  Nitobi
 
descartes  has  been  producing  web  applications  alongside  it’s  desktop  systems  
since  Netscape  0.9  was  released  (1994).
 
Nick  has  participated  in  both  the  introductory  &  advanced  training  that  Nitobi,  
creators  of  PhoneGap,  offer.  He  is  also  active  on  the  PhoneGap  Google  group
,  giving  
&  receiving  support  to  other  community  developers  and  is  in  
frequent
 
contact
 with  
Nitobi  sta
ffers.
 
Our  community  contributions  at  
http://www.schrodinger.net/PhoneGapWebTest/
 is  being  documented  and  
moved  to  its  own  site.
 
As  a  long  standing  Apple  Developer  and  as  an  entrant  in  the  origin
al  Android  app  
competition,  Nick  is  familiar  enough  with  Objective
-­‐
C  (iPhone/iPad/Mac  OS)  and  
Java  (Android)  to  be  able  to  create  plug
-­‐
ins  for  those  platforms.
 
In  theory  descartes  could  tool  up  for  native  code  development  for  iPhone  &  
Android  but  that  woul
d  leave  us  out  in  the  cold  for  other  devices.  PhoneGap  
bridges  that  gap.