GTU MCA SLMC Program 1 : Android HelloWorld Tutorial

GTU MCA SLMC Program 1 : Create “Hello World” application. That will display “Hello World” in the middle of the screen in the red color with white background

GTU MCA SLMC Program 1

Welcome to the New World of Android Programming! Here I have explained how to start programming using Android. Here in the SLMC Program 1 is practical subject for gtu mca semester 5 mobile computing. In Mobile computing subject of gtu mc semester 5, there is a detailed explanation of the how to built android apps. Practical subject code for the mobile computing is 2650019 : Software Lab in Mobile computing.

Great You are reached to Andriod tutorial which contains lots of article on android, java, servlet, JSP, C, JavaScript and more, must check out using above links or at the end of this article.

Before you start programming in android you need to aware of few terminology and tools. I suggest the best website for learning android programming is https://developer.android.com. Its official website by Android. don’t forget to check out android tips and tricks

Tools required to develop and run your Android Program.

Android ADT Bundle (adt-bundle-windows-x86-20140702) : This tools contains major 2 folders. 1) Eclipse (Ide for development) and 2) SDK (Libraries for Android)

Here is complete hellow world android tutorial by video

 

Android Hello World Example Code

Location: res\layout

FileName: activity_main.xml

 

<RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android”
xmlns:tools=”http://schemas.android.com/tools”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:paddingBottom=”@dimen/activity_vertical_margin”
android:paddingLeft=”@dimen/activity_horizontal_margin”
android:paddingRight=”@dimen/activity_horizontal_margin”
android:paddingTop=”@dimen/activity_vertical_margin”
tools:context=”gtu.moc.prog01.MainActivity” >

<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_centerHorizontal=”true”
android:layout_centerVertical=”true”
android:text=”GTU MOC Program 1 by Adarsh Patel” />

</RelativeLayout>

 

Location : src\package\

FileName : MainActivity.java

 

package gtu.moc.prog01;

/*
* GTU MCA SLMC Program 1
*
* Create “Hello World” application. That will display “Hello World” in the middle of the
* screen in the red color with white background
*
*/

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}

 

 

Output of GTU MCA SLMC Program 1

GTU MCA SLMC Program 1

Adarsh Patel

My Self Adarsh Suryakant Patel. Currently I am working as Assistant Professor at Parul Instiute of Engineering and Technology, MCA Department, Limda, Vadodara. Major Responsibility : * Lectures * Organizing Training and Expert Sessions for * Placement and Recruitment * Faculty Representative