1 / 12

lec 02

lec 02. Activities Activity Lifecycle Multiple Activities Views Menus and Dialogs. Building Blocks of an App. Activities Intents Services Content Providers Broadcast Recievers. Activities. Equivalent to Forms in Swing and other programming environments. Activities are loosely bound

briansnyder
Download Presentation

lec 02

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. lec 02 Activities Activity Lifecycle Multiple Activities Views Menus and Dialogs

  2. Building Blocks of an App • Activities • Intents • Services • Content Providers • Broadcast Recievers

  3. Activities • Equivalent to Forms in Swing and other programming environments. • Activities are loosely bound • Activities are on a "Back Stack" and are popped off when the back button is hit.

  4. Inter- and intra-application communication are done with intents. You send an intent to the andriod-system and it takes care of that request.

  5. Activity Lifecycle

  6. Activity Lifecycle

  7. Views Views are essentially UI controls (aka widgets – but not to be confused with home-page widgets) View is the grand-daddy of all subclassed Views such as TextView, WebView, EditText, Button, etc. Drag views onto Activities and describe them with XML properties. You may use DroidDraw to generate XML.

  8. Menus Options Menu – opened when you click your menu button on your phone. Context Menu – aka PopMenu opened with you long-click a View.

  9. AdapterViews

  10. Adapters

  11. Styles Styles are defined in an XML file like such: <?xmlversion="1.0"encoding="utf-8"?> <resources> <stylename="label"parent="@android:style/TextAppearance"> <itemname="android:layout_marginLeft">10dp</item> <itemname="android:layout_weight">15</item> … Styles are used to define the properties of a widget and then applied to each widget who should look alike. Changing styles can be done in one place—the resource xml.

  12. Themes Themes can be custom styles or built-in themes. In the manifest file, you would insert it like this: <application android:theme="@style/CustomTheme"> Or like this: <activity android:theme="@android:style/Theme.Translucent"> Themes can apply to entire applications (all the activities therein), or individual activities.

More Related