Rendering result in desire format making ajax call to local method in Rhomobile

Introduction:
While developing application, we sometimes need to make ajax call to local methods so that we can render the updated data without refreshing the whole page. We can achieve this using RhoMobile. If we need, we can call local method and get the data using JavaScript ajax call and finally render them into the current view without reloading it.

Description:
We can get desired format of output, using the advance use of ‘render’. If we need to render some data in different format like STRING, JSON, XML, following are the different ways to do the job.

Method 1 : Render as String
def get_string
render :string => ‘This is a sample line’
end Continue reading

Advertisements

Capturing And Storing Signature to Rhom In Rhomobile Application

Introduction:- 
Rhomobile has the ability to capture signature using the Signature API. Signature can be captured in two ways,
1. Full Screen Mode
2. Inline Mode
Note : From Rhodes 3.3.3 onwards, the inline mode has been moved on to RhoElement Vs 2 which is a paid version and requires a license to use it.

Description:- 
To use the Signature API, first, we need to add the camera capability in Build.yml,
capabilities:   Camera

Continue reading

Types of Variables in Rhomobile

Variable is a symbol or name that stands for a value. Variables play an important role in computer programming because they enable programmers to write flexible programs. Rather than entering data directly into a program, a programmer can use variables to represent the data. Later, when the program is executed, the variables are replaced with real data. This makes it possible for the same program to process different sets of data.

There are five types of variables supported in Rhomobile. These types of variables are explained below.

Continue reading

A Deep Look Into Camera API of Rhomobile

In this post, we will go through the available methods for Camera API in details using Rhodes. This post will just explain the methods and uses of the Camera API from ruby excluding the rho-element javascript API.

Camera Permission:
In order to use the device camera, we need to get the permission by defining the capabilities in build.yml file.

Continue reading

Capturing Image Using Camera API & Uploading it to Server

In this post, we will see how to capture the image using Camera API and store it to app base path so as to gain permission to later upload it to server. We will see the way to store the details of the image on the rhom ( SQLite database ), then later upload the file to server on the time of sync process.

Capturing Image Using Device Camera:
As described on the previous post, A Deep Look into Camera API of Rhomobile, we need to use take picture method to capture the photo.

Continue reading