Android App Basics Dr. David Janzen Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5.

Slides:



Advertisements
Similar presentations
Android Fonts Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright © CommonsWare, LLC. ISBN:
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.
Android Form Elements. Views Provide common UI functionality Form elements: text area, button, radio button, checkbox, dropdown list, etc. Date and time.
Client / Server Programming in Android Eclipse IDE Android Development Tools (ADT) Android SDK
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.
Creating Android user interfaces using layouts 1Android user interfaces using layouts.
Chien-Chung Shen Manifest and Activity Chien-Chung Shen
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
Introducing the Sudoku Example
Android: versions Note that: Honeycomb (Android v3.0) A tablet-only release Jelly Bean (Android v4.1) Released on July 09, 2012.
 Understanding an activity  Starting an activity  Passing information between activities  Understanding intents  Understanding the activity lifecycle.
Mobile Computing Lecture#08 IntentFilters & BroadcastReceivers.
Favorite Twitter® Searches App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
1 Mobile Computing Monetizing An App Copyright 2014 by Janson Industries.
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.
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.
CE Applied Communications Technology Android lecture 2 - Structures Android File structure Resources Drawables Layout Values R Class Manifest Running.
Android – Advanced Topics Mobile Application Development Selected Topics – CPIT Oct-15.
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
Mobile Programming Lecture 5 Composite Views, Activities, Intents and Filters.
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.
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
Copyright© Jeffrey Jongko, Ateneo de Manila University Deconstructing HelloWorld.
Android App Basics Slides from developer.android.com and adopted from Janzen.
Resources & Android Manifest Калин Кадиев Astea Solutions AD.
Android 基本 I/O. 基本 I/O 介面元件 在此節中主要介紹常見的 I/O 使用者介 面元件 – Button, TextView, 以及 EditText , 學習者可以學會: – Android 的視窗表單設計 res/layout/main.xml – Android SDK –
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.
Lab7 – Appendix.
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 N Amanquah.
Adapting to Display Orientation
Mobile Software Development for Android - I397
Android Introduction Hello World.
Android Notifications
Android Introduction Hello Views Part 1.
Android Introduction Camera.
תכנות ב android אליהו חלסצ'י.
Mobile Device Development
Anatomy of an Android Application
CIS 470 Mobile App Development
CS323 Android Model-View-Controller Architecture
CA16R405 - Mobile Application Development (Theory)
Many thanks to Jun Bum Lim for his help with this tutorial.
CMPE419 Mobile Application 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,
Android Developer Fundamentals V2 Lesson 4
CIS 470 Mobile App Development
Android Notifications
Korea Software HRD Center
CMPE419 Mobile Application Development
Chapter 5 Your Second Activity.
Android Sensor Programming
CIS 694/EEC 693 Android Sensor Programming
Android Sensor Programming
Presentation transcript:

Android App Basics Dr. David Janzen Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License.

A First Example: Advent Devotions

UML Class Diagram Generated by Android External Activity

Two Activities in Advent Devotions AdventDevos displays the calendar of dates Devo displays a single devotion Intent myIntent = new Intent(AdventDevos.this, Devo.class); myIntent.putExtra("ButtonNum", "" + index); startActivity(myIntent);

Two Activities in Advent Devotions AdventDevos displays the calendar of dates Devo displays a single devotion Bundle extras = getIntent().getExtras(); String value = extras.getString("ButtonNum"); Integer buttonNum = Integer.valueOf(value);

Launching an Intent you didn’t write Devos has button to URL Browser launched Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(" passage +"&version=NIV")); startActivity(i);

Android Activity “An activity is a single, focused thing that the user can do. Almost all activities interact with the user, so the Activity class takes care of creating a window for you in which you can place your UI with setContentView(View).” Activity.html#ActivityLifecycle

AndroidManifest.xml <manifest xmlns:android=" package="com.simexusa.adventdevotions" android:versionCode="2" android:versionName="1.0"> <activity android:name=".AdventDevos" Specifies icon for launching app Specifies activity to be launched at startup Each upload to Market requires versionCode increment Security permissions requested from user on install

Look around the files

Layouts and Resources See main.xml and devo.xml –Activity associates with layout xml file using setContentView(R.layout.main); or setContentView(R.layout.devo); in onCreate() –Note TableLayout and TableRow similar to and in html –Note use of dimen (see values/dimens.xml) and color (see values/colors.xml) –Also see strings.xml

main.xml <LinearLayout xmlns:android=" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" <TableLayout android:layout_width="wrap_content" android:layout_height="wrap_content"> <Button android:text="Nov. 29" android:layout_width="wrap_content" android:layout_height="wrap_content" <Button android:text="Nov. 30" android:layout_width="wrap_content" android:layout_height="wrap_content" <Button android:text="Dec. 1" android:layout_width="wrap_content" android:layout_height="wrap_content" <Button android:text="Dec. 2" android:layout_width="wrap_content" android:layout_height="wrap_content" …

devo.xml <LinearLayout xmlns:android=" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_horizontal" <TextView android:text="Date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" android:textStyle="italic" android:typeface="serif" <TextView android:text="Title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" android:textStyle="bold" android:typeface="serif" <Button android:text="Read Scripture" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" <ScrollView android:layout_height="fill_parent" android:layout_width="fill_parent"> <TextView android:text="Body" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left" android:typeface="serif"

dimens.xml 17sp 20sp Hello World, AdventDevos! Advent Devotions #AAFFFF99 #FF colors.xml strings.xml