ϡ GUI .

1- :




android project


next :

:
1
2-
3-
4- com ޡ . APK .
5- ϡ Activity
... LoginActivity ...
6 SDK 2
7-


GUI
:

:
1- src package com.ce4arab.helloworld Java ADT .
2- gen ADT .
3- res ϡ : ѡ ʡ ǡ layout XML GUI
main.xml GUI
HelloWorldCe4arabActivity.java
4- AndroidManifest.xml xml .

Class ϡ 100% public.

HelloWorldCe4arabActivity.java ADT

PHP:
package com.ce4arab.helloworld;

import android.app.Activity;
import android.os.Bundle;

public class
HelloWorldCe4arabActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}

** .
package com.ce4arab.helloworld;

** import
android SDK ... .

**
public class HelloWorldCe4arabActivity extends Activity {
public class keyword compiler ... HelloWorldCe4arabActivity .. ..

** extends HelloWorldCe4arabActivity Activity

** : Object Oriented O.O.
ǡ ǡ ȡ ȡ .

**
public void onCreate(Bundle savedInstanceState) {
(function, method) {} onCreate .
onCreate public Bundle savedInstanceState
void .

**
super.onCreate(savedInstanceState);
onCreate super Activity ... extends Activity

**
setContentView(R.layout.main);
setContentView ߡ
R.layout.main gen R.java ... R.layout,main main.xml layout .

ǡ main.xml .

main.xml

ݡ
Main.xml Graphical Layout
Graphical Layout
main.xml xml
PHP:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>

...
layout linear
android:layout_width="fill_parent" android:layout_height="fill_parent"

TextView label graphical
ߡ android:text
... "" :
android:text="my name is Yazan"
graphical ( ) properties ...

id java

text ..
xml ..... .

right click Edit Id lblTitle

drag drop .

button
Edit Id btnChange OK

text Change Enter
sma666 fartoot321 .

ID ADT R.java
...

*** HelloWorldCe4arabActivity.java :

*** :

- button textView
- ... ˿
actionListener ѡ OnCLickListener .

action listener ޡ ... .

.. lblTitle Hello Android!
*** :

Button btnChange;
TextView lblTitle;
button textview

btnChange = (Button) findViewById(R.id.btnChange);
lblTitle = (TextView) findViewById(R.id.lblTitle);

findViewById() object R.java

ӡ ctrl+space .

btnChecng_onclickListener btnChngeLsnr = new btnChecng_onclickListener(this);
btnChange.setOnClickListener(btnChngeLsnr);

object btnChecng_onclickListener btnChngeLsnr .

..
class btnChecng_onclickListener implements OnClickListener{ ݡ ˡ
onClick(View v) lblTitle .