Creating Hello SKOT Android Application
- - Launch Eclipse
environment as shown below (name it Hello SKOT)
XML layout (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"
tools:context=".MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:textStyle="bold"
android:textSize="40dp"
android:text="Hello
SKOT!" />
</RelativeLayout>
JAVA Class (MainActivity.java)
package
com.skotsolutions.helloskot;
import
android.os.Bundle;
import
android.app.Activity;
import
android.view.Menu;
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.activity_main, menu);
return true;
}
download the source code HelloSKOT.zip
No comments:
Post a Comment