Wednesday, February 27, 2013

Running - "Hi Android : My first Android app - 2nd Attempt

The problem related me preventing running the app was due to some missing connection with the device which I intend to run my app on.
There are clear 2 ways of running the App.
  1. On a real device ( a phone or tab or any Android device ) 
  2. Run on Emulator ( virtual device called AVD, Android virtual device , which represent a phone made out of the resources in a computer ).
I try the 2nd option first. 
To do so, I need to create a AVD first in my computer.

This is available in Google android in this link.

Steps.on Eclips , click on AVD menu or, execute it from file menu Window>AVD Manager 
This will open up following dialog.
Then select New , to create a virtual device.

Give the necessary parameters. For example the parameters I ve given here , represent a virtual smartphone of ARM Processor, 512 MB internal memory, WVGA 800 like display.

Now my AVD is ready to run my program.
Click "Start " after selecting the AVD to "Start" the emulator.

There are some additional screen and dpi settings that you can customize here if needed.

Click "Launch"
It takes extremely long time to start and the first time I though it stuck or crashed.

Once it is loaded it looks like this.
Now I m going to run the program I wrote.
This is how it looks when running on Emulator..
In the next post, lets look at how to run the app we wrote in a real phone...

Tuesday, February 12, 2013

Upgrading, rooting and then installing custom ROM on Samsung Galaxy S1 Captivate

First of all, if you ever want to , follow these information and try root, upgrade and install custom ROM on your valuable smartphone AT YOUR OWN RISK. I m by no means  responsible for any damage that could cause to your phone.

I bought this phone from USA  and it is designed to AT&T by Samsung. It was unlocked and was running with Android 2.1 ( Eclair ). Once I bring back to Sri Lanka powered it on and it was working fine until I charged it after which it was dead. Then I bough another phone and get it down here and replaced the motherboard. Then it worked.  It was like this initially.

I wanted to upgrade it to Android 2.3 ( Gingerbread) , then root, then install the latest custom ROM.
First I downladed Samsung Kias Mini and connected to the phone and checked the latest upgrade and it is Gingerbread of course.


It is pretty easy and Kies Mini will just push the upgrade and finally restareting the phone will boot in to Ginger bread. Then first I needed to root this phone- for which I needed to download below files.

 This includes ,
1. Clock work mod recovery ( CWM)
2. Ordin
3. Corn Kernel
First connect install Odin and then connect the phone to USB cable and then press volume +/- signs together with power on/off button. The phone will force on to download mode and the communication port will be identified by Odin.Then Select corn-kernel ...tar file and flash it to the phone and install CWM recovery.

Once it is done, the phone is rooted and CWM is installed. Then I found a custom ROM that suites to the phone. It was based on Jelly Bean 4.1.2 and one smart Engineer has tweaked the code to match to captivate. First this is how the CWM screen looks like.


This is ROM I downloaded . 

 Then I put this ROM file in to SD card and then select the option "Install ZIP file from SD card"

Once it is done , installing the custom ROM started. This process is critical, and need lot of care.

 Once done the phone running with nice looking efficient and fast Jelly Bean custom version.

Keep in mind that if you ever want to do this to your phone , serch for what are the tools and roms and recovery tools more sucessful to your phone model, read a lot who has done and see if there are problems. If you are sure enough, then experiment. There is always a chance that your phone could become a "brick ". A brick can be recovered also ( in many cases say 80% of times as I knew from reading) , but if you are so unfortunate, there is a probability that it would actually become a brick.
Thanks for Reading..

Friday, August 24, 2012

Running - "Hi Android : My first Android app

 I m using this page to help myself to run " Hi Android" my first app. The tutorial I used is
Please refer it for more detail.

The tutorial says that I will have all required source files available to immediately run the App.
Lets see...

It says , The app can run on,

1. Real mobile device ( a phone , tab )
2. On Android emulator

Let's see the files that are stored in this simple project ( these information are also from above tutorial).

src/ :Directory of Apps main source file.

res/: This folder has sub folders of App's resources.
drawable-hdpi/: Directory for drawable objects designed for high density screens

layout/: files that defines the user interface

values/: Folder for other xml files that contains information such as string and color definitions

AndoridManifest.xml : This file defines the fundamental characteristics of the App and its  components.

It is said following happens when the App is run:

When you build and run the default Android app, the default Activity class starts and loads a layout file that says "Hello World." ".

So I change that text from "Hello World" to "Hi Android" coz my App says "Hi Android".

I need to change it below ( I think).
Now, I next thing is to run the App....
First , running on Eclipse
I just have to press

on the tool bar...
Now , click it..........................................
ERROR... :( as expected....

I m going to investigate more on this and will write it in next post.....

Sunday, August 19, 2012

"Hi Android"-my first Android app

Now I installed everything that say it is needed to develop Android apps (hopefully). Now I m going to create my first "Android App". :). What it would do? It will just write text,

"Hi Android"

in an Android phone display.Where to start.I will use following tutorial to help myself in doing so.

 I don't ve programming language experience what so ever but  I know some basics. Let's see how it goes..

First I need to create a project with Eclipse.(All what I do below is with the help of please use it for more information).

1. Opened Eclipse
2.Clicked new Android app project. See below,
3. This opened below dialog. Since I want to get this up and running I m not dare to change any defaults. So, I keep them as it is and enter "App name" and " Project name" as in the example.
Here, Application name is the App name to the users, where as project name is the name visible in Eclipse and it is the project directory name.I do not know what is the purpose of package name(if there is anyone - then please explain me  :) ). Build SDK is the flat form Android version on which this program is built. Google says it better to be the latest so that my application can use all the latest features that latest android SDK offers.Minimum required SDK is lowest Android version that my application will support. So, this means the app I create with this settings will run on Android 2.2 Fro-yo with its minimum features while it runs on its full features on Android 4.1 Jelly bean.
I used above selections then press next to go to next step in the wizard. That step is called " Configure Launcher Icon"

 I think this icon is the one which will be used as App icon. So I accept default  settings and move forward with "Next",The next step is , "Create Activity".

what is activity, according to Google it is,"activity template from which to begin building your app".I don't get much idea of it. As advised , I select blank Activity. It seems like this gives basic structure of the App. Once I press "Next" , the next of of the wizard is for " New Blank Activity" Naming and settings.

As advised , I accept the defaults and press "Next", in next step I m asked to install Android support library.
I click "Install/Upgrade" button.Required files are then downloaded.
Once, downloaded , the packages that are downloaded need to be installed. Automatically a screen pop up after the down load to accept agreement. Once Accepted , packages are installed. Once that is finished, the finish button appears in the "Install Dependencies" step. Once I press finished, Eclipse set me up the project which looks complex but interesting ( of which I don't understand many ).
Google says , this has required source codes, so I can straight away run it. I ll update about it on next post. If any one of you reading there, pls give your feedback, corrections or questions.

Wednesday, August 1, 2012

Setting Up for Android Devolopment - 4

Step 4: Installing Android SDK

This is what it says in "The Android SDK(Software Development Kit) provides you the API libraries and developer tools necessary to build, test, and debug apps for Android".

As I said in the previous post, once ADT installation is finished , Eclipse prompted me to download Android SDK.That was easy since it automatically come up and do everything. But I think it can be downloaded and connected to Eclipse also using above link.

What I got after ADT installation is following. I selected to install latest SDK and set up the target location.

If SDK is spearately installed I think I ve to use Use exisitng SDK .
In next step I got following.Here Google asked whether I m ok if they collect some usage statistics.I selected no for the time being. But I think there is no risk even if I allowed.
In next dialog ,  I accepted the licence and agreement and press Install to install the SDK.


 Then installation started with a progress bar and Eclipse showing what being installed.

 Once this is finished, there is a new menu item in Eclipse, "Android SDK Manager "
Once this it is opened , I can see all installed component, what more available to install and for what component updates are available.
Each time I start SDK Manager, it seems to be checking for updates online.

So I think everything in place now. What next? That is to right my first Android program "Hi Android". That is in next post.

Tuesday, July 31, 2012

Setting Up for Android Devolopment - 3

Step 3: Installing ADT

ADT stands for "Android Development Tools". It is the plug-in designed to make Eclipse the most powerful Android App development environment. By Installing ADT, Eclipse is enabled and empowered to develop Android app of any sort.

To get more details , read :

Ok, I m going to do it now...
I start Eclipse, and go to help>install new software

Then , I get a dialog like below, I click add button.
In add repository dialog that appears , I add following.
Then press "OK".

you will get 2 "Available Software"s. Developer tools are the one I need for the moment. NDK as I know stands for "Native Development Kit" which allow developers to include C++ code in to Android program code which I don't need (may be fore ever :) )
When I press next , the wizard shows the list of tools that will be downloaded.Press next,
Then accept the agreement and click finish.

ADT started downloading..I think things going ok.
Once ADT download is over, Eclipse is enabled for Android devolopment and it immidiately ask for Android SDK. See below.

What is Android SDK by the way? I will write in next post.

Monday, July 30, 2012

Setting Up for Android Devolopment - 2

Step 2 : Installing JDK 6

JDK version 6 needed to run eclipse properly. If Eclipse is 64 bit then JDK has to be 64 bit.

Go to
I go to the link JDK 6 ( highlighted).

This directs to Oracle Java download page.
Now I select Java SE 6 update 33.
Once I click download, I m directed to download page.
 Then I click on highlighted link since it is the 64 bit JDK version 6.
 It is a 59.7 MB file and I download it.
Then I ran the file and the JDK and JRE was installed. Next I started Eclipse to see if it works.
Here we go...

Eclipse asks for a working directory at log on . This location will be used to store projects. I changed it to D:\Android\workspace. Now Eclipse Juno is up and running :).