HUJI Post PC Workshop 1 Introduction to Android Development Ari Sprung

Slides:



Advertisements
Similar presentations
Google Android Introduction to Mobile Computing. Android is part of the build a better phone process Open Handset Alliance produces Android Comprises.
Advertisements

Ando-it-yourself droid Praveen Kumar Pendyala. Outline Brief intro to the Droid developement Setting up the Life saviors - Development tools Hello Droid.
Hello world Follow steps under the sections “Create an AVD” and “Create a New Android Project” at
Application Fundamentals. See: developer.android.com/guide/developing/building/index.html.
Filip Debelić What is it? Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google Android,
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: Hello World Frank Xu Gannon University. Steps Configuration ▫Android SDK ▫Android Development Tools (ADT)  Eclipse plug-in ▫Android SDK and.
Android Application Development with Java UPenn CS4HS 2011 Chris Murphy
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
Emerging Platform#4: Android Bina Ramamurthy.  Android is an Operating system.  Android is an emerging platform for mobile devices.  Initially developed.
Android Programming. Outline Preparation Create new project Build and Run a project Debug a project Deploy on devices.
Android Application Development 2013 PClassic Chris Murphy 1.
1 Mobile Software Development Framework: Android Activity, View/ViewGroup, External Resources, Listener 10/9/2012 Y. Richard Yang.
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.
Mobile Application Development with ANDROID Tejas Lagvankar UMBC 29 April 2009.
Android: versions Note that: Honeycomb (Android v3.0) A tablet-only release Jelly Bean (Android v4.1) Released on July 09, 2012.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
Hello world Follow steps under the sections “Create an AVD” and “Create a New Android Project” at
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.
DUE Hello World on the Android Platform.
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.
Android for Java Developers Denver Java Users Group Jan 11, Mike
Presented By: Muhammad Tariq Software Engineer Android Training course.
INTRODUCTION TO ANDROID. Slide 2 Application Components An Android application is made of up one or more of the following components Activities We will.
SpotOn Game App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
First Venture into the Android World Chapter 1 Part 2.
Introduction to Android
ANDROID – A FIRST PROGRAM L. Grewe Using AndroidStudio –basic Android  Lets do a “Hello World Project”  Start up AndroidStudio (assume you have installed.
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
Copyright© Jeffrey Jongko, Ateneo de Manila University Deconstructing HelloWorld.
1 Android Development Lean and mean introduction Based on a presentation by Mihail L. Sichitiu.
Android 基本 I/O. 基本 I/O 介面元件 在此節中主要介紹常見的 I/O 使用者介 面元件 – Button, TextView, 以及 EditText , 學習者可以學會: – Android 的視窗表單設計 res/layout/main.xml – Android SDK –
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
Android apps development - Eclipse, Android SDK, and ADT plugin Introduction of.
Why Learn Android? Largest installation base of any operating system Over 20,000 Android devices exist Businesses will likely move more to device-based.
Introduction to Android Programming
Introduction to Android Chapter 1 1. Objectives Understand what Android is Learn the differences between Java and Android Java Examine the Android project.
Android Programming.
Introduction to android
Mobile Device Development
Lecture 3 Zablon Ochomo Android Layouts Lecture 3 Zablon Ochomo
Android Introduction Hello World
Android Application Development 1 6 May 2018
Android N Amanquah.
Android – Event Handling
Mobile Application Development Chapter 3 [Using Eclipse Android Studio for Android Development] IT448-Fall 2017 IT448- Fall2017.
Android Studio, Android System Basics and Git
Android Introduction Hello World.
Activities and Intents
Creation of an Android App By Keith Lynn
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
Anatomy of an Android Application
Android SDK & App Development
CIS 470 Mobile App Development
CS323 Android Getting Started
Application Development A Tutorial Driven Course
CA16R405 - Mobile Application Development (Theory)
Android Developer Fundamentals V2 Lesson 1
Android Application Development
CIS 470 Mobile App Development
Emerging Platform#3 Android & Programming an App
Mobile Programmming Dr. Mohsin Ali Memon.
Android Development Introduction to Android Development 2011/01/16
Android Sensor Programming
CA16R405 - Mobile Application Development (Theory)
Presentation transcript:

HUJI Post PC Workshop 1 Introduction to Android Development Ari Sprung arisprung@gmail.com

Workshops Structure Workshop 1 – Introduction Setting up, basic app, views, layouts Workshop 2 – Adapters and Menus Resources, adapter views, menus, unit testing Workshop 3 – Activities Multiple activities, dialogs, intents Workshop 4 – Persistence SQLite, cursors, backend-as-a-service Workshop 5 – Threading Files, threads, web services

Prerequisites and Homework What you need to know: Java programming, collections, files, etc. Database basics, tables, SQL Homework will involve: Application development Activity testing Using source control

Make Sure You’re OK With This: Thread t = new Thread(new Runnable() { public void run() { Connection c = DriverManager.getConnection(...); Statement s = c.createStatement(); ResultSet r = s.executeQuery( “SELECT name, AVERAGE(grade) avg “ + “FROM students GROUP BY grade “ + “ORDER BY avg DESC”); while (r.next()) { ... } } }); t.start();

Before We Begin… You can’t learn from the slides. The slides are a learning aid, and they will not contain all the information discussed in class. You still have to come to class and use additional reading to fill the gaps.

Android Architecture

Versions and API Levels Considerable fragmentation API levels correspond to each version

Setting Up Dev Environment Download the Android Studio for your OS http://developer.android.com/sdk/index.html Contains Eclipse and Android SDK Use SDK Manager to download multiple versions of Android Use AVD Manager to create emulator images for various versions(not recommend). Genny Motion https://www.genymotion.com

Demonstration: Dev Tools Studio SDK Manager Gradle Emulator

Hello World App Components src – your package’s sources gen – code generated by the compiler Do not touch this res – resources: images, strings, layouts res/layout/main.xml – your main UI AndroidManifest.xml – app description bin – binary products, including your apk

Application Components Activity Screen, form – usually full-screen, one at a time Activity subclass View Anything that appears on the screen: button, edit box (EditText), label (TextView) Layout A component that manages a bunch of views and decides how to position and draw them

Code-Layout Separation Your view lives in XML files (layouts) Your code lives in Java files Your view communicates with your code through listeners Your code communicates with your view through object references <Button android:text=“Click me” android:id=“@+id/btn1” /> final Button b = (Button) findViewById(R.id.btn1); b.setOnClickListener( new OnClickListener() { public void onClick(View v) { b.setText(“Thanks!”); } });

Basic Views Explore the standard Android views and how they are declared in XML <Button android:text=“Button” /> <EditText android:hint=“phone” /> <CheckBox android:checked=“true” />

Basic Layouts LinearLayout stacks elements horizontally/vertically (orientation) It’s often very useful to nest layouts <LinearLayout android:orientation=“horizontal”> <ImageView android:layout_weight=“1” android:layout_height=“fill_parent” ... /> <TextView android:layout_weight=“2” <WebView ... /> </LinearLayout>

Basic Layouts RelativeLayout allows relative positioning of child elements <RelativeLayout> <ImageView android:id=“@+id/img” android:layout_width=“fill_parent” ... /> <TextView android:id=“@+id/txt” android:layout_below=“@id/img” android:layout_alignParentLeft=“true” <Button ... /> </RelativeLayout>

Demonstration: UI Events Your activity class’ onCreate method creates the UI from an XML file Then, retrieve views and use listeners public class MyActivity extends Activity { @Override public void onCreate(Bundle unused) { super.onCreate(unused); setContentView(R.layout.main); EditText ed = (EditText)findViewById(R.id.ed); ed.setOnTextChangeListener(...); Button btn = (Button)findViewById(R.id.btn); btn.setTextSize(14.0f); }

Demonstration: Source Control Source control: management of changes to source code Logical branching and versioning Development history, rollback Change tracking You will be using GitHub for your homework assignments and final projects Go to http://github.com, create an account For each homework, associate your username with the GitHub repository

Homework 1 Tip (12%) Calculator Fill submission form 12:38 Tip (12%) Calculator Package: il.ac.huji.tipcalculator Repo tag: v1 Activity: TipCalculatorActivity Fill submission form Pay attention to view ids: edtBillAmount chkRound btnCalculate txtTipResult 42.20 Bill Amount Round to nearest dollar Calculate Tip: $5 When rounding to nearest dollar, do not print decimal separator and any trailing digits. When not rounding to nearest dollar, ALWAYS print decimal separator and two trailing digits, e.g.: $6.00, $6.12

Additional Resources Tools workflow App fundamentals Layouts http://developer.android.com/tools/workflow/index.html App fundamentals http://developer.android.com/guide/components/fundamentals.html Layouts http://developer.android.com/guide/topics/ui/declaring-layout.html Handling input events http://developer.android.com/guide/topics/ui/ui-events.html Stack Overflow http://stackoverflow.com/