Android Developer Fundamentals V2

Slides:



Advertisements
Similar presentations
Programming with Android: Widgets and Events Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
Advertisements

Application Fundamentals. See: developer.android.com/guide/developing/building/index.html.
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.
Layout and Control in UI The user interface (UI) is the graphical interface user can see and interact with your app comprising UI controls like textbox,
Presenting Lists of Data. Lists of Data Issues involved – unknown number of elements – allowing the user to scroll Data sources – most common ArrayList.
Creating Android user interfaces using layouts 1Android user interfaces using layouts.
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
Define html document byusing Example : Title of the document The content of the document......
PROG Mobile Java Application Development PROG Mobile Java Application Development Developing Android Apps: Components & Layout.
1 Mobile Computing Monetizing An App Copyright 2014 by Janson Industries.
Android Layouts. Layouts Define the user interface for an activity Layouts are defined in.xml files – within /res/layout folder – different layout can.
ANDROID – INTERFACE AND LAYOUT L. Grewe. Interfaces: Two Alternatives Code or XML  You have two ways you can create the interface(s) of your Application.
Basic Android Tutorial USF’s Association for Computing Machinery.
1/29/ Android Programming: FrameLayout By Dr. Ramji M. Makwana Professor and Head, Computer Engineering Department A.D. Patel.
Programming with Android: Layouts, Widgets and Events Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
User Interfaces: Part 1 (View Groups and Layouts).
Application Development for mobile Devices
17 Apr 2002 XML Syntax: Documents Andy Clark. Basic Document Structure Element tags – Elements have associated attributes Text content Miscellaneous –
Copyright© Jeffrey Jongko, Ateneo de Manila University Basic Views and Layouts.
UI Design and Development +Roman Nurik +Nick Butcher.
FramesLayout & Image View Pages FrameLayout is a ViewGroup that divides the screen into blocks of area each of which is supposed to holds a single.
ANDROID – DRAWING IMAGES – SIMPLE EXAMPLE IN INTERFACE AND EVENT HANDLING L. Grewe.
MOBILE COMPUTING D10K-7D02 MC04: Layouts Dr. Setiawan Hadi, M.Sc.CS. Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran.
Android Development: Basic Widgets Richard S. Stansbury 2015.
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
Copyright© Jeffrey Jongko, Ateneo de Manila University Deconstructing HelloWorld.
Headings are defined with the to tags. defines the largest heading. defines the smallest heading. Note: Browsers automatically add an empty line before.
1 Android Development Lean and mean introduction Based on a presentation by Mihail L. Sichitiu.
Mobile Computing Lecture#12 Graphics & Animation.
Building User Interfaces Basic Applications
COMP 365 Android Development.  Developing for Android  XML for user interface formatting and other scripting  Java for programming.
Week-11 (Lecture-1) Introduction to HTML programming: A web based markup language for web. Ex.
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
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
HTML Basics Text, Images, Tables, Forms. HTML Structure HTML is comprised of “elements” and “tags” – Begins with and ends with Elements (tags) are nested.
Lab7 – Appendix.
Lecture 3 Zablon Ochomo Android Layouts Lecture 3 Zablon Ochomo
Android Introduction Hello World
Mobile Software Development for Android - I397
Android External Resources
Chapter A - Getting Started with Dreamweaver MX 2004
Android Widgets 1 7 August 2018
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
HNDIT2417 Mobile Application Development
Android SDK & App Development
CIS 470 Mobile App Development
CS323 Android Model-View-Controller Architecture
Android Layout Basics Topics
CIS 470 Mobile App Development
CMPE419 Mobile Application Development
Building User Interfaces Basic Applications
BMI Android Application will take weight and height from the users to calculate Body Mass Index (BMI) with the information, whether user is underweight,
Android Developer Fundamentals V2
Android Topics Lab 5 Part II
CIS 470 Mobile App Development
CIS 470 Mobile App Development
Android SDK & App Development
CMPE419 Mobile Application Development
Korea Software HRD Center
Objects First with Java
CMPE419 Mobile Application Development
User Interface Screen Elements
User Interface Screen Elements
CS 240 – Advanced Programming Concepts
CS 240 – Advanced Programming Concepts
Android Sensor Programming
Android Sensor Programming
Presentation transcript:

Android Developer Fundamentals V2 Build your first app Lesson 1

1.3 Text and scrolling views

Contents TextView ScrollView

TextView for text TextView is View subclass for single and multi-line text EditText is TextView subclass with editable text Controlled with layout attributes Set text: Statically from string resource in XML Dynamically from Java code and any source

Formatting text in string resource Use <b> and <i> HTML tags for bold and italics All other HTML tags are ignored String resources: one unbroken line = one paragraph \n starts a new a line or paragraph Escape apostrophes and quotes with backslash (\", \') Escape any non-ASCII characters with backslash (\)

Creating TextView in XML <TextView android:id="@+id/textview" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/my_story"/>

Common TextView attributes android:text—text to display android:textColor—color of text android:textAppearance—predefined style or theme android:textSize—text size in sp android:textStyle—normal, bold, italic, or bold|italic android:typeface—normal, sans, serif, or monospace android:lineSpacingExtra—extra space between lines in sp

Formatting active web links <string name="article_text">... www.rockument.com ...</string> <TextView android:id="@+id/article" android:layout_width="wrap_content" android:layout_height="wrap_content" android:autoLink="web" android:text="@string/article_text"/> Don’t use HTML for a web link in free-form text autoLink values:"web", "email", "phone", "map", "all"

Creating TextView in Java code TextView myTextview = new TextView(this); myTextView.setWidth(LayoutParams.MATCH_PARENT); myTextView.setHeight(LayoutParams.WRAP_CONTENT); myTextView.setMinLines(3); myTextView.setText(R.string.my_story); myTextView.append(userComment);

ScrollView

What about large amounts of text? News stories, articles, etc… To scroll a TextView, embed it in a ScrollView Only one View element (usually TextView) allowed in a ScrollView To scroll multiple elements, use one ViewGroup (such as LinearLayout) within the ScrollView

ScrollView for scrolling content ScrollView is a subclass of FrameLayout Holds all content in memory Not good for long texts, complex layouts Do not nest multiple scrolling views Use HorizontalScrollView for horizontal scrolling Use a RecyclerView for lists

ScrollView layout with one TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/article_subheading"> <TextView .../> </ScrollView>

ScrollView layout with a view group <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:id="@+id/article_subheading" .../> android:id="@+id/article" ... /> </LinearLayout> </ScrollView>

ScrollView with image and button <ScrollView...> <LinearLayout...> <ImageView.../> <Button.../> <TextView.../> </LinearLayout> </ScrollView> One child of ScrollView which can be a layout Children of the layout

CountDownTimer CountDownTimer myTimer; myTimer=new CountDownTimer(50000,1000) { @Override public void onTick(long millisUntilFinished) { } public void onFinish() { }; myTimer.start();

END