building mobile apps with rhodes

18
Adam Blum [email protected]

Upload: hinto

Post on 07-Jan-2016

30 views

Category:

Documents


0 download

DESCRIPTION

Building Mobile Apps with Rhodes. Adam Blum [email protected]. The Rhomobile Mission. Mobilize enterprise apps… cost-effectively with a great user experience. provide the high level productivity and portability of web programming - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Building Mobile Apps with Rhodes

Adam [email protected]

Page 2: Building Mobile Apps with Rhodes

The Rhomobile Mission

Mobilize enterprise apps… cost-effectively witha great user experience. -provide the high level productivity and portability of

web programming- with device optimization and offline capability of “native mobile apps”- open source for rapid adoption by developers

Page 3: Building Mobile Apps with Rhodes

Platform Overview

Rhodes “microframework” for building locally

executing natively optimized mobile apps Developers run app generator for their

objects of interest and then edit HTML templates

Contains first mobile Ruby implementation RhoSync

Sync focused on web service data (needed in the age of SaaS)

Page 4: Building Mobile Apps with Rhodes

The Rhodes Microframework• a minimalist Ruby implementation for mobile

devices• a Model-View-Controller "microframework"

that consists of a directory structure and file naming convention. Writing to this framework primarily consists of editing a set of ERB templates for creating HTML to display data

• the RhoSync synchronization engine client• a simple object relational manager (ORM)

called Rhom• a web server which is installed on the mobile

device and runs locally• The RhoGen app generator

Page 5: Building Mobile Apps with Rhodes

Sample Rhodes Apps Rhomobile provides small set of enterprise apps

CRM - subset of SugarCRM’s capabilities: syncing to opportunities, contacts to deviceField service – Siebel field service

third party apps TrailGuide (Basecamp) will release in a couple months small number of vendors will accept GPL license their source will be published on rhohub.com highlight best of breed examples in several verticals: field service/MRO, medical, scientific

Page 6: Building Mobile Apps with Rhodes

Building a Rhodes App

• Get your data (RhoSync)• Generate a sync source• Define your sync source adapter code• Test it from the web page

• Generator your app (RhoGen)• Generate an app (in the Rhodes \apps subdirectory for

now)• Generate a model and scaffold code

• Develop your app (Ruby/HTML editor of choice)• Edit your model controllers• Edit your HTML templates (ERB file)

• Build, test, deploy (development environment for device) • Build your app• Test your app• Make available for download (or post to App Store)

Page 7: Building Mobile Apps with Rhodes

RhoSync Architecture

RhoSync

Server

RhoSync

ServerRhodesruntimeRhodesruntime

your appyour app

other appbackendsother appbackends

SugarCRMSugarCRM

SiebelSiebel

SalesForce

SalesForce

BaseCamp

BaseCamp

SOAP

SOAP

SOAP

REST

REST

Page 8: Building Mobile Apps with Rhodes

Defining a Rhosync Source

Provide a Source Adapter class with• login- authentication code for the backend• query - retrieve or read's objects from the

backend source• sync - take apart these objects and put

them into a "property bag” • create • update• delete• logoff – not always necessary

Page 9: Building Mobile Apps with Rhodes

Generated Source Adapter Class

class <%=name%> < SourceAdapter def initialize(source) super end

def login #TODO: Write some code here end

def query # TODO: write some code here end

def sync # usually the generic base class sync does the job super end

def create(name_value_list) #TODO: write some code here end

def update(name_value_list) #TODO: write some code here end

def delete(name_value_list) #TODO: write some code here if applicable end

def logoff #TODO: write some code here if applicable end

end

Page 10: Building Mobile Apps with Rhodes

Sample Rhosync Source Query

select_fields = ['name','case_number','priority','status','type','description','resolution']

result = client.get_entry_list(session_id,'Cases','','case_number',0,select_fields,'10000',0);

Page 11: Building Mobile Apps with Rhodes

Generate Your App

Generate your app

rhogen app accountapp

Creates

application.rbindex.html

Generate your modelcd accountapprhogen model account http://rhosync.rhohub.com/sources/1 1

name,industry

Createscontroller.rbconfig.rbindex.erbnew.erbedit.erb

Page 12: Building Mobile Apps with Rhodes

Edit A View<form title="Edit Account" class="panel" id="account_edit_form" method="POST"

action="<%=url_for('update')%>"> <fieldset> <input type="hidden" name="id" value="<%[email protected]%>"/> <div class="row"> <label>Name: </label> <input type="text" name="account[name]" value="<%[email protected]%>"/> </div> <div class="row"> <label>Industry: </label> <select name="account[industry]"> <%@industries.each do |i|%> <option value=<%=i%> <%if @account.industry==i%> selected<%end%>><%=i%> </option> <%end%> </select> </div> </fieldset> <input type="submit" value="Update"/>

</form>

Page 13: Building Mobile Apps with Rhodes

Build/Test On Your Favorite Device

Page 14: Building Mobile Apps with Rhodes

Platform Status

• 0.1 operational on iPhone, Windows Mobile and RIM Blackberry today

• Sample apps for SugarCRM and Siebel Field Service

• All open source• github.com/rhomobile• rhomobile.lighthouseapp.com

• 0.2 at end of December• Better build process• Faster sync• Faster startup• Symbian• Settable source (already checked in)• PIM access

Page 15: Building Mobile Apps with Rhodes

0.3 Release

• February 2009– Hosted services (i.e. app hosting site:

http://rhohub.com) – RhoVer - vending machine– Device capabilities service – Android support

Page 16: Building Mobile Apps with Rhodes

Hosted Services

• Registration– Developers – Apps

• Sync– Create – Test

• App Creation– Generate – Edit– Download/upload

• Build and provision– Builds– Vending

Page 17: Building Mobile Apps with Rhodes

17

RhoVer RhoVer DeviceCapDeviceCap

3) User hits vending machine for app with mobile browser

Download app for your Kogan

Agora

Download app for your Kogan

Agora

4) Uses DeviceCap (useragent strings/devices) to send back download link

1) user signs up via desktop browser

5) User downloads runner/app for device

enterpriseapp backend

enterpriseapp backend

2) SMS sent to user with download URL

RhoSyncRhoSync

6) App is running on device

rhohub.com/vending/yourapp

!

rhohub.com/vending/yourapp

!

RhodesRhodes

Your appYour app

Page 18: Building Mobile Apps with Rhodes

Why Rhomobile?

Declarative tag-based approach (web programming) is more productive

Rich client against local data much better than remote web apps

Write it once and it works on all smartphones

Open source from the ground up