RubyMotion Runtime Guide

Object Model

inside-ruby-motion

 

The object model of RubyMotion is based on Objective-C, the underlying language runtime of the iOS and OS X SDK. Objective-C is an object-oriented flavor of C that has been, like Ruby, heavily influenced by the Smalltalk language.

Sharing a common ancestor, the object models of Ruby and Objective-C are conceptually similar. For instance, both languages have the notion of open classes, single inheritance and single dynamic message dispatch.

In RubyMotion, Ruby classes, methods and objects are Objective-C classes, methods and objects respectively. The converse is also true. Objective-C classes, methods and objects are available in Ruby as if they were native.RubyMotion implements the Ruby object model by using the Objective-C runtime, the library that powers the Objective-C language and indirectly, the iOS SDK APIs.

By sharing the same object model infrastructure, Objective-C and RubyMotion APIs can be interchangeable at no additional performance expense.

via RubyMotion Runtime Guide.

Run Android as Kiosk or Single Application Mode

If you are planning to roll out an android application on a tablet for public use. Then running it as a kiosk mode is preferred, we can also call SINGLE APPLICATION MODE.

To achieve it there are couple of ways:

  • Custom build ROM according to your needs. I have not tried my hands over it, as it seems to be time intensive.
  • SureLock from 42gears. It works great but one need to buy License (Single $49.99)
  • Code tweak. It’s not fool proof but can be helpful to run Android in Single Application mode

 

We will talk about “CODE TWEAK” method and guide how to achieve the same. Inside your application code make following changes

Manifest file:

1. Add this to your main activity . This will launch your application when home button is pressed.

<intent-filter>
<action android:name=”android.intent.action.MAIN” />
<category android:name=”android.intent.category.HOME” />
<category android:name=”android.intent.category.DEFAULT” />
</intent-filter>

2. Auto-start your application on Boot by listening to by listening to the android.intent.action.BOOT_COMPLETED. Add this line to your Manifest file

<uses-permission android:name=”android.permission.RECEIVE_BOOT_COMPLETED” />

 

3.  Inside the main Application tag. Add this receiver code like you add a new activity

<receiver android:name=”com.example.android.MyBroastcastReceiver”>
    <intent-filter>
        <action android:name=”android.intent.action.BOOT_COMPLETED” />
    </intent-filter>
</receiver>
 

4. Add a file to your “src/com/example/android/MyBroadcastReceiver.java” and add these lines

package com.example.android;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
 
public class MyBroadcastReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        Intent startServiceIntent = new Intent(context, <MAIN>.class);
        context.startService(startServiceIntent);
    }
}

 

Edit <MAIN> to the activity you wish to auto-boot.

 

5. Reboot your tablet/device and it should run in Auto-Boot  Single application mode. It may prompt for default home option to select between “Launcher” and “Your Application”. Select your application and tick the checkbox to make it default selection.

 

One can now browse only device settings and run your application. To exit and run Android Launcher, go to Settings->apps->your application and “Clear Defaults”. Pressing the home button will again prompt for default  home option select Launcher this time and you can access the Android default launcher. I have tested on Android 4.0.3 and it’s working smooth.

 

Ideas/suggestions are welcome.

No to apache/nginx configs. zero-config Rack server for Mac OS X

Are you developing Rails application from a while? I’d be interested to hear how do you run it locally especially on Mac OS X.

Possible options are:

My preferred choice is phusion passenger for Apache or Nginx and writing VirtualHost config everytime I create a new Rails application. Listen to new port and set the virtual host and restart apache or nginx. Boom. Done.

Else it’s good to start Mongrel or webrick instances if Apache/Nginx is down and it’s up in a minute or when Virtual Host port and configs start becoming confusing.

Recently I got to install POW.CX

Pow is a zero-config Rack server for Mac OS X. Have it serving your apps locally in under a minute.

Install it using

$ curl get.pow.cx | sh

To set up a Rack app, just symlink it into:

$ cd ~/.pow $ ln -s /path/to/myapp

 

That’s it! Your app will be up and running at http://myapp.dev/. See the user’s manual for more information.

Also one can use powder which manages POW and makes easy pow more easier .

https://github.com/Rodreegez/powder

It’s simple, straight and offers Convention over Configuration. No more configs or running mongrel instances to start an application.

How to study and learn from world’s best Teachers and Professors

When I was in college their was always a desire that If I would have been in Stanford or some great university I would have access to world’s best professors and it would have been a different learning experience altogether.

Or

How great it would be if I can study whatever I feel like outside of our course in a systematic way and can learn the fundamentals that help to grow my knowledge, fundamentals or businesses

Education for all

Education for all

Internet is open and google always helps but still felt their is a lack to find the best course material or community for International Students to learn new courses and subjects that interests you. Life is no better and still lakhs of student who passes out every year have very diminished knowledge about what they study. In most part, Indian Universities and Institutions are unable to provide good Professors or teachers to students. It still continues to be like this and “Quality Education” is still far from anyone without any differences. Students are first categorized on basis of their caste, creed, grades and reservation. Economic condition of a family is always a primary concern besides all these factors.

Recently after 4 years of college education and during my visit Bay area and Stanford. I heard about Coursera, founded by Stanford computer science professors Daphne Koller and Andrew Ng ( StanfordDaily ).

About Coursera

We offer high quality courses from the top universities, for free to everyone. We currently host courses from Princeton University, Stanford University, University of California, Berkeley, University of Michigan-Ann Arbor, and University of Pennsylvania. We are changing the face of education globally, and we invite you to join us.

Then I started with more exploration and soon realized some best part of joining these courses. Mind it it’s free

  • Variety of Courses. I can study about anything and take up course of my choice e.g Algorithms, Pharmacology, Finance, Humanitics etc
  • Course taught by World’s best professors and Universities. Seriously it feels great to have access to best profs.
  • Small Video based tutorial. According to me “Small” videos are the key, as it’s easy to concentrate for shorter time and easy to watch as and when time suits you
  • Interactions with like minded people from the globe on the Discussion Forums
  • Format of the Syllabus and weekly assignment keep the clock ticking
  • Content of the course is way too good and easy to understand for anyone.

Last but not the least, now anyone from anywhere in the world can enroll and (re)study without any hesitation in his/her own time.

Heartiest thanks to the Universities and their Teachers and Professors to impart their knowledge to the world from their schedule and thanks to Coursera for providing it for free without any difference to everyone. Period

Note: This is in no way Coursera marketing but genuine feedback from a learning student 🙂

Happy Learning!

Online vs offline commerce: Targeting and Re-targeting your customers

Attended Triggr event today at InstaMedia Noida. It was interesting to hear couple of presentations and thoughts which was majorly focussed on one term “ENGAGEMENT”. I started loving this term especially, as everything revolves around this one simple term. Either your business is online or offline, engagement is involved at first hand once user showed some interest, then comes all other factors. If you succeeds in this engagement, you can turn your business to X folds.

In offline market, you go to shopkeeper to buy something, you showed interest then he starts engaging or recommending things to you, as you might also be interest and we tend to buy most of the times (credibility plays a vital role). If something is unavailable or when you come next time, he remembers what you want, he’ll greet you and engages you more. Now you’ll go to that shopkeeper again and again. Thats how a typical offline businesses run.

offline shopkeeper engagement

Talking in terms of Online context, their is no physical person, companies usually do lot of investment on Suggestions, Recommendations of products if a person shows a interest by saying “people also bought this”, “we recommend you to buy this” etc. to engage the users and converting it into business.

online product recommendations

Their were talks on how to minimize the bounce rates and more user engagement. Some implemented and proven ideas are designing it right way which comprises focusing the social media aspect i.e fb/tw views etc (talk from Slideshare), a/b testing (Paras, http://visualwebsiteoptimizer.com), Multi Variant testing (MVT), landing pages ( I must say unbounce guys have done a fantastic job) to understand what works best in terms of user engagement. Your product should ideally deliver the right message about your product in minimum words and should emphasize on self-talking images and help user talking the action on your page (without confusion). Once done, he will spend time to understand your product(s).

Interesting, met with Nitin Chawdhary, India Head, Tyroo ad network, I really like his presentation on E-Commerce, Engagement and Re-targeting your customers. To explain re-targeting in layman’s terms:

If your customer shows some interest in a product but goes off, next time if you happen to advertise/target him again, about that very specific items he was interested in, there is a high probability that he will buy this time.

According to him, if you re-target your customer around 5-6 times, there are high chances of actual lead conversion. One of the pain points he mentioned in e-commerce is, its very hard to find and target the customer back, once he is gone.

Talking more in terms of offline businesses or online businesses and once you scale re-targeting is hard to achieve, I’m sure technology has its limitations but its achievable on Internet. But re-targeting in physical world is yet missing according to me and in Indian context e.g. If I have an intention to buy a microwave and I go to market and try out couple of stores, how about the store shoots a message back to me (once I left his store) with some offer, to actually convert the lead and the time sales guy invested in explaining the whole Microwave functionality in person. I think enterprises will be interested in these solutions of re-targeting in physical world and simple implementation of this common and complex problem.