Android Basics – Run your App on your Android Phone

Time to run your App on the Mobile Device. I have provided the Steps, Screenshots and a Video to help you with this.

You can refer to the Images and the Video to get your App up and running on your Mobile Phone.

Android Basics – Call an Activity in another App using Implicit Intent

It is possible to call an Activity in another App from your App by using an Implicit Intent.

In the last Article you saw how to use an Explicit intent to call an Activity in
the same App.

A Scenario can be if you want to send a Text Message when the user clicks on a Button in your App.

To achieve this you need to know a few basic concepts:

1. Action

In an Explicit Intent you need to specify the Action – like Email, Message, Call – basically what kind of Intents you want to use.

Continue reading “Android Basics – Call an Activity in another App using Implicit Intent”

Android Basics – What is an Intent and how is it used to call an Activity ?

In Android App you can have multiple Activities. Each Activity performs a certain task. At times it needs to call another Activity.

To do this Intent is used. Which means an intent to do something.

To call a new MessageActivity from the MainActivity – on click of a Button add the following two lines in your MainActivity

Intent intent=new Intent(this, MessageActivity.class);

That’s it !

World of Thoughts and Telepathy through the eyes of Science

As humans, we can identify galaxies light years away, we can study particles smaller than an atom. But we still haven’t unlocked the mystery of the three pounds of matter that sits between our ears. – US President Obama on the BRAIN initiative

The human brain has 100 billion neurons, each neuron connected to 10 thousand other neurons. Sitting on your shoulders is the most complicated object in the known universe – Michio Kaku.

“Know Thyself” – A Greek Motto


Like most of us I too have this burning desire to understand the real ME which gives me a feeling of “I” or “Self”. Some theory suggests that its all in the brain, with our Prefrontal Cortex responsible for this, and some that its more than that. There are no easy answers and that’s why we have Science to our rescue.

Two theories of Consciousness

1. One theory suggests that our Brains are like Generators which can produce current / signals. If we go by this analogy then the concept of Consciousness vanishes. Our brains are so evolved and capable that it integrates all the information and presents it in a cohesive manner.

2. A second theory suggests that our Brains are analogous to television or radio sets which receives signals or instructions from some source.

In this article I do not explore this Science of Consciousness, which I plan to do in a future post, but I do want to share some of the cutting edge research, taking place worldwide, in the field of Brain and Neuroscience.

Continue reading “World of Thoughts and Telepathy through the eyes of Science”

Android Basics – How to use findViewById method

If you want to reference any UI component, defined in the Layout XML file, then you need to use the findViewById method.

In your Activity class add the following code snippet

TextView helloText = (TextView) findViewById(;
if(helloText != null){
Log.v(TAG, “Lets check the value in hello id “+helloText.getText());

Once you get a reference you can perform operations on the element.


Android Basics – Add a Button and display a Toast on click

Time for some Action. Let’s add a Button to the Layout XML file and on click of button let’s display a message to the user.

Simple Steps

Add a Button component to the XML file.

    android:text="Click Me"

Add a method to the MainActivity class.

public void clickMe(View view){
    Toast.makeText(MainActivity.this, "Button Clicked !!", Toast.LENGTH_SHORT).show();

You are all set. Test your app now.

Source Code

Android Basics – What is an R file ?

R is a Java Class file which is autogenerated by Android for your Project. It contains a list of all Resources being used.

For example if you have the following TextView in your Layout

android:text=”Hello Android !!”/>

Android will create the following entry in the R file for this ID.

public static final int helloId=0x7f0c0069;

This helps us to reference this UI component in our Activity Class.

Android Basics – How to Add Log to your Class for Debug Purpose

Using Log statements in your Android Project is both useful and important. It will help you to debug problems.


The following Log levels are available in Android

  • Debug
  • Verbose
  • Error
  • Warn
  • Info
  • Error
  • Assert

To add a Log statement to your MainActivity Class simply add the following code statement to the onCreate method.

Log.v(MainActivity.class.getSimpleName(), “In onCreate”);


Android Basics – A quick look at the Layout File in Android Project

In the last Article you learnt about MainActivity class. Let’s look at the Layout XML file.

The Layout file is responsible for the User Interface (UI). It’s what you see when you Launch an App.

The File can have Text, Buttons and other elements. Just like a website.

Go ahead an open the content_main.xml file in the new Project. As you can see this XML file contains two primary XML tags:

1. RelativeLayout : This Element tells Android to put elements relative to each other.
2. TextView : This Element is used to display Text.

The android:text attribute in the TextView element is used to display Text. Go ahead and modify this. Save and test. In the next Video we will add a Button to this Layout file.

Android Basics – What is an Activity in Android

In the last video you saw the Android Manifest File.

Let’s look at the MainActivity class. The MainActivity class is called when you Launch the App.

This Class is an Activity. Now you might be wondering what is an Activity. An Activity is used to peform certain basic setup tasks when the App Launches. Like specify the Layout
which the App will use. All activities should extend Activity class and implement the onCreate method which gets called when the activity object gets created.

I hope this gives you an idea about the MainActivity Class. We will look at the activity life cycle a little later. In the next video you will see the Layout file. Until next time, bye.