SlideShare uma empresa Scribd logo
1 de 35
Baixar para ler offline
Rhodes and PhoneGap


            Makoto Inoue
   London Android User Group - July



                                      new bamboo
Me

• http://twitter.com/makoto_inoue
• http://github.com/makoto
• http://rubyonmobile.wordpress.com
• http://inouemak.wordpress.com/
• http://d.hatena.ne.jp/makotoi/ (    )


                                          new bamboo
Me
• Ruby On Rails > 3 years
• New Bamboo > 1 year
• Java == 0 month
• Rhodes experience > 7 months
• PhoneGap experience < 1 month
• This slide > 3 months
                                  new bamboo
Topics
• Basic concept
• Rhodes
• PhoneGap
• More Info


                       new bamboo
Basic Concept



                new bamboo
Why cross platform
 development ?



                     new bamboo
http://rubyonmobile.wordpress.com/2009/04/10/questions-to-rhodes-developers/

                                                                          new bamboo
Write once, Run anywhere



                     new bamboo
Sounds familiar .......???




                         new bamboo
It’s framework that matters




                        new bamboo
Rhodes & Phone Gap


• HTML/CSS/Javascript for UI
• With Local device capabilities


                                   new bamboo
Rhodes



         new bamboo
How does Rhodes work?
• MVC => Model on Web(RhoSync as Rails
  app) and VC on Device (Rhodes)

• Ruby(XRuby for Android) for business
  logic and data access

• Generates HTML via Erb (Embedded Ruby)
• ORM => Key&value pair(Rhom)


                                         new bamboo
Architecture




http://rhomobile.com/products


                                new bamboo
Sample
                       Code

     http://github.com/makoto/rhodes-twitter/tree/master
http://github.com/makoto/rhosync-twitter-adapter/tree/master


                                                       new bamboo
Model(Rhosync)




                 new bamboo
Model(Rhosync)
class PublicTimeline < SourceAdapter

  include RestAPIHelpers

  def initialize(source, credential = nil)
    super
  end

  def query
    log "#{self.class} query"
    log @source.url.inspect

    uri = URI.parse(@source.url)
    res = Net::HTTP.start(uri.host, uri.port) {|http|
      http.get("/statuses/public_timeline.xml")
    }
    xml_data = XmlSimple.xml_in(res.body);
    @result = xml_data["status"]
  end




                                                        new bamboo
View
<ul id="PublicTimeLines" title="PublicTimeLines">
<%@PublicTimeLines.each do |x|%>

<li class ="row">
  <div class ="photo">
    <img src=<%= escape x.user_profile_image_url %> alt=<%= escape x.user_screen_name %> />
  </div>
  <div class ="status">
    <div class ="text">
      <%= escape x.text %>
    </div>
    <div class ="user">
      <%= escape x.user_name %> <%= parse_time x.created_at %> via <%= escape x.source %>
    </div>
  </div>
</li>
<%end%>
</ul>




                                                                                   new bamboo
Controller&ORM(Rhodes)




                     new bamboo
PhoneGap



           new bamboo
How does PhoneGap
  work(for Android)?

• Very thin layer on top of skeleton project
  •   appView.setJavaScriptEnabled

  •   appView. addJavascriptInterface(gap, "Device");

  •   appView.loadUrl(this.uri)




                                                    new bamboo
Source - DroidGap.java

public class DroidGap extends Activity {

 private static final String LOG_TAG = "DroidGap";
 private WebView appView;
 private String uri;

   /** Called when the activity is first created. */
 @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main);
       appView = (WebView) findViewById(R.id.appView);
       appView.setWebChromeClient(new GapClient(this));
       appView.getSettings().setJavaScriptEnabled(true);
       appView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
       bindBrowser(appView);




                                                                               new bamboo
Source - DroidGap.java



private void bindBrowser(WebView appView)
{
  // The PhoneGap class handles the Notification and Android Specific crap
  PhoneGap gap = new PhoneGap(this, appView);
  GeoBroker geo = new GeoBroker(appView, this);
  AccelListener accel = new AccelListener(this, appView);
  // This creates the new javascript interfaces for PhoneGap
  appView.addJavascriptInterface(gap, "Device");
  appView.addJavascriptInterface(geo, "Geo");
  appView.addJavascriptInterface(accel, "Accel");
}




                                                                        new bamboo
Source - PhoneGap.java

public class PhoneGap{

 private static final String LOG_TAG = "PhoneGap";
 /*
  * UUID, version and availability
  */

 ....

 public void beep(long pattern)
 {
   RingtoneManager beeper = new RingtoneManager(mCtx);
   Uri ringtone = beeper.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
   Ringtone notification = beeper.getRingtone(mCtx, ringtone);
   notification.play();
 }




                                                                             new bamboo
Source - phonegap.js




Notification.prototype.beep = function(count, volume)
{
  Device.beep(count);
}




                                                        new bamboo
Sample - index.html




                      new bamboo
More about Java & JS bridge
at “Hello, Android” Chapter 7.3




                                  new bamboo
More Info



            new bamboo
Before you jump in...




                        new bamboo
Be aware of....
•   GPL (Some Javascript libraries)

•   Dual License (Rhodes)

•   Some app getting rejected (PhoneGap)

•   Browser & Device compatibility issues




                                            new bamboo
Jump in




          new bamboo
More Info(Rhodes)

•   Screencast http://www.youtube.com/rhomobile

•   Rhomobile web site http://rhomobile.com

•   Google group http://groups.google.com/group/rhomobile

•   My blog http://rubyonmobile.wordpress.org

•   Apps on Market http://rhomobile.com/customers



                                                            new bamboo
More Info(PhoneGap)

•   web site http://phonegap.com/

•   Google group http://groups.google.com/group/phonegap

•   Screencast http://tinyurl.com/nl3bvx

•   Apps on market http://phonegap.com/projects




                                                           new bamboo
Flickr images
•   http://www.flickr.com/photos/tizianoj/355266615/

•   http://www.flickr.com/photos/mloughran/2680464737/

•   http://www.flickr.com/photos/hartsock/2037729243/

•   http://www.flickr.com/photos/roundamerica/3063799062/

•   http://www.flickr.com/photos/rehvonwald/217658854/

•   http://www.flickr.com/photos/renata_motta/2845282904/



                                                       new bamboo
Questions?




             new bamboo

Mais conteúdo relacionado

Destaque

Node Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup SlidesNode Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup SlidesMakoto Inoue
 
Tribus do frio norte
Tribus do frio norteTribus do frio norte
Tribus do frio norteoclubdasideas
 
Sinsai info-rubykaigi
Sinsai info-rubykaigiSinsai info-rubykaigi
Sinsai info-rubykaigiMakoto Inoue
 
Benkyo player dnle2
Benkyo player dnle2Benkyo player dnle2
Benkyo player dnle2Makoto Inoue
 
Primeiro foi o mar, despois a pedra
Primeiro foi o mar, despois a pedraPrimeiro foi o mar, despois a pedra
Primeiro foi o mar, despois a pedraoclubdasideas
 
Adiós ríos, adiós fontes
Adiós ríos, adiós fontes   Adiós ríos, adiós fontes
Adiós ríos, adiós fontes oclubdasideas
 
Sinsai info-makoto-draft-1
Sinsai info-makoto-draft-1Sinsai info-makoto-draft-1
Sinsai info-makoto-draft-1Makoto Inoue
 
Video learningtech
Video learningtechVideo learningtech
Video learningtechMakoto Inoue
 
Data viz as_interface_makoto_inoue
Data viz as_interface_makoto_inoueData viz as_interface_makoto_inoue
Data viz as_interface_makoto_inoueMakoto Inoue
 
Data viz as interface #ignitelondon7
Data viz as interface #ignitelondon7Data viz as interface #ignitelondon7
Data viz as interface #ignitelondon7Makoto Inoue
 
Os dez mandamentos verdes
Os dez mandamentos verdesOs dez mandamentos verdes
Os dez mandamentos verdesoclubdasideas
 
Tantas cousas que dicirte
Tantas cousas que dicirteTantas cousas que dicirte
Tantas cousas que dicirteoclubdasideas
 
Que hermosa te deu Dios, terra querida
Que hermosa te deu Dios, terra queridaQue hermosa te deu Dios, terra querida
Que hermosa te deu Dios, terra queridaoclubdasideas
 
Carta do xefe indio Seattle
Carta do xefe indio SeattleCarta do xefe indio Seattle
Carta do xefe indio Seattleoclubdasideas
 

Destaque (20)

Node Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup SlidesNode Js Websocket Js Meetup Slides
Node Js Websocket Js Meetup Slides
 
Tribus do frio norte
Tribus do frio norteTribus do frio norte
Tribus do frio norte
 
euruko
eurukoeuruko
euruko
 
Sinsai info-rubykaigi
Sinsai info-rubykaigiSinsai info-rubykaigi
Sinsai info-rubykaigi
 
Benkyo player dnle2
Benkyo player dnle2Benkyo player dnle2
Benkyo player dnle2
 
Maria Mariño
Maria MariñoMaria Mariño
Maria Mariño
 
Memento Homo
Memento HomoMemento Homo
Memento Homo
 
Entre o si e o non
Entre o si e o nonEntre o si e o non
Entre o si e o non
 
Primeiro foi o mar, despois a pedra
Primeiro foi o mar, despois a pedraPrimeiro foi o mar, despois a pedra
Primeiro foi o mar, despois a pedra
 
Arco Da Vella
Arco Da VellaArco Da Vella
Arco Da Vella
 
Adiós ríos, adiós fontes
Adiós ríos, adiós fontes   Adiós ríos, adiós fontes
Adiós ríos, adiós fontes
 
StepUp 4pt5
StepUp 4pt5StepUp 4pt5
StepUp 4pt5
 
Sinsai info-makoto-draft-1
Sinsai info-makoto-draft-1Sinsai info-makoto-draft-1
Sinsai info-makoto-draft-1
 
Video learningtech
Video learningtechVideo learningtech
Video learningtech
 
Data viz as_interface_makoto_inoue
Data viz as_interface_makoto_inoueData viz as_interface_makoto_inoue
Data viz as_interface_makoto_inoue
 
Data viz as interface #ignitelondon7
Data viz as interface #ignitelondon7Data viz as interface #ignitelondon7
Data viz as interface #ignitelondon7
 
Os dez mandamentos verdes
Os dez mandamentos verdesOs dez mandamentos verdes
Os dez mandamentos verdes
 
Tantas cousas que dicirte
Tantas cousas que dicirteTantas cousas que dicirte
Tantas cousas que dicirte
 
Que hermosa te deu Dios, terra querida
Que hermosa te deu Dios, terra queridaQue hermosa te deu Dios, terra querida
Que hermosa te deu Dios, terra querida
 
Carta do xefe indio Seattle
Carta do xefe indio SeattleCarta do xefe indio Seattle
Carta do xefe indio Seattle
 

Semelhante a Rhodes And Phone Gap

JRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the CloudJRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the CloudHiro Asari
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGuillaume Laforge
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...Guillaume Laforge
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGapRamesh Nair
 
IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009Christopher Judd
 
Intro To Django
Intro To DjangoIntro To Django
Intro To DjangoUdi Bauman
 
PhoneGap_Javakuche0612
PhoneGap_Javakuche0612PhoneGap_Javakuche0612
PhoneGap_Javakuche0612Yuhei Miyazato
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Pierre Joye
 
2018 (codeone) Graal VM and MicroProfile a polyglot microservices solution [d...
2018 (codeone) Graal VM and MicroProfile a polyglot microservices solution [d...2018 (codeone) Graal VM and MicroProfile a polyglot microservices solution [d...
2018 (codeone) Graal VM and MicroProfile a polyglot microservices solution [d...César Hernández
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Matt Raible
 
GraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices SolutionGraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices SolutionRoberto Cortez
 
Palm Developer Day PhoneGap
Palm Developer Day PhoneGap Palm Developer Day PhoneGap
Palm Developer Day PhoneGap Brian LeRoux
 
Intro To Node.js
Intro To Node.jsIntro To Node.js
Intro To Node.jsChris Cowan
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Matt Raible
 
1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb1.6 米嘉 gobuildweb
1.6 米嘉 gobuildwebLeo Zhou
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.WO Community
 
PhoneGap talk from Singapore
PhoneGap talk from SingaporePhoneGap talk from Singapore
PhoneGap talk from SingaporeSteve Gill
 

Semelhante a Rhodes And Phone Gap (20)

JRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the CloudJRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the Cloud
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
 
Txjs
TxjsTxjs
Txjs
 
Introduction to PhoneGap
Introduction to PhoneGapIntroduction to PhoneGap
Introduction to PhoneGap
 
IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009
 
Intro To Django
Intro To DjangoIntro To Django
Intro To Django
 
PhoneGap_Javakuche0612
PhoneGap_Javakuche0612PhoneGap_Javakuche0612
PhoneGap_Javakuche0612
 
Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18Webdevcon Keynote hh-2012-09-18
Webdevcon Keynote hh-2012-09-18
 
2018 (codeone) Graal VM and MicroProfile a polyglot microservices solution [d...
2018 (codeone) Graal VM and MicroProfile a polyglot microservices solution [d...2018 (codeone) Graal VM and MicroProfile a polyglot microservices solution [d...
2018 (codeone) Graal VM and MicroProfile a polyglot microservices solution [d...
 
Mobile native-hacks
Mobile native-hacksMobile native-hacks
Mobile native-hacks
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
 
GraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices SolutionGraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices Solution
 
Palm Developer Day PhoneGap
Palm Developer Day PhoneGap Palm Developer Day PhoneGap
Palm Developer Day PhoneGap
 
Intro To Node.js
Intro To Node.jsIntro To Node.js
Intro To Node.js
 
uMobile Development Strategies
uMobile Development StrategiesuMobile Development Strategies
uMobile Development Strategies
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
 
1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
 
PhoneGap talk from Singapore
PhoneGap talk from SingaporePhoneGap talk from Singapore
PhoneGap talk from Singapore
 

Mais de Makoto Inoue

Programming 101 w_storify_api
Programming 101 w_storify_apiProgramming 101 w_storify_api
Programming 101 w_storify_apiMakoto Inoue
 
Programming 101 w_storify_api
Programming 101 w_storify_apiProgramming 101 w_storify_api
Programming 101 w_storify_apiMakoto Inoue
 

Mais de Makoto Inoue (6)

StepUpYouTuber
StepUpYouTuberStepUpYouTuber
StepUpYouTuber
 
Programming 101 w_storify_api
Programming 101 w_storify_apiProgramming 101 w_storify_api
Programming 101 w_storify_api
 
Programming 101 w_storify_api
Programming 101 w_storify_apiProgramming 101 w_storify_api
Programming 101 w_storify_api
 
Sinsai devnest
Sinsai devnestSinsai devnest
Sinsai devnest
 
euruko2
euruko2euruko2
euruko2
 
Ruby and japanese
Ruby and japaneseRuby and japanese
Ruby and japanese
 

Último

Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataSafe Software
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.francesco barbera
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdfJamie (Taka) Wang
 

Último (20)

Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
 

Rhodes And Phone Gap

  • 1. Rhodes and PhoneGap Makoto Inoue London Android User Group - July new bamboo
  • 2. Me • http://twitter.com/makoto_inoue • http://github.com/makoto • http://rubyonmobile.wordpress.com • http://inouemak.wordpress.com/ • http://d.hatena.ne.jp/makotoi/ ( ) new bamboo
  • 3. Me • Ruby On Rails > 3 years • New Bamboo > 1 year • Java == 0 month • Rhodes experience > 7 months • PhoneGap experience < 1 month • This slide > 3 months new bamboo
  • 4. Topics • Basic concept • Rhodes • PhoneGap • More Info new bamboo
  • 5. Basic Concept new bamboo
  • 6. Why cross platform development ? new bamboo
  • 8. Write once, Run anywhere new bamboo
  • 10. It’s framework that matters new bamboo
  • 11. Rhodes & Phone Gap • HTML/CSS/Javascript for UI • With Local device capabilities new bamboo
  • 12. Rhodes new bamboo
  • 13. How does Rhodes work? • MVC => Model on Web(RhoSync as Rails app) and VC on Device (Rhodes) • Ruby(XRuby for Android) for business logic and data access • Generates HTML via Erb (Embedded Ruby) • ORM => Key&value pair(Rhom) new bamboo
  • 15. Sample Code http://github.com/makoto/rhodes-twitter/tree/master http://github.com/makoto/rhosync-twitter-adapter/tree/master new bamboo
  • 16. Model(Rhosync) new bamboo
  • 17. Model(Rhosync) class PublicTimeline < SourceAdapter include RestAPIHelpers def initialize(source, credential = nil) super end def query log "#{self.class} query" log @source.url.inspect uri = URI.parse(@source.url) res = Net::HTTP.start(uri.host, uri.port) {|http| http.get("/statuses/public_timeline.xml") } xml_data = XmlSimple.xml_in(res.body); @result = xml_data["status"] end new bamboo
  • 18. View <ul id="PublicTimeLines" title="PublicTimeLines"> <%@PublicTimeLines.each do |x|%> <li class ="row"> <div class ="photo"> <img src=<%= escape x.user_profile_image_url %> alt=<%= escape x.user_screen_name %> /> </div> <div class ="status"> <div class ="text"> <%= escape x.text %> </div> <div class ="user"> <%= escape x.user_name %> <%= parse_time x.created_at %> via <%= escape x.source %> </div> </div> </li> <%end%> </ul> new bamboo
  • 20. PhoneGap new bamboo
  • 21. How does PhoneGap work(for Android)? • Very thin layer on top of skeleton project • appView.setJavaScriptEnabled • appView. addJavascriptInterface(gap, "Device"); • appView.loadUrl(this.uri) new bamboo
  • 22. Source - DroidGap.java public class DroidGap extends Activity { private static final String LOG_TAG = "DroidGap"; private WebView appView; private String uri; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); appView = (WebView) findViewById(R.id.appView); appView.setWebChromeClient(new GapClient(this)); appView.getSettings().setJavaScriptEnabled(true); appView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); bindBrowser(appView); new bamboo
  • 23. Source - DroidGap.java private void bindBrowser(WebView appView) { // The PhoneGap class handles the Notification and Android Specific crap PhoneGap gap = new PhoneGap(this, appView); GeoBroker geo = new GeoBroker(appView, this); AccelListener accel = new AccelListener(this, appView); // This creates the new javascript interfaces for PhoneGap appView.addJavascriptInterface(gap, "Device"); appView.addJavascriptInterface(geo, "Geo"); appView.addJavascriptInterface(accel, "Accel"); } new bamboo
  • 24. Source - PhoneGap.java public class PhoneGap{ private static final String LOG_TAG = "PhoneGap"; /* * UUID, version and availability */ .... public void beep(long pattern) { RingtoneManager beeper = new RingtoneManager(mCtx); Uri ringtone = beeper.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); Ringtone notification = beeper.getRingtone(mCtx, ringtone); notification.play(); } new bamboo
  • 25. Source - phonegap.js Notification.prototype.beep = function(count, volume) { Device.beep(count); } new bamboo
  • 26. Sample - index.html new bamboo
  • 27. More about Java & JS bridge at “Hello, Android” Chapter 7.3 new bamboo
  • 28. More Info new bamboo
  • 29. Before you jump in... new bamboo
  • 30. Be aware of.... • GPL (Some Javascript libraries) • Dual License (Rhodes) • Some app getting rejected (PhoneGap) • Browser & Device compatibility issues new bamboo
  • 31. Jump in new bamboo
  • 32. More Info(Rhodes) • Screencast http://www.youtube.com/rhomobile • Rhomobile web site http://rhomobile.com • Google group http://groups.google.com/group/rhomobile • My blog http://rubyonmobile.wordpress.org • Apps on Market http://rhomobile.com/customers new bamboo
  • 33. More Info(PhoneGap) • web site http://phonegap.com/ • Google group http://groups.google.com/group/phonegap • Screencast http://tinyurl.com/nl3bvx • Apps on market http://phonegap.com/projects new bamboo
  • 34. Flickr images • http://www.flickr.com/photos/tizianoj/355266615/ • http://www.flickr.com/photos/mloughran/2680464737/ • http://www.flickr.com/photos/hartsock/2037729243/ • http://www.flickr.com/photos/roundamerica/3063799062/ • http://www.flickr.com/photos/rehvonwald/217658854/ • http://www.flickr.com/photos/renata_motta/2845282904/ new bamboo
  • 35. Questions? new bamboo