Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Hellow World Application used in Android
WhatsApp
Sreenath Ks
Dec 29
2015
1.1
k
0
2
JAVA CODE:
package com.example.sreenath.helloandroid;
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.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();
//noinspection SimplifiableIfStatement
if
(id == R.id.action_settings)
{
return
true
;
}
return
super.onOptionsItemSelected(item);
}
}
XML CODE:
<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:paddingLeft=
"@dimen/activity_horizontal_margin"
android:paddingRight=
"@dimen/activity_horizontal_margin"
android:paddingTop=
"@dimen/activity_vertical_margin"
android:paddingBottom=
"@dimen/activity_vertical_margin"
tools:context=
".MainActivity"
style=
"@android:style/ButtonBar"
android:id=
"@+id/sree"
android:background=
"@android:color/holo_blue_light"
>
<TextView android:text=
"\t HELLO WORLD\n"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"81dp"
android:id=
"@+id/sree"
android:background=
"@mipmap/ic_launcher"
android:textColor=
"#ffff038f"
android:layout_alignParentTop=
"true"
android:layout_alignParentLeft=
"true"
android:layout_alignParentStart=
"true"
android:layout_marginLeft=
"69dp"
android:layout_marginStart=
"69dp"
/>
</RelativeLayout>
Android starter
Android
Hellow World Application used in Android
Up Next
Hellow World Application used in Android