" Live as if you were to die tomorrow. Learn as if you were to live forever.. "
- Mahatma Gandhi

How to connect and transfer data between two Bluetooth-equipped Devices using Rhomobile

Posted on November 24th, 2015 by Prangya Das

Prerequisite: —————- Two Bluetooth-enabled device with Bluetooth switched on manually to make the device visible to other devices. Internal Functionality: —————————– Steps we need to follow to make communication between 2 devices using Bluetooth. – Before creating the connection  the two devices need to be paired. – In order to pair the two devices a […]

Seeding Database(Rhom) in RhoMobile-Rhodes

Posted on November 24th, 2015 by Soutom Dhara

Sometimes we need to load some data to internal DB at the time of initializing/Starting of the application.   In below mentioned code I have defined how to insert one admin user’s record to User table. For this we have to write our code ‘initialize‘ method of AppApplication Class. This appApplication class is available in […]

Capturing Signature in Rhomobile Application

Posted on November 24th, 2015 by Ashis Kumar

Introduction: In Rhomobile, we have the ability to capture signature using the Signature API. The signature API opens a full screen view where user draws its signature and then press the use bytton to store it. Description: First of all, on the controller, we need to call the take method ofSignatureCapture API to show the […]

Basic HTTP Authentication while making calls to HTTP services in Rhomobile

Posted on November 24th, 2015 by Ashis Kumar

Server APIs which implement basic HTTP Authentication mechanism need username and password to be sent with each API call. This can be achieved in Rhomobile Ajax call as follows $username = “some@example.com” $password = “password” result = Rho::AsyncHttp.get ( :url => “http://www.yourservice.com/API/getRecords”, :authentication => { :type => :basic, :username => $username, :password => $password } […]

Downloading an image from server using Rhomobile

Posted on November 24th, 2015 by Ashis Kumar

To download a file/image from server, we need to have the actual file/image path stored on the server. For this, we need to call the server to get the path, then we can use the download_file method to get the file downloaded. So below is the code to achieve this target def download_image_from_server # Get […]

Running Rhomobile Application in Browser for Better UI Inspection

Posted on November 24th, 2015 by Ashis Kumar

Introduction: Rhomobile framework allows to use html, javascript and css to develop the application. But inspecting the UI on the simulator is not possible, and in RhoSimuator, its not so powerfull enough. Description: So in Rhomobile, we can make the application run on a particular port and can open that port on local host in […]

Posting Arrays of JSON to Server using Rhomobile AsyncHttp

Posted on November 24th, 2015 by Ashis Kumar

Problem: When using Rhomobile, posting data using AsyncHttp method to server, Rhomobile converts all the data to string while sending them. At times this creates issue during parsing of the data on server side, for which additional code is required to parse the string to object on server side. data = { :searchQuery => “some text” […]

Using Global Variable as Session Variable in Rhomobile

Posted on November 24th, 2015 by Ashis Kumar

In Rhomobile, as we know that global variable can be accessed through out the application, even in the views, we can use them as a session variable. Let’s assume  having a small application with some pages where we need to show the logged in user’s name. So to achieve this, global variable can play a […]

Escaping HTML-unsafe characters in view of RhoMobile

Posted on November 24th, 2015 by Ashis Kumar

Introduction: While using the standard web languages like JavaScript, HTML, CSSwith RhoMobile, sometimes we face some issue with the HTML-unsafe characters. We need to handle them to ensure that they don’t break the desired layout. Description: Using RhoMobile, we can handle the accidental breakage of the layout due to HTML-unsafe characters in view using ERB’s […]

Rendering as JSON for the Ajax call to local methods in Rhomobile

Posted on November 24th, 2015 by Ashis Kumar

Introduction: While developing application, we sometimes need to make ajax calls to local methods so that we can render the update without refresing the whole page. When we do so using RhoMobile and get the data using javascript ajax call, we found that the data is rendered as HTML and the data is wrapped inside […]

Block Screen Orientation in Rhodes App for Blackberry

Posted on November 24th, 2015 by Ashis Kumar

This tip show how to block the screen orientation to specific direction in Rhodes Application for blackberry.   To block the Screen Orientation in blackberry, navigate to the path < Rodes >/platform/bb/rhodes/src/rhomobile/ Now open the RhodesApplication.java and paste this function inside the class ( RhodesApplication ). private void setScreenOrientation(int iDirection){ int thisDirections; switch(iDirection) { case Display.DIRECTION_LANDSCAPE: thisDirections = Display.DIRECTION_LANDSCAPE; […]

Creating Fixed Menu bar in Rhodes Application

Posted on November 24th, 2015 by Ashis Kumar

We can create a fixed menu bar in rhomobile application as like the following : In your ‘application.rb’ , put the follwing code inside ‘initialize’ method @tabs = [                {                   :label      => “Photos”,                   :action    => “/app/Photos”,                   :icon       => “/public/images/photos.png”                },                {                 […]

How to get the Platform Details in Rhodes Application.

Posted on November 24th, 2015 by Ashis Kumar

We can get the platform name by using : System::get_property(‘platform’) It returns string value and these value can be one of the following : ‘APPLE’ , ‘ANDROID’ , ‘Blackberry’ , ‘WP7’ , ‘WINDOWS’ and ‘UNKNOWN’ for others. If we want to get the OS versions, we can do this using: System::get_property(‘os_version’) This returns the os […]

Block Screen Orientation in Rhodes App for Blackberry

Posted on November 24th, 2015 by Ashis Kumar

This tip show how to block the screen orientation to specific direction in Rhodes Application for blackberry.   To block the Screen Orientation in blackberry, navigate to the path < Rodes >/platform/bb/rhodes/src/rhomobile/ Now open the RhodesApplication.java and paste this function inside the class ( RhodesApplication ). private void setScreenOrientation(int iDirection){ int thisDirections; switch(iDirection) { case Display.DIRECTION_LANDSCAPE: thisDirections = Display.DIRECTION_LANDSCAPE; […]

Changing Application Icon for iPhone in Rhodes Application

Posted on November 24th, 2015 by Ashis Kumar

iPhone 4.0 onwards needs three size of icons. They are icon57.png ( 57×57), icon72.png ( 72×72 ) & icon114 ( 114×114 ). We need to put these icons into ‘icon’ folder present inside ‘app’ folder, while building the Application using RhoStudio. If you are building the Application using XCode, then you need to replace the […]

Resolving Background Scrolling Issue Of Modal Popup Vew In Mobile Devices

Posted on November 23rd, 2015 by Ashis Kumar

Problem: While dealing with a scrollable view where a large numbers of data are shown I faced the following issue. When a popup shows above it, the background scrollable view still has focus and can be  scrolled in mobile devices. After much of the research I got the solution and I am sharing it below […]

Creating Fixed Menu bar in Rhodes Application

Posted on November 23rd, 2015 by Ashis Kumar

We can create a fixed menu bar in rhomobile application as like the following : In your ‘application.rb’ , put the follwing code inside ‘initialize’ method @tabs = [ { :label => “Photos”, :action => “/app/Photos”, :icon => “/public/images/photos.png” }, { :label => “Videos”, :action => “/app/Videos”, :icon => “/public/images/videos.png” }, { :label => “About […]

How to get the Platform Details in Rhodes Application

Posted on November 23rd, 2015 by Ashis Kumar

We can get the platform name by using : System::get_property(‘platform’) It returns string value and these value can be one of the following : ‘APPLE’ , ‘ANDROID’ , ‘Blackberry’ , ‘WP7’ , ‘WINDOWS’ and ‘UNKNOWN’ for others. If we want to get the OS versions, we can do this using:   System::get_property(‘os_version’) This returns the […]

Loading data from local file to database(RHOM)

Posted on November 23rd, 2015 by Prangya Das

First create a text file (let’s say data.txt) under the Public folder of the App where to write the sample data in JSON format.. Now write the sample data in the json format in the data.txt as follows. [ {“bookName”: “Learning MySQL”, “bookAuthorName”: “Seyed M.M. (Saied) Tahaghoghi”}, {“bookName”: “PHP Cookbook: Solutions and Examples for PHP […]

Hiding Soft Keyboard When Focus Is On Text Box | Android For Rhomobile

Posted on November 23rd, 2015 by Ashis Kumar

Problem: While developing application using Rhomobile for Android platform, i came across a situation where,  when a user focuses on text fields, soft keyboard pops up, but it overlaps the input field so we can’t see what we are entering. The page also doesn’t scroll so that we can’t manually scroll the page to get […]