Recent Posts

Site Creator

Day 1 : Introduction to Android

Posted on

Dear Friends We gonna start with Introduction to Android OS , Android Studio and development tools that are needed to develop those creative applications which are loved by millions.

 

Today is the first day of this tutorial and in subsequent blog post there will be other topics on which we would be having brainstorming sessions.

 

We will be having a targeted approach in our studies so below are the topics we gonna cover.

  • Creating a simple Application in Android that accepts a simple string and prints that string on Screen.
  • Change the color of the background to some other color than white.
  • Put simple translation animation to the string.

Lets start with tackling first one

  • Creating a simple Application in Android that accepts a simple string and prints that string on Screen.

Start a new project in Android Studio .. put relevant details .. do what android prompts to you.

 

So thats how our first activity called MainActivity can be created. Please pay attention to the fact we are extending our MainActivity from AppCompatActivity and not Activity.  We are doing this because we want our final application to be backward compatible (means application that can run on older devices).

Lets play with our application and try to run it on actual device.

IMG-20160701-WA0044.jpg

 

You see we just have a ubiquitous “Hello World” single string displayed when our application is first launched in device.

  • Change the color of the background to some other color than white.

open colors.xml in you Android Studio for the project.

 

 

You can add custom color  like this inside <resources> …. </resources> tags.

 

Now open activity_main.xml

 

 

use background attribute for the top level RelativeLayout so that our activity will be having custom background.

 

And thats how our output will be like
image

 

  • Put simple translation animation to the string.

Now we will go ahead with playing with our simple application by putting a simple application to our string.  So that whenever activity is launched on device our string will appear animating from left to right.

For this to work properly we need to some ground work.

create a folder name ‘anim’ inside res directory.  Create xml file in anim directory.

 

Now some changes to our MainActivity and associated view (activity_main.xml)

MainActivity

 

 

activity_main.xml

 

 

And finally now build your code run it on device and enjoy your first ever android application.

output : Video

 

 

And At last but not the least Home work :

Build a simple Login Screen UX in Android Application.

 

Cheers ! Lets have a party.

 

 







Disclaimer: The aforesaid writeup by Relsell Global writer is for the general understanding of the readers. It does not render any professional advice or opinion.

SHARE THIS PAGE!

Comments are closed.