Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Rhomobile Beginner's Guide
Rhomobile Beginner's Guide
Rhomobile Beginner's Guide
Ebook589 pages2 hours

Rhomobile Beginner's Guide

Rating: 0 out of 5 stars

()

Read preview

About this ebook

Part of Packt's Beginner's Guide series, this book is packed full of practical examples and screenshots to make building your application straightforward and fun. Whether you have prior experience of developing mobile applications or this is your first venture, all newcomers to Rhomobile will be able to quickly develop their own mobile application. This book is accessible for people who are completely new to Ruby, though having prior knowledge of it would be a huge advantage.
LanguageEnglish
Release dateJul 26, 2011
ISBN9781849515177
Rhomobile Beginner's Guide

Read more from Abhishek Nalwaya

Related to Rhomobile Beginner's Guide

Related ebooks

Information Technology For You

View More

Related articles

Reviews for Rhomobile Beginner's Guide

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Rhomobile Beginner's Guide - Abhishek Nalwaya

    Table of Contents

    Rhomobile Beginner's Guide

    Credits

    About the Author

    About the Reviewers

    www.PacktPub.com

    Support files, eBooks, discount offers and more

    Why Subscribe?

    Free Access for Packt account holders

    Preface

    What this book covers

    Who this book is for

    Conventions

    Reader feedback

    Customer support

    Downloading the example code

    Errata

    Piracy

    Questions

    1. What is Rhomobile?

    The Rhomobile family

    Rhodes

    RhoSync

    RhoHub

    RhoGallery

    Why Rhomobile is cutting edge

    Which products does Rhomobile support?

    Rhomobile architecture

    Rhodes application

    Rhosync application

    Backend application

    FAQ

    Summary

    2. Installation and Configuration—How to Start off

    Rhomobile installations

    Installing Rhomobile

    Time for action – Installing on Windows

    Time for action – Installing on Linux

    Time for action – Installing on a Mac

    What just happened?

    Device SDK installation

    Blackberry SDK installation

    Which Operating Systems are supported?

    Where to get it from:

    Time for action – Installing Blackberry SDK

    Android SDK installation

    Which Operating Systems are supported?

    Where to get it from:

    Time for action – Installing Android SDK

    iPhone SDK installation

    Which Operating Systems are supported?

    Where to get it from:

    Time for action – Installing iPhone SDK

    Time for action – Configuration

    What just happened?

    Time for action – Installing Development Environments—IDE

    What just happened?

    Summary

    3. Instant Gratification—Create Your First Application

    Let's get started…

    Time for action – Creating an employee application

    What just happened?

    Have a go hero – Exploring the Rhogen command

    Building your first Rhodes application

    Time for action – Build it for different smart phones

    What just happened?

    Navigating the Directory Structure

    Time for action – Creating the model

    What just happened?

    Linking views to the homepage

    Time for action – Linking the employee view to the homepage

    Have a go hero – Exploring url_for

    Digging the MVC in our application

    Model

    Controller

    Views

    Rhodes configuration file—Rhoconfig.txt

    Building a Configuration file—build.yml

    Changing the input style

    Time for action – Editing view

    What just happened?

    Creation of a new page

    Time for action – Creation of the new page

    Summary

    4. Rhom—Playing with the Local Database

    What is ORM?

    Exploring Rhom

    Time for action – Creating a company model

    What just happened?

    Association

    Time for action – Creating an association between employee and company

    What just happened?

    Exploring methods available for Rhom

    Time for action – Filtering record by company and gender

    What just happened?

    Have a go hero – find (*args) Advanced proposal

    How Rhodes stores data

    Property Bag

    Fixed Schema model

    Summary

    5. RhoSync—Synchronizing Your Data

    Generating a RhoSync application

    Time for action – Creating a RhoSync application

    What just happened?

    Have a go hero – Disable the web interface

    RhoSync source adapters

    Time for action – Creating source adapter

    What just happened?

    Configure the Rhodes application to connect to RhoSync

    Time for action – Connecting the Rhodes application to RhoSync

    What just happened?

    Placing data in the Rhodes application from RhoSync

    Time for action – Filling data from RhoSync

    What just happened?

    Connecting to Backend services

    What just happened?

    CRUD operation using RhoSync

    Create

    Update

    Delete

    What just happened?

    Filtering datasets with search

    Time for action – Filtering data with search

    Authentication

    What just happened?

    RhoSync REST API

    Summary

    6. Metadata and Push—Creating Agile Views

    Getting ready for Metadata

    Time for action – Installing the Rhodes translator gem

    What just happened?

    Creating the first view using metadata

    Time for action – Creating an index page

    What just happened?

    Have a go hero

    Getting all the views for company from Metadata

    Understanding the code

    Digging the code for the new page

    Digging the code for the show page

    Digging the code for the edit page

    Metadata validation

    Custom templates

    Push data to your phone

    Set up the Rhodes application for Push

    Push for iOS

    Push for Android

    Push for Blackberry

    Setting up the MDS simulator

    Testing Push in the Web Console

    Summary

    7. Native User Interface—Cosmetics for Your Smart Phones

    Device-specific style

    Time for action – Adding device-specific style

    What Just happened

    Customizing layouts

    Dynamic loading of custom view files based on the current platform

    Standard smart phone CSS/HTML architecture

    pageTitle (

    pageTitle>)

    toolbar (

    toolbar>)

    Toolbar button styles

    Content (

    content>)

    Application menu

    Time for action – Default menu

    What just happened?

    Controller action menu

    Time for action – Creating an action menu

    What just happened?

    Native tab bar

    Time for action – Creating tabs

    What just happened?

    BlackBerry CSS/HTML architecture

    Loading screen

    Time for action – Setting the loading Image

    What just happened?

    Adding transition styles for iPhone/Android

    Time for action – Adding transaction animation

    What just happened?

    Pop Quiz

    Summary

    8. Unit Testing and Logging—Writing Better Code

    Unit testing

    Time for action – Getting ready for testing the Rhodes application

    What just happened?

    Writing your first Rhodes unit test

    Time for action – Writing the first test

    What just happened?

    Testing the RhoSync application

    Time for a Action – Running the default test

    Pop Quiz – Spec

    What just happened?

    Creating the first unit test for the RhoSync application

    Time for action – Creating a unit test for the source adapter

    Query

    Create

    Update

    Delete

    What just happened?

    Have a go hero – Creating a test for the company model

    Logging

    Time for action – Configure logs for the Rhodes application

    What just happened?

    Where to find logs:

    iPhone

    Android

    Blackberry

    Pop quiz- Logging

    See the device log on the device

    RhoError class

    Summary

    9. RhoHub—Deploying to Cloud

    Installation and configuration

    Time for action – Installation and configuration

    What just happened?

    Understanding basic Git

    Creating a RhoHub project

    Time for action – Creating a RhoHub project

    What Just Happened?

    Pop Quiz

    Cloning and committing your Rhodes application

    Time for action – Pushing Rhodes application

    What Just Happened?

    Have a go hero – Commit the code

    Deploying the RhoSync application

    Time for action – Pushing the RhoSync application

    What just happened?

    RhoHub online editor

    Creating builds for different phones from RhoHub

    Time for action – Three steps to build the Rhodes code

    What Just Happened?

    Deploying the RhoSync application to RhoHub

    Time for action – Three steps to deploy RhoSync

    What Just Happened?

    RhoGallery

    Time for action – Creating a gallery

    What just happened?

    Summary

    10. Rhodes power unleashed

    System class

    Time for action – Using the System class

    What just happened?

    Doing more things with System class

    Exit application

    Enable\disable phone sleep

    Managing other applications

    Time for action – Starting other applications

    What just happened?

    PIM contacts

    Time for action – CRUD operations on contacts

    What just happened?

    Have a go hero – CRUD operations for Calendar/Events

    Camera

    Taking a picture

    Choosing a picture from an album

    Time for action – Capturing images

    What just happened ?

    Geolocation

    GeoLocation Ruby class

    Time for action – Adding Geolocation

    What just happened?

    Alerts

    Time for action – Creating alerts

    What Just happend?

    Other device capabilities

    Barcode

    Ringtone manager

    Bluetooth

    BluetoothManager

    BluetoothSession

    Timer

    Summary

    Index

    Rhomobile Beginner's Guide


    Rhomobile Beginner's Guide

    Copyright © 2011 Packt Publishing

    All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

    Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

    Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

    First published: July 2011

    Production Reference: 1180711

    Published by Packt Publishing Ltd.

    32 Lincoln Road

    Olton

    Birmingham, B27 6PA, UK.

    ISBN 978-1-849515-16-0

    www.packtpub.com

    Cover Image by Parag Kadam (<paragvkadam@gmail.com>)

    Credits

    Author

    Abhishek Nalwaya

    Reviewers

    Deepak Vohra

    Brian Moore

    Acquisition Editor

    Sarah Cullington

    Development Editor

    Neha Mallik

    Technical Editors

    Ajay Shanker

    Mohd. Sahil

    Project Coordinator

    Shubhanjan Chatterjee

    Proofreader

    Linda Morris

    Indexer

    Monica Ajmera Mehta

    Graphics

    Geetanjali Sawant

    Production Coordinator

    Melwyn D'sa

    Cover Work

    Melwyn D'sa

    About the Author

    Abhishek Nalwaya is a Ruby, Rhomobile, and Rails enthusiast. He is a regular participant at Ruby/Rails meetups and has taken technical sessions on Rhodes framework within the company and at Ruby meetups. His blog is listed on the official third-party tutorial section at the Rhomobile site.

    He was associated with Tata Consultancy Services and is presently working as an application developer with Column Software Technology. He has worked on many projects providing solutions to Fortune 500 companies using Ruby, Rhodes, and Ruby on Rails.

    I would like to express my gratitude to my family and friends especially Akshat Paul, Manu Singhal, and Anuj Bhargava who saw me through this book, who provided support, talked things over, read, wrote, offered comments, without which conceiving this book wouldn't have been possible.

    Also, I would like to thank Sarah, Kartikey, Shubhanjan, and the PacktPub team who allowed me to quote their remarks and assisted in the editing, proofreading, and design. Writing a book was not my cup of tea but they made this complicated journey effortless.

    About the Reviewers

    Deepak Vora is a consultant and a principal member of the NuBean.com Software Company. Deepak is a Sun Certified Java Programmer and Web Component Developer, and has worked in the fields of XML and Java programming and J2EE for over five years. Deepak is the co-author of the Apress book Pro XML Development with Java Technology and was the technical reviewer for the O'Reilly book WebLogic: The Definitive Guide. Deepak was also the technical reviewer for the Course Technology PTR book Ruby Programming for the Absolute Beginner, and the technical editor for the Manning Publications book Prototype and Scriptaculous in Action. Deepak is also the author of the Packt Publishing book JDBC 4.0 and Oracle JDeveloper for J2EE Development, Processing XML documents with Oracle JDeveloper 11g, and EJB 3.0 Database Persistence with Oracle Fusion Middleware 11g.

    Brian Moore is a Senior Engineer at Rhomobile, father of two, and quintessential hacker. Brian began coding at the age of 12. His early love for everything technological led to a job with Apple shortly after high school. Since that time Brian has worked at a series of start-ups and tech companies taking on interesting technical challenges. Brian has become the technical face of Rhomobile as he leads the Rhodes community in the latest Rhomobile innovation during the Friday webinars. When not guiding the next generation of Rhodes developers or hacking on a new debugger, Brian can be found climbing a hill in a remote Southern California desert in his baja bug.

    www.PacktPub.com

    Support files, eBooks, discount offers and more

    You might want to visit www.PacktPub.com for support files and downloads related to your book.

    Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at for more details.

    At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

    http://PacktLib.PacktPub.com

    Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. 

    Why Subscribe?

    Fully searchable across every book published by Packt

    Copy & paste, print and bookmark content

    On demand and accessible via web browser

    Free Access for Packt account holders

    If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.

    Preface

    The Rhomobile Beginner's guide will speak to every developer's mind, and especially to the technocrats looking for a reliable cross-platform framework encouraging them to explore and try out these wonderful products by Rhomobile. This book guides you step by step to build an enterprise mobile application from scratch, through to deployment.

    What this book covers

    Chapter 1, What is Rhomobile?: In this chapter, we will briefly discuss the various products of Rhomobile and their architecture.

    Chapter 2, Installation and Configuration—How to Set Off: In this chapter, we will learn to install the necessary softwares that are required before developing our mobile application using Rhomobile.

    Chapter 3, Instant Gratification—Create Your First Application: In this chapter, we will create our first application and understand how Rhodes structures the application.

    Chapter 4, Rhom—Playing with the Local Database: In this chapter, we'll explore Rhom, which is an Object-Relational Mapping (ORM) provided by Rhodes and take a look at how it manipulates data in our application. We'll find how ORM manages table relationships in this chapter and also dig into the ORM object life cycle.

    Chapter 5, RhoSync—Synchronizing your data: In this chapter, we will learn about the synchronization framework RhoSync that keeps application data current and available on user's smart phones. We will create a sample RhoSync application and connect with a Rails application to put the current data on the device.

    Chapter 6, Metadata and Push—Creating Agile Views: In this chapter, we will learn about a powerful feature of RhoSync called metadata and also configuring Push messages to the client. We will enhance the application created in the earlier chapter with metadata and Push.

    Chapter 7, Native User Interface—Cosmetics for Your Smart Phones: In this chapter, we will learn about Native User Interface for different phones. We will perform device-specific operations to give a more native look to our application.

    Chapter 8, Unit Testing and Logging—Writing Better Code: In this chapter, we will learn about testing and logging. We will write unit tests for both Rhodes and RhoSync applications. We will also learn to check logs in different devices.

    Chapter 9, RhoHub—Deploying to Cloud: In this chapter, we will host our RhoSync application to RhoHub using Git and learn to create build for our Rhodes application.

    Chapter 10, Rhodes Power Unleashed: In this chapter, we will learn about the Rhodes competence to access device-specific capabilities such as GPS, PIM, camera, System attributes, and many more functionalities.

    Who this book is for

    This book is for developers who are looking to build mobile applications. They may include the ones who are looking for a deep understanding of Rhomobile or they may be completely new to these products.

    Familiarity with HTML, CSS, and Ruby will give you an extra edge but you do not need to be an expert on these topics.

    Conventions

    In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these

    Enjoying the preview?
    Page 1 of 1