Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

presentation / words

.docx
Скачиваний:
9
Добавлен:
17.02.2016
Размер:
14.45 Кб
Скачать
  1. This activity will shown you, when you open app first. If you touch menu, then you will see next picture.(1'st pic.)

  2. Here, you can add contact by clicking "Add contact" button. (2'nd pic.)

  3. Here, you can add information about person and save data by clicking "Save contact" button. If text fields is empty, alert dialog window will be shown you. (3'rd pic.)

  4. If you add some information, you will be moved to main page, where stored list of contacts . (Its shown in next picture). (4'th pic.)

  5. After choosing person (touch his name), will be shown an activity, which contains detailed data.(In next picture) (5'th pic.)

  6. To edit contact and delete contact touch menu. If you click "Edit Contact" you will see activity, which shown in 3'rd picture. Clicking "Delete Contact" button, you can delete contact after confirmation in dialog window. (6'th pic.)

  7. Main activity.

Here we will talk about class which called "AdressBook". This class extends from ListActivity. The purpose is to display a ListView containing the user’s contacts.

  1. Used AsyncTask class(package android.os) to perform operations in a single stream and obtaining execution results in the flow GUI. details create and manipulate threads are implemented using class AsyncTask, Examples than the result of manipulation of the class passed into the flow AsyncTask GUI.

  2. GetContactsTask. The class defines the procedure for interaction with the database to obtain the names of the contacts and return the results in the GUI thread the Activity class to display them using ListView.

  3. Defining Styles and Applying Them to GUI Components.You can define common GUI component attribute–value pairs as XML style resources you can then apply the styles to all components that share those values by using the style attribute. Any subsequent changes you make to a style are automatically applied to all GUI components that use the style

  1. Specifying a Background for a TextView. By default TextViews do not have a border. To define one, you can specify a Drawable as the value for the TextView’s android:background attribute. The Drawable could be an image, but in this app we’ll define a new type of Drawable using an XML representation of a shape. The XML file for such a Drawable is placed in the app’s drawable folder, which you must create in the app’s res folder.

  2. This app uses a ListView (package android.widget) to display the contact list as a list of items that is scrollable if the complete list cannot be displayed on the screen. You can specify the layout resource that will be used to display each ListView item. Extending Class ListActivity to Create an Activity That Contains a ListView When an Activity’s primary task is to display a scrollable list of items, you can extend class ListActivity which uses a ListView that occupies the entire screen as its default layout. ListView is a subclass of AdapterView (package android.widget)—a GUI component is bound to a data source via an Adapter object (package android.widget). In this app, we’ll use a CursorAdapter (package android.widget) to display the results of a database query in the ListView. Several types of AdapterViews can be bound to data using an Adapter.

Соседние файлы в папке presentation