[Android development] 3. Creating a 'HELLO WORLD' app

'HELLO WORLD' app

Hey readers, in this post lets learn how to create our first andriod app which displays 'HELLO WORLD'.

Follow the steps:
  1. open 'ANDROID STUDIO'
  2. Start a new android project and give the appropriate names in the fields which will be asked.
  3. Locate the generated activity file, which in my case is 'ActivityMain.java', and enter the following code,
 Notes:
  •    onCreate function : This function gets called when your activity is started. Learn more about onCreate in stackoverflow. 
  •    setContentView: This sets the layout for the activity, parameter to be passed is the layout's resource id, something in the form of 'R.layout.name'. Learn more about this here.
 

    4. locate the xml file associated with the activity's java class, which in my case is 'activity_main.xml'. Enter the following code

 Notes:
  • RelativeLayout: A layout type, learn more here. There are also other type of layouts, check them out here
  • TextView: A view item which displays a text on the layout screen. Learn more here
After your coding is done, Just click on 'RUN APP' at the top toolbar in the android studio.
Select an emulator and Run on it. [To know how to setup emulator, read this post
Have a look at our video tutorial for this post on 'CodeShuffle YouTube'

 In the next post, lets learn 'How to build a signed apk' of your android project.
 

He is a simple passionate tech freak who himself is an engineering student at Canara Engineering college. He likes App Development, Web designing, Blogging, Youtubing, Debugging and also is a CodeGeek!

Sharing is sexy!

Related Articles

Share your views about this article!