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

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 […]

Adding Menu to UInavigationbar

Posted on November 24th, 2015 by Priye Saurabh

Menu Bar is not a custom control But we can design it easily using two UIView ,UIButton and UIlabel. Just on button action we can remove it from superview the one containing list. But generally adding it to navigation bar  is a bit tricky.  General Idea (Menu) We can use  two views one containing one label […]

Retina display issue with layer drawing in iOs

Posted on November 24th, 2015 by Waseem Ahmad

As most of us know 2x images are directly supported by iOs SDK for retina display, but it doesn’t support in case of layer. However, we have got this issue in one of the project where we are drawing image on a layer and images are showing blur.  The main reason behind this is that […]

Removing all characters within HTML tag from a string iOS Development

Posted on November 24th, 2015 by Deepak Vashisht

In many applications , there is a need to retrieve a specific portion of data from a string or to remove a few lines of text present at various places inside a string. This can be performed in various ways. I am taking HTML string and using various method replacing data present within the tag […]

How to make cell height dependent on text length?

Posted on November 24th, 2015 by Waseem Ahmad

Generally, we use cell for displaying the text, sometimes text length may vary like in case of showing details. We face issue how to make cell height dependent on text length? here, I am writing small tip that will help you to determine height of cell depending on text length.   Step #1First fix the […]

How to enable zombie in Xcode 4 and above

Posted on November 24th, 2015 by Vishwanath Vallamkondi

To check memory related issues in iOS applications, in xcode there is an option to enable zombie, which keeps tracks on the memory issues. The below steps explains you about enabling zombie in Xcode 4 and above. 1)   Press command + Alt + R. 2)   A window is opened, goto to Diagnostics Tab. 3)   Select […]

How to take screen shots on any view using code?

Posted on November 24th, 2015 by Waseem Ahmad

Sometimes you need to take screen shots of a current screen (view in iOs). You can use this utility function for this purpose. You need to pass a view need screen shots, and it will return image. Now you can save this image in photo library or share with a client/friends   + (UIImage*) giveScreentshjotsOfView:(UIView*) view […]

How to crop image in iOs?

Posted on November 24th, 2015 by Waseem Ahmad

Some times you need to crop image in perticular size in your App. You can use this utility function for this purpose. + (UIImage*) cropImage:(UIImage*)inImage ofSize:(CGSize)inSize { if (inImage) { CGRect thumbRect = CGRectMake(0, 0, inSize.width, inSize.height); UIGraphicsBeginImageContext(inSize); [inImage drawInRect:thumbRect]; UIImage *thumbImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return thumbImage; } else return nil; }  

NavigationController from Window-Based app via code in iOS 5.0

Posted on November 24th, 2015 by Ratnesh Singh

n iOS 5.0 there  is no Wwindow.Xib file.  Here we create the navigation controller with help  of code without window.xib file. In AppDelegate.m file. We override the method   – (BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; HomeViewController* viewC = [[HomeViewController alloc] initWithNibName:@”HomeViewController” bundle:nil]; UINavigationController* navC = [[UINavigationController alloc] initWithRootViewController:viewC]; [viewC release]; […]

Fetch common and different elements from two arrays without comparing in loops using sets

Posted on November 24th, 2015 by Nidhi Gupta

There is an easy way to fetch common or different elements from two arrays without comparison. You have no need to use loops to compare each element of one array from each and every element of another array. In .h file NSArray _fetchResultsArray; In .m file, We have two arrays, say firstArray and secondArray: Step […]

IsCache to check NSDocumentDirectory FileSize and Disk Size Availability

Posted on November 24th, 2015 by Nidhi Gupta

We can do the caching on the basis of sizes in user-settings. Like user can select an option whether he want to do caching of data in sizes 1 MB, 100 MB, 500 MB, 1GB etc… We can make a check whether the current downloaded data be cached or not on the basis of user […]

How to use local storage feature in PhoneGap application

Posted on November 23rd, 2015 by Sourabha Sahoo

If you want to store a small amount of data locally in the mobile device then local storage feature is a good solution. It acts same as the cookies in web application and  stores the data as key value pair. The data will persists even after we close the application. It will be removed only […]

Set volume of music playing in cross-platform app using Corona

Posted on November 23rd, 2015 by Raju Mahato

Introduction : Using Corona SDK we can play music stream and also set the volume of the music. Description : Lets make a page where we will play music and will set the volume for that. CODE BLOCK : main.lua — Code to hide the status bar display.setStatusBar( display.HiddenStatusBar ) — Give background color to […]

Getting Images from Gallery and SD card in Smartphones using PhoneGap

Posted on November 23rd, 2015 by Sourabha Sahoo

If you want to get the images from device gallery or SD card, Phonegap can help you to do it by using the following method. 1.Include the Phonegap/Cordova javascript file inside your html page. 2.Create a function to get the images from specified source like Gallery or SD card. function getImage() { navigator.camera.getPicture(onSuccess, onFailure, { […]

Resolving Archive Error for Phonegap 2.9.0 with XCode 4.6

Posted on November 23rd, 2015 by Ashis Kumar

Introduction: Archiving application for the release with PhoneGap 2.9.0 in XCode 4.6.3 got failed with some File Not Found Error for libCordova.a. Description: While using PhoneGap 2.9.0 to develop an application for IOS Platform,I came across a strange issue. The developed application is working perfectly in simulator as well as debug fine in IOS device. […]

Transferring Documents From One Application To Another In iOS

Posted on November 23rd, 2015 by Divya Arora

If our app is capable of opening specific types of files, say pdf files by loading their content in a webView and if we want the pdf files in the device ( say as an attachment in email ) to be opened in our app, then we must register that support with the system. This […]

Faster iPhone/iPad data synchronization with Filemaker

Posted on November 23rd, 2015 by Shibasis Nayak

iOS devices allows flexibility to access Filemaker applications via ‘Filemaker Go’.With Filemaker Go,we can access filemaker solutions hosted on remote servers or we can access local solutions on the iOS devices, and synchronize the data with the hosted applications. When we are the adopting the later option(ofcourse, for faster usage),care should be taken to maintain […]

How To Add Dividers/Markers While Coding In Swift Language

Posted on November 23rd, 2015 by Waseem Ahmad

Unlike Objective-C where we are using #pragma mark for code organisation in the Jump Bar, in Xcode 6 using Swift we can use //MARK for the same purpose. Here is an example: // Objective-C #pragma mark – #pragma mark Action // Swift // MARK:- Action Some other useful markers in Swift are: FIXME and TODO. […]

Getting Screen Height And Width Using Titanium In Android/iOS Devices

Posted on November 23rd, 2015 by Sourabha Sahoo

You might need to find the screen width and height of Andriod/iOS devices to make your application compatible in different sizes of screen. So by using the following lines of code you can fetch the screen height and width of Android/iOS devices with Titanium. //fetch the height of the screen var screenHeight = Ti.Platform.displayCaps.platformHeight; //fetch […]

Alternating Color of Each Row in TableView Using Titanium

Posted on November 23rd, 2015 by Raju Mahato

If we need to show data in row format, usually we use TableView in Titanium to build crossplatform application where we some time give alternate row color to each row. Here is code snippet to describing the scenario. Code Block : //Define the current window var currentWin = Ti.UI.currentWindow; //Array variable having row data var […]

Get Number of Rows of a TableView in Crossplatform App Using Titanium

Posted on November 23rd, 2015 by Raju Mahato

Its very common for a developer to deal with table and its rows and to know about the number of rows present in the table. I have often faced problems related to this. Finally I got the solution which is described below. CODE BLOCK : //Define current window var currentWin = Ti.UI.currentWindow; //Define table view var dataTable = […]

Use Slider As A Progress Bar In Crossplatform App Using Titanium

Posted on November 23rd, 2015 by Raju Mahato

Here is a trick to use slider as progressbar described below. CODE BLOCK : //Define current window var currentWin = Ti.UI.currentWindow; //Define a button to strat the progress var stratBtn = Ti.UI.createButton({ width : 200, height : 50, title : ‘Strat Progress’, top : 300 }); //Button added to window currentWin.add(stratBtn); //Define a slider var […]

Display Delete Button On A Row While Swiping That Row In A Tableview Using Titanium

Posted on November 23rd, 2015 by Raju Mahato

Most of the times, we show item list in a tableview and it is also a common scenario for a developer to  need to edit/delete/update a row on click of that row. Here is a trick describing how to display a delete button when we swipe that row. . //Define current window var currentWin = Ti.UI.currentWindow; //Define rows for a tableview […]

Identifying File Type When Downloading It In Titanium

Posted on November 23rd, 2015 by Raju Mahato

While working with file downloading I came across a situation  where I didn’t know the file type that I am going to download but I have to take some action depending on the downloaded file type. So here is the quick tip to know the file type before saving it to a directory after downloading. […]

Carousel menu in iOS using Titanium

Posted on November 23rd, 2015 by Raju Mahato

Some times we need to make attractive menu in our application. Carousel is one of the popular type. Here is a technique to make menu similar to carousel. Let assume the images representing the menu items are stored in images folder. CODE BLOCK : //Define the current window var currentWin = Ti.UI.currentWindow; //define the resources directory […]

Vertical Slider in IOS app using Titanium

Posted on November 23rd, 2015 by Raju Mahato

Introduction :    Slider is a very common UI control used to select some value from a given range. And also we can use it to display a value with in a given range of values. So it is very common to those scenario. Description :   Generally slider is displayed in horizontal layout, where […]

To fetch common and different elements from two arrays without comparing in loops using sets.

Posted on November 23rd, 2015 by Nidhi Gupta

There is an easy way to fetch common or different elements from two arrays without comparison. You have no need to use loops to compare each element of one array from each and every element of another array. In .h file NSArray _fetchResultsArray;   In .m file, We have two arrays, say firstArray and secondArray: […]

Making A Smooth Scroll View For Android & iOS in HTML

Posted on November 23rd, 2015 by Ashis Kumar

Problem: Scroll view achieved using CSS overflow scroll property for android & ios devices are never that smooth as they are in the native way. Solution: So, to achieve that smoothness, we need to use CSS positioning property as well as css3 -webkit-overflow-scrolling property. let’s see how we can achieve this. For iOs & Android […]