Android Fonts Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright © 2008-2009 CommonsWare, LLC. ISBN: 978-0-9816780-0-9.

Slides:



Advertisements
Similar presentations
Application Fundamentals. See: developer.android.com/guide/developing/building/index.html.
Advertisements

Who Am I And Why Am I Here I’m professor Stephen Fickas in CIS – you can call me Steve. I have a research group that works with mobile devices (since 1995!)
User Interface Android Applications. Activities An activity presents a visual user interface. Each activity is given a default window to draw in. The.
Android Form Elements. Views Provide common UI functionality Form elements: text area, button, radio button, checkbox, dropdown list, etc. Date and time.
Basic, Basic, Basic Android. What are Packages? Page 346 in text Package statement goes before any import statements Indicates that the class declared.
Android Application Development with Java UPenn CS4HS 2011 Chris Murphy
@2011 Mihail L. Sichitiu1 Android Introduction Hello World.
Android Application Development Tutorial. Topics Lecture 5 Overview Overview of Networking Programming Tutorial 2: Downloading from the Internet.
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
Android Hard & Soft Keyboards Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright © CommonsWare, LLC.
Android Basic XML Layouts Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright © CommonsWare, LLC. ISBN:
Android Activities 1. What are Android Activities? Activities are like windows in an Android application An application can have any number of activities.
Mobile Programming Lecture 6
1 Announcements Homework #2 due Feb 7 at 1:30pm Submit the entire Eclipse project in Blackboard Please fill out the when2meets when your Project Manager.
1/29/ Android Programming: FrameLayout By Dr. Ramji M. Makwana Professor and Head, Computer Engineering Department A.D. Patel.
Android Dialog Boxes AlertDialog - Toast
Programming with Android: Layouts, Widgets and Events Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
Import import android.graphics.Bitmap; import android.widget.ImageView;
1 Introducing Activity and Intent. 2 Memory LinearLayout, weight=2 LinearLayout, weight=1 TextView ListView.
ANDROID – DRAWING IMAGES – SIMPLE EXAMPLE IN INTERFACE AND EVENT HANDLING L. Grewe.
Announcements Homework #2 will be posted after class due Thursday Feb 7, 1:30pm you may work with one other person No office hours tonight (sorry!) I will.
Android App Basics Dr. David Janzen Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5.
Android Using Menus Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright © CommonsWare, LLC. ISBN:
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
Copyright© Jeffrey Jongko, Ateneo de Manila University Deconstructing HelloWorld.
Android and s Ken Nguyen Clayton state University 2012.
Mobile Computing Lecture#12 Graphics & Animation.
Android 基本 I/O. 基本 I/O 介面元件 在此節中主要介紹常見的 I/O 使用者介 面元件 – Button, TextView, 以及 EditText , 學習者可以學會: – Android 的視窗表單設計 res/layout/main.xml – Android SDK –
Http :// developer. android. com / guide / topics / fundamentals. html.
You have to remember that  To create an AVD(Android Virtual Device)  The Structure of Android Project  XML Layout  The advantage of XML Layout  Android.
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Android Programming.
Android Programming - Features
Cleveland State University
Lecture 3 Zablon Ochomo Android Layouts Lecture 3 Zablon Ochomo
Android Introduction Hello World
Android Application Development 1 6 May 2018
Android Layouts 8 May 2018 S.RENUKADEVI/AP/SCD/ANDROID LAYOUTS 1.
Android N Amanquah.
GUI Programming Fundamentals
Android Basic XML Layouts
Android Introduction Hello World.
Android External Resources
Designing Apps Using The WebView Control
Android Widgets 1 7 August 2018
Android Introduction Hello Views Part 1.
ITEC535 – Mobile Programming
Politeknik Elektronika Negeri Surabaya
Android Dialog Boxes AlertDialog - Toast
תכנות ב android אליהו חלסצ'י.
CIS 470 Mobile App Development
Android Programming Lecture 6
CIS 470 Mobile App Development
MultiUni Trần Vũ Tất Bình
CIS 470 Mobile App Development
BMI Android Application will take weight and height from the users to calculate Body Mass Index (BMI) with the information, whether user is underweight,
Note Q) How to format code in Enclipse? A) Ctrl + i
CIS 470 Mobile App Development
Programski jezici za mobilne aplikacije
CIS 470 Mobile App Development
CIS 470 Mobile App Development
Adding Components to Activity
Korea Software HRD Center
CMPE419 Mobile Application Development
Android Sensor Programming
CIS 694/EEC 693 Android Sensor Programming
Android Sensor Programming
Presentation transcript:

Android Fonts Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright © CommonsWare, LLC. ISBN: & Android Developers 9

2 9. Android – UI – Fonts Fonts 2 Android naturally provides three fonts: sans: An m is wider than i, mmm iiii serif: An m is wider than i, mmm iiii monospaced: An mmm is not wider than iii

3 9. Android – UI – Fonts Fonts 3 Also know as: Roman Type Grotesque or Gothic Source:

4 9. Android – UI – Fonts Fonts 4 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).

5 9. Android – UI – Fonts Fonts 5 Example: Getting ready to use the Jokerman.TTF font. Original font taken from c:\Windows\Fonts

6 9. Android – UI – Fonts Fonts 6 Example: Display the Hello World ! message using different fonts. Using the font: Jokerman.TTF Note: If you are using Windows XP look into the folder: c:\Windows\Fonts for fonts installed in your machine. Consult the page: for additional information in manipulating fonts.

7 9. Android – UI – Fonts Fonts 7 <TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:stretchColumns="1" xmlns:android=" > Example Application: Showing different FONT types.

8 9. Android – UI – Fonts Fonts 8 <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#ff006666" android:layout_marginRight="24px" android:text="sans:" android:textSize="20sp" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello, world!" android:textSize="20sp" android:typeface="sans" >

9 9. Android – UI – Fonts Fonts 9 <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="24px" android:text="serif:" android:textSize="20sp" android:background="#ff006666" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello, world!" android:textSize="20sp" android:typeface="serif" >

10 9. Android – UI – Fonts Fonts 10 <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="24px" android:text="monospace:" android:textSize="20sp" android:background="#ff006666" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello, world!" android:textSize="20sp" android:typeface="monospace" >

11 9. Android – UI – Fonts Fonts 11 <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="24px" android:text="custom:" android:textSize="20sp" android:background="#ff006666" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello, world!" android:textSize="20sp" > To be displayed using a custom font

12 9. Android – UI – Fonts Fonts 12 package cis493.androfontsdemo; import android.app.Activity; import android.graphics.Typeface; import android.os.Bundle; import android.widget.TextView; public class AndroFontDemo extends Activity public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); // bind the "custom" textview with chosen font TextView tvCustom=(TextView)findViewById(R.id.custom); Typeface myNewFace=Typeface.createFromAsset( getAssets(), "fonts/Jokerman.TTF“ ); tvCustom.setTypeface(myNewFace); }

Android – UI – Fonts Fonts 13 Questions ?