01 11 - graphical user interface - fonts-web-tab

16
Android Graphical User Interface

Upload: siva-reddy

Post on 25-May-2015

74 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: 01  11 - graphical user interface - fonts-web-tab

Android

Graphical User Interface

Page 2: 01  11 - graphical user interface - fonts-web-tab

Agenda

Fonts

Tab

Web Kit Browser

Page 3: 01  11 - graphical user interface - fonts-web-tab

WebKit Browser

Page 4: 01  11 - graphical user interface - fonts-web-tab

Web Kit Browser

In Android you can embed the built‐in Web browser as a widget in your own activities, for displaying HTML material or perform Internet browsing.

The Android browser is based on WebKit, the same engine that powers Apple's Safari Web browser.

Android uses the WebView widget to host the browser’s pages

Applications using the WebView component must request

INTERNET permission.

Page 5: 01  11 - graphical user interface - fonts-web-tab

WebKit Browser - Browsing Power

The browser will access the Internet through whatever means are available to that specific device at the present time (WiFi,cellular network, Bluetooth‐tethered phone, etc.).

The WebKit rendering engine used to display web pages includes methods to

1. navigate forward and backward through a history,

2. zoom in and out,

3. perform text searches,

4. load data

5. stop loading and

6. more.

Page 6: 01  11 - graphical user interface - fonts-web-tab

Example –Web Kit Browser (XML Layout)

Page 7: 01  11 - graphical user interface - fonts-web-tab

Example –Web Kit Browser (Activity)

Page 8: 01  11 - graphical user interface - fonts-web-tab

Example –Web Kit Browser (Manifest)

Page 9: 01  11 - graphical user interface - fonts-web-tab

Browser Commands

There is no navigation toolbar with the WebView widget (saving space). You could supply the

UI –such as a Menu– to execute the following operations:

reload() to refresh the currently‐viewed Web page

goBack() to go back one step in the browser history, and canGoBack() to

determine if there is any history to trace back

goForward() to go forward one step in the browser history, and canGoForward()

to determine if there is any history to go forward to

goBackOrForward() to go backwards or forwards in the browser history,where

negative/positive numbers represent a count of steps to go

canGoBackOrForward() to see if the browser can go backwards or forwards the

stated number of steps (following the same positive/negative

convention as goBackOrForward())

clearCache() to clear the browser resource cache and clearHistory() to clear the

browsing history

Page 10: 01  11 - graphical user interface - fonts-web-tab

Fonts

Page 11: 01  11 - graphical user interface - fonts-web-tab

Fonts

Developers may add any font to their application by

following the next steps:

1. Create the /fonts folder in the /assets directory.

2. Copy any fonts you plan to use into the new folder.

3. Use Java code to bind the font with the UI widget wanting

to display the custom typeface (see example)

Page 12: 01  11 - graphical user interface - fonts-web-tab

Example - fonts

Page 13: 01  11 - graphical user interface - fonts-web-tab

Tab Selection Widget

Android UIs should be kept simple at all costs.

When many pieces of information must be displayed in a

single app, the Tab Widget could be used to make the

user aware of the pieces but show only a portion at the

time.

Page 14: 01  11 - graphical user interface - fonts-web-tab

Tabs – Components

There are a few widgets and containers you need to use in order to set

up a tabbed portion of a view:

TabHost is the main container for the tab buttons and tab

contents

TabWidget implements the row of tab buttons, which contain

text labels and optionally contain icons

FrameLayout is the container for the tab contents

Page 15: 01  11 - graphical user interface - fonts-web-tab

Example: Tabs (Xml Layout)

Page 16: 01  11 - graphical user interface - fonts-web-tab

Questions?