Presentation is loading. Please wait.

Presentation is loading. Please wait.

Presented By: Muhammad Tariq Software Engineer www.TNSbay.com Android Training course.

Similar presentations


Presentation on theme: "Presented By: Muhammad Tariq Software Engineer www.TNSbay.com Android Training course."— Presentation transcript:

1 Presented By: Muhammad Tariq Software Engineer www.TNSbay.com Android Training course

2 Android Layout Types There are number of Layouts provided by Android which you will use in almost all the Android applications to provide different view, look and feel. 1)LinearLayout 2)RelativeLayout 3)TableLayout 4)AbsoluteLayout 5)FrameLayout 6)ListView 7)GridView

3 Android Layout Attributes 1) Same attributes like HTMl tags and attributes. 2) match_parent, fill_parent, wrap_content 3) dp vs px

4 A-Android UI Control There are number of UI controls provided by Android that allow you to build the graphical user interface for your app. 1TextView This control is used to display text to the user. 2EditText EditText is a predefined subclass of TextView that includes rich editing capabilities. 3AutoCompleteTextView The AutoCompleteTextView is a view that is similar to EditText, except that it shows a list of completion suggestions automatically while the user is typing. 4Button A push-button that can be pressed, or clicked, by the user to perform an action. 5ImageButton AbsoluteLayout enables you to specify the exact location of its children. 6CheckBox An on/off switch that can be toggled by the user. You should use check box when presenting users with a group of selectable options that are not mutually exclusive.

5 B-Android UI Control 7ToggleButton An on/off button with a light indicator. 8RadioButton The RadioButton has two states: either checked or unchecked. 9RadioGroup A RadioGroup is used to group together one or more RadioButtons. 10ProgressBar The ProgressBar view provides visual feedback about some ongoing tasks, such as when you are performing a task in the background. 11Spinner A drop-down list that allows users to select one value from a set. 12TimePicker The TimePicker view enables users to select a time of the day, in either 24-hour mode or AM/PM mode. 13DatePicker The DatePicker view enables users to select a date of the day.

6 C-Android UI Control XML Layout: Java code Call reference: TextView myText = (TextView) findViewById(R.id.text_id); EditText output = (EditText) findViewById(R.id.output); Output.setText(myText.getText().toString()); mybutton = (Button) findViewById(R.id.mybutton); mybutton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { outputstr = "OUTPUT:"+txtname.getText().toString()+":"+txtemil.getText().toString(); output.setText(outputstr); } });

7 Alert messaging Android Console Message: Log.d(msg, "The onResume() event"); Short Time message: Toast.makeText(this, text, Toast.LENGTH_SHORT).show();

8 Contact us www.TNSbay.com Cell: +92 342 2988522 Telephone : +92 606 470099 tariq@tnsbay.com tariqtnsbay@gmail.com


Download ppt "Presented By: Muhammad Tariq Software Engineer www.TNSbay.com Android Training course."

Similar presentations


Ads by Google