Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2...

48
Ges$one Avanzata dell’Informazione Mobile Applica$on Development & Data Management

Transcript of Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2...

Page 1: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Ges$one  Avanzata  dell’Informazione    

Mobile  Applica$on  Development  &  Data  Management  

Page 2: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Mobile  compu$ng  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    2  

}  Mobile  is  no  longer  limited  to  communica$ons  }  Mobile  is  a  force  transforming  our  world  in  an  unprecedented  way  

}  Smartphones  are  reaching  over  4  billion  subscribers  these  days    

}  Smartphone  sales  are  now  outpacing  desktop/laptop  computer  sales  

Page 3: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

}  Handheld  devices  }  Small  handheld  compu$ng  device  

}  Screen  display  with  touch  input  

}  Miniature  or  virtual  keyboard  

}  Less  than  two  pounds  }  Smartphones  and  PDAs  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    3  

Mobile  devices  

}  Tablet  computers  }  Complete  mobile  computer  

}  Larger  than  a  mobile  phone  or  PDA  

}  Virtual  keyboard  

Page 4: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Mobile  devices  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    4  

}  Apple  iPhone  6  

Page 5: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

}  Apple  iPad  Air  2  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    5  

Mobile  devices  

Page 6: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Mobile  devices  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    6  

}  Samsung  Galaxy  S6    

Page 7: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

}  Apple’s  iOS  }  Started  for  iPhone  }  Expanded  to  iPad  }  Current  version:  iOS  8.3  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    7  

Mobile  opera$ng  systems  

Page 8: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

}  Google’s  Android  }  Originally  for  smart  phones  }  Found  on  more  devices  than  any  other  OS  }  Current  version:  Android  5.1  (Lollipop)  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    8  

Mobile  opera$ng  systems  

Page 9: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Mobile  form-­‐factor  (Field  Mobility  2013)  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    9  

Page 10: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Mobile  OS  market  share  (Netmarketshare,  June  2014)  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    10  

Page 11: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Top  Smartphone  OEMs  market  share  (US,  Feb  2014)  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    11  

Page 12: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    12  

Mobile  OS  mobile  traffic  share  (US,  Jan  2014)  

Page 13: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

}  iOS  (Apple  App  Store)  }  1,400,000+  apps  

 

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    13  

}  Advances  in  the  Web  and  mobile  technologies  offer  new  and  exci$ng  applica$ons  and  services  to  users…  

Mobile  Applica$ons  

} Android  (Google  Play)  }  1,500,000+  apps  

Page 14: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Mobile  Applica$ons:  Apps  price  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    14  

Page 15: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

}  Dropbox:  on-­‐line  "cloud  storage"  that  wirelessly  synchronizes  with  you  mobile  devices.    A  great  way  to  transfer  documents  from  you  computer  to  the  mobile  device.  

}  iBooks:  manages  books,  pdf  files,  and  other  text  files  

}  Kindle:  eReader  from  Amazon  }  …  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    15  

Apps  (Document  Management)  

Page 16: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

}  Dic$onary.com  }  Epicurious  Recipes  &  Shopping  List  }  Google  Earth  }  Dragon  Dicta$on:  converts  speech  to  text  }  The  Weather  Channel  }  …  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    16  

Apps  (Reference)  

Page 17: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

}  Google  }  Google  Translate  }  Google  Sky  Map  }  Google  Goggles  }  Google  Earth  }  Google  Docs  }  Google  Maps  }  Google  Body  }  Google  Voice  }  Google  Books  }  …  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    17  

Apps  (Google)  

Page 18: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

}  Facebook  }  Flipboard  }  Twijer  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    18  

Apps  (Social  Networks)  

Page 19: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    19  

Apps  (Games)  

Page 20: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

20  

...but  how  can  such  apps  be  programmed?  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

Page 21: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Na$ve  Development:  iOS  Dev  Center  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    21  

}  hjp://developer.apple.com/devcenter/ios  }  API  reference  documenta$on  }  Guides  }  Tutorials  }  Source  code  examples  }  …  

}  Programming  language:  Objec$ve  C  /  Swim  }  IDE:  Xcode  

}  Complete  developer  toolset  for  crea$ng  Mac,  iPhone,  and  iPad  apps    

}  Includes  iOS  Simulator  and  the  latest  Mac  OS  X  and  iOS  SDKs  

Page 22: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Na$ve  Development:  Android  Developers  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    22  

}  hjp://developer.android.com  }  SDKs  }  Development  guides  }  API  references  }  Sample  code  }  Tutorials  …  

}  Programming  language:  Java  }  IDE:  Eclipse  }  SDK  available  for  Windows,  Mac  OSX,  Linux  

Page 23: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

23  

}  Which  plaoorms  do  you  choose?  }  How  many  codebases  do  you  want  to  (or  even  can  you)  support?  

}  How  long  will  it  take  to  build  na$ve  on  N  plaoorms?  }  How  much  effort  will  be  duplicated?  }  What  if  you  bet  on  the  wrong  plaoorm?  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

Na$ve  Development:  issues  

Page 24: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

24  

Web  Development  is  an  op$on  

}  Mobile  browsers  are  progressing  fast  and  converging  around  WebKit  

}  But  there  are  limita$ons  }  Na$ve  apps  are  inherently  more  capable  than  web  apps  

}  Na$ve  apps  run  faster  and  smoother  on  resource  constrained  devices  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

Page 25: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

25  

Mul$plaoorm  Development:  Titanium  

}  Titanium  is  an  open  source  framework  for  building  na$ve  mobile  (or  desktop)  applica$ons  using  open  web  technologies  (JavaScript  -­‐  op$onally  HTML  and  CSS)  

}  hjp://www.appcelerator.com/  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

}  Open  Source  (Apache  2.0)  

}  Titanium  Plaoorms  }  Desktop:  Win32,  OS  X,  Linux  }  Mobile:  iOS,  Android,  Blackberry,  HTML5  

Page 26: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

26  

Titanium  Architecture  

}  Desktop  is  HTML  focused  

}  Can  use  other  scrip$ng  languages  

}  Mobile:  JavaScript  interpreted  at  run$me  

}  JavaScript  API  >>  na$ve  APIs  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

Page 27: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

27  

Titanium:  Examples  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

Page 28: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

28  

Titanium:  Examples  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

Page 29: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

29  

Titanium:  Examples  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

Page 30: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

30  

Titanium  Fundamentals  }  A  Titanium  applica$on  is  a  JavaScript  program  that  is  interpreted  at  run$me  on  the  device  

}  app.js  defines  the  root  execu$on  context  of  the  app  

}  It  is  not  running  in  a  browser    }  It    uses  the  WebKit  KJS  JavaScript  engine  (iOS)  or  Rhino  (Android/BB)  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

Page 31: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

31  

Titanium  JavaScript  API  

}  Organized  into  logical  namespaces  }  “Titanium”  (or  just  “Ti”  for  short)  is  the  root  namespace  for  all  Titanium  func$onality  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

Page 32: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

32  

Typical  App  Composi$on  

}  A  single  window  or  stack  of  windows  

}  Tab  Group  containing  many  windows  

}  Windows  contain  views  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

Page 33: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

33  

Windows  and  Contexts  }  Windows  are  the  top  level  container  for  Titanium  applica$ons  

}  Applica$ons  usually  consist  of  one  window  or  several  windows  in  a  tab  group  

}  Windows  usually  create  new  execu$on  contexts  }  Execu$on  context  ==  A  unique  JavaScript  symbol  space  }  Such  windows  are  “Heavyweight”  windows  }  Can  also  create  “Lightweight”  windows  (for  apps  that  run  in  a  single  context)  

3

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

Page 34: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

34  

The  View  Hierarchy  

}  Views  are  the  building  blocks  of  Titanium  UIs  }   Specialized  views:  table  views,  image  views,  map  views,  etc.  

}  Views  can  contain  child  views,  which  are  posi$oned  rela$ve  to  the  parent  

}  Layout  Op$ons:  Absolute,  ver$cal,  or  horizontal  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

Page 35: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

35  

Demo:  Hello  World!  

}  Crea$ng  a  mobile  project  }  Mobile  project  structure  }  Edi$ng  code  }  Deploy  to  simulator  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

Page 36: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Demo:  Hello  World!  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    36  

Page 37: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

37  

Hello  World!  (complete  code)    

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

var  tabGroup  =  Titanium.UI.createTabGroup();    var  win1  =  Titanium.UI.createWindow({              =tle:'Hello!',          backgroundColor:'#fff'  });  var  tab1  =  Titanium.UI.createTab({              icon:'KS_nav_views.png',          =tle:'Hello',          window:win1  });  var  label1  =  Titanium.UI.createLabel({  

 color:'#999',    text:'Hello  world!  I  am  Window  1',    font:{fontSize:20,fontFamily:'Helve=ca  Neue'},    textAlign:'center',    width:'auto'  

});  win1.add(label1);    tabGroup.addTab(tab1);      tabGroup.open();  

Paste  and  try!  h#p://pastebin.com/YvwZQSZX  

Page 38: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

38  

Demo:  Kitchen  Sink  

}  Example  Code  }  Living  Reference  Document  }  Demonstrates  API  coverage  

}  hjp://github.com/appcelerator/KitchenSink  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

Page 39: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Demo:  Kitchen  Sink  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    39  

Page 40: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Mobile  Data  Management  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    40  

Cool!  But  what  about  Data  Management  on  mobile  devices?  

   

We  have  good  news!  

Page 41: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Mobile  Data  Management  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    41  

}  In  most  cases,  we  don’t  need  to  learn  new  ways  of  working  with  the  kinds  of  data  we  are  familiar  with  

}  We  can  exploit  our  know-­‐how  for:  }  Rela$onal  Data  management  (SQL,  …)  }  Full-­‐text  management  (regex,  …)  }  XML  Data  (DOM  parsing,  …)  }  …  

Page 42: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Rela$onal  Data  Management:  an  example  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    42  

var  db  =  Ti.Database.open('mydb');    db.execute('CREATE  TABLE  IF  NOT  EXISTS  DATABASETEST    (ID  INTEGER,  NAME  TEXT)');  db.execute('DELETE  FROM  DATABASETEST');  db.execute('INSERT  INTO  DATABASETEST  (ID,  NAME  )  VALUES(?,?)',1,'ISGroup');  db.execute('INSERT  INTO  DATABASETEST  (ID,  NAME  )  VALUES(?,?)',2,'Titanium');    var  rows  =  db.execute('SELECT  *  FROM  DATABASETEST');  var  outputString  ='Database  results:';  while  (rows.isValidRow())  {    outputString  +=  '\nID:  '  +  rows.field(0)  +  

   '  NAME:  '  +  rows.fieldByName('name');    rows.next();  

}  rows.close();    db.close();      //  close  db  when  you're  done  to  save  resources  

Page 43: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    43  

Rela$onal  Data  Management:  an  example  

Page 44: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Full-­‐text  Data  Management:  an  example  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    44  

 var  outputString='Regular  expression  results:';  var  text="[email protected]";  var  paj="([\\w\\.]+)@((\\w+\\.)+(com|it))";  var  result  =  text.match(paj);  outputString  +=  "\n"+result[0];  outputString  +=  "\nName:  "+result[1];  outputString  +=  "\nHost:  "+result[2];  

Page 45: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

XML  Data  Management:  an  example  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    45  

var  readFile  =  Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory,'gamebook.xml');    var  xmlString  =  readFile.read().text;  var  xmlDoc  =  Ti.XML.parseString(xmlString).documentElement;  

     var  desiredSect="2";  var  outputString  ='XML  DOM  parsing  results:';  var  sec=ons  =  xmlDoc.getElementsByTagName("sec=on");  for  (i=0;  i<sec=ons.length;  i++)            {  var  sec=onN  =  sec=ons.item(i);  

 var  num  =  sec=onN.ajributes.getNamedItem("number").nodeValue;    if  (num==desiredSect)        

           {  var  textN  =  sec=onN.getElementsByTagName("text").item(0).text;                    outputString  +=textN;  

           }  }  

Page 46: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

XML  Data  Management:  an  example  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    46  

Page 47: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

47  

Complete  app  code  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    

}  Get  the  full  app.js  code  and  try  it  on  Titanium!  }  It  includes:  

}  Hello  world  page  }  Data  management  demo  

}  DB  Data  management  demo  }  Full-­‐text  data  management  demo  }  XML  DOM  data  management  demo  

}  hjp://pastebin.com/reHA3SbQ  

Page 48: Ges$one’Avanzatadell’Informazione’ · 2018. 2. 12. · Mobile’compung ’ 2 GAvI=’Mobile’Applicaon’Development&’DataManagement! Mobile’isno longer’limited’to’communicaons

Interested  in  Mobile  Applica$on  Development?  

GAvI  -­‐  Mobile  Applica$on  Development  &  Data  Management    48  

}  This  was  just  a  short  overview!  }  ISGroup  has  an  ongoing  agreement  with  Apple  allowing  students  to  freely  access  iOS  Development  resources  }  hjps://developer.apple.com/programs/ios/university/  

 }  If  you  want  more  informa$on  on  developing  mobile  apps  focused  on  data  management  issues,  also  for  possible  theses  and/or  for  different  devices,  or  if  you  want  to  join  the  iOS  program,  don’t  hesitate  to  ask!  }  hjp://www.isgroup.unimo.it/theses  }  [email protected]