Various Layout types in Android

The most commonly used layout classes in android are:

  • FrameLayout – designed to display a stack of child View controls. Multiple view controls can be added to this layout. This can be used to show multiple controls within the same screen space.
  • LinearLayout – designed to display child View controls in a single row or column. This is a very handy layout method for creating forms.
  • RelativeLayout – designed to display child View controls in relation to each other. For instance, you can set a control to be positioned “above” or “below” or “to the left of” or “to the right of” another control, referred to by its unique identifier. You can also align child View controls relative to the parent edges.
  • TableLayout – designed to organize child View controls into rows and columns. Individual View controls are added within each row of the table using a TableRow layout View (which is basically a horizontally oriented LinearLayout) for each row of the table.


    Defining an XML Layout Resource

    The most convenient and maintainable way to design application user interfaces is by creating XML layout resources.  XML layout resources must be stored in the /res/layout project directory (or, in the case of alternative resources, in a specially named sub-directory).


    The following is a simple XML layout resource, a template with a LinearLayout containing a TextView and an ImageView, defined in XML:


    <?xml version=”1.0″ encoding=”utf-8″?>  

    <LinearLayout xmlns:android=””  











           android:textSize=”20dp” />  









           android:id=”@+id/Photo” />  


CCDirector and CCLayer


The CCDirector is the component which takes care of going back and forth between scenes.

The CCDirector is a shared (singleton) object. It knows which scene is currently active, and it handles a stack of scenes to allow things like “scene calls” (pausing a Scene and putting it on hold while another enters, and then returning to the original). The CCDirector is the one who will actually change the CCScene, after a CCLayer has asked for push, replacement or end of the current scene.

The CCDirector is also responsible for initializing OpenGL ES.


A CCLayer has a size of the whole drawable area, and knows how to draw itself. It can be semi transparent (having holes and/or partial transparency in some/all places), allowing to see other layers behind it. Layers are the ones defining appearance and behavior, so most of your programming time will be spent coding CCLayer subclasses that do what you need.
The CCLayer is where you define event handlers. Events are propagated to layers (from front to back) until some layer catches the event and accepts it.
Although some serious apps will require you to define custom CCLayer classes, cocos2d provides a library of useful predefined layers (a simple menu layer: CCMenu, a color layer: CCColorLayer, a multiplexor between other layers: CCMultiplexLayer, and more ).

Layers can contain CCSprite objects, CCLabel objects and even other CCLayer objects as children.

Windows Phone 7 LifeCycle

Launching the Application When the user launches the application for the first time, the application receives the Application_Launching event. In order to provide fast startup response, the application should do little work in this event handler. In particular, it should avoid any web downloads or isolatedStorage (see below) data fetch operations. Once active, it can initialize the state or load any saved state.

Terminating the Application While the application is running, the user may terminate it by navigating out of the application using the back button. At this time, the application will receive the Application_Closing event. In response, the application should perform any cleanup and save the persistent application data to isolatedStorage.

Deactivating the Application and Tombstoning While the application is running, the user can hit the Start button or launch another application via launchers or choosers. The user may launch the browser by clicking on a link in the application.

Similar to an application that is closed, an application that is deactivated is also terminated. However, unlike a closed application, for a deactivated application, the OS stores a record (a tombstone) for the state of the application. This is maintained as part of the application back stack which is used to facilitate navigation using the back button.

In these cases, the application is sent an Application_Deactivated event, at which time the application should save all persistent data to isolatedStorage and all transient data, such as the values of page fields, using PhoneApplicationPage.state.

Reactivating the Application Upon completing the launcher, or the user navigating back into an application using the back button, the application will be reactivated. Upon reactivation, the application will receive the Application_Activated event. Since the application is being reactivated from a tombstone state, the application should load the persistent state data from the isolatedStorage and the transient state data from PhoneApplicationPage.state.


For more details see the official page


An Introduction to android’s new framework component : Fragment

A fragment is a new framework component that allows us to separate distinct elements of an activity into self-contained modules that define their own UI and lifecycle. To create a fragment, we must extend the Fragment class and implement several lifecycle callback methods, similar to an Activity. We can then combine multiple fragments in a single activity to build a multi-pane UI in which each pane manages its own lifecycle and user inputs.

We can also use a fragment without providing a UI and instead use the fragment as a worker for the activity, such as to manage the progress of a download that occurs only while the activity is running.

Features of Fragment:

1. Fragments are self-contained and you can reuse them in multiple activities

2.  Add, remove, replace and animate fragments inside the activity

3.  We can add fragments to a back stack managed by the activity, preserving the state of fragments as they are changed and allowing the user to navigate backward through the different states

4.  By providing alternative layouts, you can mix and match fragments, based on the screen size and orientation

5. Fragments have direct access to their container activity and can contribute items to the activity’s Action Bar


Some Coool Tips n Tricks in Android 2.3 to Assist in Programming


  • Visual cue for scrolling: When you are in a scrollable list (like your Gmail inbox) and you reach the end of the list it shows an orange hue—a visual cue that you can’t scroll anymore.
  • Notification bar icons (Wi-Fi, network coverage bars, etc.): Turn green when you have an uninhibited connection to Google, white when you don’t. Hint: if you’re in a hotel or airport using Wi-Fi, the bars won’t turn green until you launch the browser and get past the captive portal.
  • Voice actions: Tell your phone what to do by pressing the microphone icon next to the search box on the home screen, or long press the magnifying glass. You can tell it to send an email or text message (“send text to mom, see you for pizza at 7”), call someone (“call mom”), navigate somewhere (“navigate to pizza”), or listen to music (“listen to Mamma Mia”).
  • Find things you’ve downloaded from your browser: Your downloads are now neatly collected in a Downloads manager, which you can find in the apps drawer.
  • Turn a Gallery stack into a slideshow: In Gallery, when you are looking at a stack of photos, put two fingers on the stack and spread them. The stack spreads out and the pictures flow from one finger to the other, a moving slideshow that lets you see all of the photos.
  • Walk, don’t drive: Once you’ve gotten directions within Google Maps, click on the walking person icon to get walking directions.
  • Easy text copy/paste from a webpage: To copy/paste from a webpage, long press some text, drag the handles around to select the text you want to copy, and press somewhere in the highlighted region. To paste, simply long press a text entry box and select paste. Gmail is a bit different: you need to go to Menu > More > Select Text.
  • Turn your phone into a Wi-Fi hotspot: Go to Settings > Wireless & Networks > Tethering & Portable Hotspot. (You may have to pay extra for this feature.)
  • Look at Maps in 3D: With the latest release of Google Maps, you can now look at 3D maps. Tilt the map by sliding two fingers vertically up/down the screen, and rotate it by placing two fingers on the map and sliding in a circular motion, e.g., from 12 and 6 o’clock to 3 and 9.
  • Cool shutdown effect: When you put the phone to sleep, you’ll see an animation that resembles an old cathode tube TV turning off.

Keyboard tricks

  • Shift+Key to capitalize a word: In Gingerbread (and supported hardware), you can Shift+Key to capitalize a letter instead of going to a separate all caps keyboard.
  • Auto-complete: The space bar lights up when auto-complete can finish a word.
  • Quick replace: Tap on any previously typed word, then tap on a suggestion to automatically replace it with the suggested word.
  • Easy access to special characters (like numbers, punctuation): Press and hold any key to go to the special character keyboard. You can also press and hold the “,” key for an extensive punctuation keyboard.


  • Angry Birds: Popular game that lets you knock down blocks by slingshotting birds.
  • Astro: Awesome file explorer app. Browse and access the directories on your phone, and take full advantage of its capabilities. Great if you’re a power user.
  • Chrome to Phone: This one is really useful for Chrome users. You can send anything you browse on your computer to your phone. So if you are heading out to a restaurant or party and look up directions on your computer, just click the “send to phone” button (requires Chrome to Phone extension) and that exact page will open on your phone. Same with virtually any webpage.
  • Flash: Install from Android Market to watch Flash videos embedded throughout the web. Runs even better on Gingerbread.
  • Fruit Ninja: A juicy action game that tests your ability to smash flying fruit. A fun time-killer on the bus or train.
  • FXCamera: Popular photo sharing app with slick effects and filters.
  • Google Maps: Use your device as a GPS navigation system with free turn-by-turn voice guidance, and take advantage of other Google Maps features like Street View, Latitude and Places.
  • Instant Heart Rate: Measure your heart rate using your camera.
  • Phoneanlyzr: Track your phone usage: who you text most, call most, average call length distribution, etc.
  • RemoteDroid: Control your computer from your phone. Gives you a mobile wireless mouse and keyboard. Great if you’re using your computer for music or movies.
  • Shazam: Identifies virtually any song you are listening to.
  • SoundHound: Record a snippet of a song and get it identified instantly. You can even hum (if you can carry a tune!).
  • Tango: A free, high-quality video call app that works on both 3G and Wi-Fi. If your device has a front facing camera (e.g., Nexus S), you will love this app.
  • YouTube: New UI. Plus, portrait-mode player, and view comments and drop-down box video information


Sreeprakash N

Sreeprakash N

IT – for Inner Transformation

In his long and eventful career, Sree has seen and known the effects of stress, especially in today’s professional scenario.

After experiencing the effectiveness of The Art of Living workshops, one of the world’s most popular self-development workshops founded by H. H. Sri Sri Ravishankar, Sree decided to create awareness about the same to people from all walks of life.

In the year 1999, Sree became a faculty member for the self-development workshops for The Art of Living. He is the founding member of the ‘Art of Living Kerala Apex Body’, and has been the State Teachers’ Coordinator. Till date, he has successfully conducted hundreds of workshops to participants, including Trivandrum Press Club, IAS officials, professionals and students, to help them re-experience the stress-free way of life.


Mind Interface:

Sree and his team has done several experiments on interfacing mind and real world. How a relaxed mind or a tensed mind can be used to communicate and control has been demonstrated at Schogini. Schogini currently is testing how functional areas of brain could be used, which could be of immense help to people who are bed ridden paralyzed.


Blind Interface:

Sree and his team perfected the first seeing and coloring application for the blind and research in on in the areas where IT has help the challenged.

Sreeprakash Neelakantan, Founder/MD

F​ounder/MD Sreeprakash N, called Sree, is one of India’s most experienced IT professional, who has extensive expertise in hardware & software, from to micro-controllers to mainframe.

Sree’s journey into IT started at the age of 17 when he passed the City and Guilds of London Exam with Credit. In the year 1978, he graduated with honors from the College of Engineering, Trivandrum (CET) in Electrical Engineering with Computer Systems as a special subject.

Starting his career with ORG Systems in Bombay as Customer Engineering Manager, he had the opportunity to look after 8-bit computers to Sperry Univac mainframe at Indian Airlines. Later he was the recipient of a special award from ORG, for his commendable contribution during the ‘Reserve Bank of India Bank Clearing House implementations’ in the early 80s. During the banking computerization in India, he was selected to be a part of the first team that was trained in Paris for MICR check encoding.

Sree’s career took off to yet another high as he joined KLM Royal Dutch Airlines as their Information Technology Manager for Middle East and South Asia. He won the Top Quality Performance Award in 1995; and received the award from Bram F. Steller, then Vice President KLM.

Sree made a deep impact in the efficiency of technology implementations at KLM that resulted in huge cost saving.

Some of Sree’s inventions include:

Flight Load Scanner:

A sales forcasting tool to help optimal filling of flights, this was implemented world wide.

Telex Scanner:

First time, the printer based messaging system was fully automated as a desktop tool, with search etc, in early 80s.

Incident Control/Management System: Highly efficient cell to handle incidents.

In-Flight Questionnaire Remote Data Entry: Cost effective, error free data processing center was setup in Srilanka.

Frequent Flyer Extention FAMP: Family extension high power database management system was added on top of KLM’s frequent flyer programme.

​Flight Hub-Scanner: An efficient tool to optimize connecting times and schedule flights, this was implemented world wide.

As part of his remarkable career, Sree has traveled to more than 30 countries, to implement IT solutions and train IT professionals.

Along with his fast paced career, Sree has also completed the Advanced Software Development Techniques at TIFR/Bombay with distinction. Also, Sree received the Microsoft Certified Solution Developer certification in 1994, and is India’s 5th Zend PHP5 Certified Engineer. Sree is currently pursuing his MBA in International Business and eCommerce, with specialization in Mobile Games.​​

Sree and his team at Schogini Systems experiments with iPhone, Android, Windows Phone and Arduino based applications, in addition to Web and eCommerce on LAMP. Sree is India’s 5th Zend PHP5 Certified Engineer and also, a past Microsoft Certified Solution Developer.

Sree is India’s first Advanced SEO Certified Professional

Sree and Marketing Guru Fabian Lim at the ASEO Workshop Singapore Nov’12.