Apr 27, 2012

Ad-Hoc distribution - Apple's Best Kept Secret (with Rhomobile)

Ad-Hoc distribution is certainly something which helps you scale the testing of your iOS application with apple letting you broadcast your app for 100 unique devices. But just as everything’s very controlled in an iOS environment, ad-hoc application distribution is bureaucratically confusing- unless we go through apples 500+ pages developers manual.

In this post as my other posts there special mention for Rhomobile apps. In case you’re not creating a rhomobile/Rhodes app plz skipt those steps beginning with Rhodes.

Lets Begin

Step 1 : Before you begin, you must be registered ios developer at developer.apple.com. Also, your developer certificate, distribution certificate should be added in the keychain.

Step 2 : In your apple ios development profile at developer.apple.com make a new provisional profile in distribution and choose ad-hoc in that. Also, select all the devices on which the application will be installed (max upto 100 devices).

Step 3 : Download the same and load it in xcode.

Step 4 : For Rhodes app – You can see all the details of the profile which we will later use in your Rhodes application’s build.yml by clicking organizer in the right side of xcode.

Step 5: For Rhodes app – following details will need to be filled in build.yml. Lets take an example :

  provisionprofile: xx32xx42-Axx1-xxCx-xxxx-xQWxERxTYxxU
  sdk: iphoneos5.0
  codesignidentity: "iPhone Distribution: your company name"
  entitlements: ""
  configuration: Release
  BundleIdentifier: com.companyname.appname
  BundleURLScheme: app_name_type

Now let’s map what is above in these yml settings to what you see in your xcode organizer:

Provisionprofile : this is the Provisional identifier
Sdk : this is just the sdk version
Code signidentiy : add your common name from distribution certificate from keychain.
Entitlements : just leave it blank
Configuration : has to be release for ad-hoc.
Buncleidentifier : you can see this as app identifier but there is a long code before this in organizer u can ignore the long code and simply take com(which is default)[dot]distribution_name[dot]application_name
BundleURL scheme : just name your app

Step 6 : For Rhodes app - Now what lets load your Rhodes application in xcode by following two steps :  http://docs.rhomobile.com/rhodes/build
$ rake switch_app
$ rake build:iphone:setup_xcode_project

This will create a xcode project in the Rhodes source code folder. Which you can see from your build.yml. Navigate to the /platform/iphone folder and open rrhorunner.xcodeproj. This will open your Rhodes application in Xcode.
for more information on ios build with rhomobile, plz check ios build section at Rhomobile Docs.

Step 7 : Create a new configuration in your Project Settings
 I am not describing here how to create info.plist file which is no longer required in case of xcode4, but definetly is necessary for testflight (I’ll try to include that later in this post). Create an Ad Hoc Distribution configuration. Click on your project in the Groups & Files pane and then select your project in the column that shows your project and targets.

If you are not already on the Info screen, click the Info tab. Next click the ‘+’ button and select Duplicate “Release” Configuration.

Give the new configuration a name, preferably ad-hoc so that you remember it :P

Setup 8 : Setting up Target
Select your Target (below your Project), click on code signing identity property and select “don’t code sign”. Also select default iPhone Distribution for Ad-Hoc distribution and iPhone developer for debug, development and release.

Step 9 : Setting up archive scheme
From the drop down menu in your tool bar next to the Run and Stop button, select Edit Scheme. Select Archive in the left pane and then set the Build Configuration to your Ad Hoc Distribution and click OK.

Step 10 : Yes its almost done !
From the top menu select Product and then click archive, your application build will be created.

Step 11 : Create installable ipa and share J.
After build is created successfully, organizer will open automatically to create the IPA file, with the archive highlighted, click the Share button and then confirm the provisioning profile you want to use. If you only have the one distribution provisioning profile it should default to the correct one. Click Next and then give the IPA file a name and save it.

Step 12 : To distribute your .ipa simply attach the file and mail it. Double click the ipa file loads it into itune, sync your itune and your application is installed on your device.

And its done !!!

Jan 10, 2012

BarCode Scanning using Rhodes and RhoElement

Motorola barcode scanning devices are now supported with Rhodes3.3 and RhoElement2.0. Install RhoElements gem or RhoStudio and start developing for Motorola Windows Mobile, Windows CE and Android(ET1).

To enable this feature add following to build.yml:


extensions: ["barcode-moto"] 

Barcode API :

How to get list of scanners present on the device? 


this returns array of hashes (‘name’,‘id’).

How to enables the scanner?
barcode_callback get the same parameters as Barcode.take_barcode

Barcode.enable(url_for(:action => :barcode_callback), {:name=>name_from_enumerate})

Callback parameters?

“status” – “ok” or “cancel”
“barcode” – recognized barcode string

How to disable a currently enabled scanner? 


This reverts the scanner to its default state and flushes any current decoder settings

Performing a soft trigger start? 


If the scan does not result in a decode it is necessary to perform a soft stop before another soft start.

Performs a soft trigger stop ?


Enabling the scanner and start scanner? 
Before callback is called scanner is disabled:

Barcode.take_barcode(url_for(:action => :barcode_callback), {:name=>name_from_enumerate})

source : Rhomobile.com

Nov 11, 2011

Host your website on Google App Engine for free

There are many advantages to host your website using Google app engine, specially if the site traffic is low and if you don't want to spend a single penny to host to your website. Plus you get 1GB of storage for images, files etc etc, and 1GB of bandwidth per day. Above all your app is served through Google's own data center so the reliability is unmatched.

So, lets get started and make your first google appspot application

Step 1: Go to appengine.google.com and create a new application. If you have never used App Engine before, you might be asked to verify your mobile phone number before you can create a new app, unless you dont have  a google account too (which i presume wont be a problem !)

Step 2: Give your application a name – it should be unique and may only include lowercase alphabets and digits. For this example, our app   identifier is “thisismyfirstapp” or "itsthetimetodisco".

Step 3: The next two sub-steps may scare some of you but trust me, they simply require you download and run two installers in the given sequence.

3a. Download and install Python from python.org.
3b. Download and install App Engine SDK from this code.google.com.

Step 4: Download and unzip this file myfirstapp.zip – somewhere on your desktop. It contains a basic website with some HTML pages, images and CSS that we’ll try to host with Google App Engine. You can replace the HTML, CSS and Images with your application stuff. But do not modify the .yaml files, i have modified them a bit from the original google zip files, so that at beginner lever there are no problem to push the application on cloud. If you are a python expert go ahead, play and modify them.

To name your application open the file "app.yaml" in your favorite editor and change the first line "application:" this will be the name of your application hosted on appspot like "wholikestoparty.appspot.com"

Last STEP : Finally it’s time to deploy /upload our website to Google App Engine. Open the Google App Engine Launcher program from the Start Menu, choose File –> Add Existing Application and browse to the folder where you unzipped the website.

Hit the deploy button, input your Google Account credentials and within seconds, your website should become available online at abc.appspot.com where abc is your unique app identifier. Later, if you add or modify any web page, press Deploy again and your new /edited files will get uploaded to App Engine.
Something more : 1. The only disadvantage on a free account at app engine is that you can host max of 10 apps, but then there are no limits to number of google accounts ;)
2. You can also buy your domain name and host using google app engine for free by forwarding and masking your domain i know this can be done easily with godaddy http://bit.ly/vj6JPK

Oct 27, 2011

How to build iPhone application using Rhomobile on Windows

Rhohub & Rhodes from rhomobile is the only solution available for iPhone & iPad application development on Windows PC's.

This quick video explains how to build an iPhone application using rhohub :

Oct 24, 2011

List of some useful gems :)


This is an active post and it will be updated now and then when ever i come forward any interesting gem which is really awesome and helpful. Git-hub looks to me a like a gold mine for developers, and here are some of the treasures :

* Devise: 
  - Devise is a flexible authentication solution for Rails based on Warden.
  - Is Rack based. 
  - Is a complete MVC solution based on Rails engines. 
  - Allows you to have multiple roles (or models/scopes) signed in at the same time.
  - Is based on a modularity concept: use just what you really need. 

  - Sass makes CSS fun again. Sass is an extension of CSS3, adding nested   
    rules, variables, mixins, selector inheritance, and more. It's translated to
    well-formatted, standard CSS using the command line tool or a web    
    framework plugin.  

* Bootstrap
  - Bootstrap is Twitter's toolkit for kickstarting CSS for websites, apps, and  
    more. It includes base CSS styles for typography, forms, buttons, tables, 
    grids, navigation, alerts, and more.

* Tabs on Rails
 - TabsOnRails is a simple Rails plugin for creating tabs and navigation menus. 
   It provides helpers for generating navigation menus with a flexible interface.

* Watir
 - Watir, pronounced water, is an open-source (BSD) family of Ruby libraries for 
    automating web browsers. It supports your app no matter what technology it 
    is developed in. They support Internet Explorer on Windows, Firefox and 
    Chrome on Windows, Mac and Linux and Safari on Mac.  

* Radient
 - Radiant is a no-fluff, open source content management system designed for 
   small teams. It is similar to Textpattern or MovableType, but is a general 
   purpose content management system (not just a blogging engine).