Android GUI Project John Hurley CS 454.

Slides:



Advertisements
Similar presentations
Android Application Development A Tutorial Driven Course.
Advertisements

Google Android Introduction to Mobile Computing. Android is part of the build a better phone process Open Handset Alliance produces Android Comprises.
Android architecture overview
Joemarie Comeros Amparo Android Development Orientation for Starters.
Android Aims to bring Internet-style innovation and openness to mobile phones.
All About Android Introduction to Android 1. Creating a New App “These aren’t the droids we’re looking for.” Obi-wan Kenobi 1. Bring up Eclipse. 2. Click.
Application Fundamentals. See: developer.android.com/guide/developing/building/index.html.
DEPARTMENT OF COMPUTER ENGINEERING
ANDROID OPERATING SYSTEM Guided By,Presented By, Ajay B.N Somashekar B.T Asst Professor MTech 2 nd Sem (CE)Dept of CS & E.
User Interface Android Applications. Activities An activity presents a visual user interface. Each activity is given a default window to draw in. The.
Google Android as a mobile development platform T Internet Technologies for Mobile Computing Olli Mäkinen.
Basic, Basic, Basic Android. What are Packages? Page 346 in text Package statement goes before any import statements Indicates that the class declared.
Android GUI Project John Hurley CS 454. Android 1. Android Basics 2. Android Development 3. Android UI 4. Hello, World 5. My Project.
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
App Development for Android Prabhaker Mateti. Development Tools (Android) Java – Java is the same. But, not all libs are included. – Unused: Swing, AWT,
Android Application Development with Java UPenn CS4HS 2011 Chris Murphy
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
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,
@2011 Mihail L. Sichitiu1 Android Introduction Hello World.
Emerging Platform#4: Android Bina Ramamurthy.  Android is an Operating system.  Android is an emerging platform for mobile devices.  Initially developed.
1 Mobile Software Development Framework: Android Activity, View/ViewGroup, External Resources, Listener 10/9/2012 Y. Richard Yang.
Android Introduction Platform Overview.
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 and Eclipse Thaddeus Diamond CPSC 112. A Quick Introduction Eclipse is an IDE (Integrated Development Environment Open Source Much more full-featured.
Mobile Application Development with ANDROID Tejas Lagvankar UMBC 29 April 2009.
Mobile Application Development with ANDROID. Agenda Mobile Application Development (MAD) Intro to Android platform Platform architecture Application building.
About me Yichuan Wang Android Basics Credit goes to Google and UMBC.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
@2011 Mihail L. Sichitiu1 Android Introduction Platform Overview.
Introduction CIS 136 Building Mobile Apps 1. What is a mobile app? 2  Computer program  Designed for small devices  Smartphones  Tablets  Other handhelds.
Operating system for mobile devices with a Java programming interface. Provides tools, e.g. a compiler, debugger, device emulator, and its own Java Virtual.
Copyright© Jeffrey Jongko, Ateneo de Manila University Android.
Mobile Application Development using Android Lecture 2.
DUE Hello World on the Android Platform.
Android for Java Developers Denver Java Users Group Jan 11, Mike
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
INTRODUCTION TO ANDROID. Slide 2 Application Components An Android application is made of up one or more of the following components Activities We will.
Configuring Android Development Environment Nilesh Singh.
ANDROID – A FIRST PROGRAM L. Grewe Using AndroidStudio –basic Android  Lets do a “Hello World Project”  Start up AndroidStudio (assume you have installed.
1 Android Introduction Platform Overview. 2 What is Android?  Android is a software stack for mobile devices that includes an operating system, middleware.
CHAPTER 1 part 1 Introduction. Chapter objectives: Understand Android Learn the differences between Java and Android Java Examine the Android project.
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.
The Basics of Android App Development Sankarshan Mridha Satadal Sengupta.
Android Programming.
Intro To Android Programming
Android Mobile Application Development
Android Application -Architecture.
Android Introduction Hello World
Android 01: Fundamentals
Android Application Development 1 6 May 2018
Android N Amanquah.
Android Introduction Hello World.
Android.
MAD.
Development-Introduction
CA16R405 - Mobile Application Development (Theory)
CMPE419 Mobile Application Development
תכנות ב android אליהו חלסצ'י.
Android GUI Project John Hurley CS 454.
Application Development A Tutorial Driven Course
CHAPTER 1 Introduction Chapter objectives: Understand what Android is
Android Developer Fundamentals V2
Android Platform, Android App Basic Components
Emerging Platform#3 Android & Programming an App
Android Overview.
Cosc 4730 An Introduction.
Android Development Introduction to Android Development 2011/01/16
CMPE419 Mobile Application Development
Presentation transcript:

Android GUI Project John Hurley CS 454

Android 1. Android Basics 2. Android Development 3. Android UI 4. Hello, World 5. My Project

Android Basics Open source OS Uses Linux kernel Optimized for limited-resource environment Apps typically written in Java Apps run on the Dalvik Virtual Machine Not a JVM, but works similarly from developer’s point of view Usually one app per DVM Each DVM runs under Linux as a separate user App permissions set at install time Possible to use C or C++ compiled to machine code, but still runs on VM. It’s not clear to me how this works. Docs say it does not necessarily improve performance.

Copyright ©2010 Lauren Darcey and Shane Conder Sams Teach Yourself Android™Application Development in 24 Hours (0321673352) FIGURE 5.6 Simplified Android platform architecture from a security perspective. Copyright ©2010 Lauren Darcey and Shane Conder

Android Development Well-defined framework for app development Apps are typically coded using Java syntax, but other parts of the Java platform are missing Some standard Java SE or ME APIs and class libraries are not included I will give examples when I find out!

Android Development Standard development environment is Eclipse + Android Development Tools plugin + Android SDK Development requires either an Android OS device or an emulator Emulator has limitations: Performance is poor Camera, etc., simulated using your computer’s hardware No real phone calls or texts GPS data, battery readings, etc. must be simulated Real device is affected by specific hardware and software configuration

Android vs. Other Mobile OS I was able to choose what kind of smart phone to get according to which platform I wanted to use to try mobile development Android: I had Java backend code ready to go for a first project Interesting platform: Familiar programming environment Currently the market leader Broad market, unlike more focused iOS, Blackberry, and (Palm) webOS Development tools are open source and are free even for commercial use, unlike Visual Studio

Android App vs. Mobile- Optimized RIA Android Flash plugins available; Silverlight coming soon Could develop in JavaScript and/or HTML5 WWW App Easier for users to run; no need to install For a paid app, avoid the 30% App Store commission Easier to write cross-platform apps Android Apps Fewer security hurdles Use APIs for access to built in GPS, camera, etc. Probably better performance; one layer less

Android Apps: Marketing Usually market apps through Android App Market There are other markets, also App store will dominate the market due to access through built in app Can set up for download directly on a website User must agree to “install apps from unknown sources”

Android Apps: Marketing Revenue from app sales prices and/or advertising Conventional wisdom is that iOS users will pay for apps, but Android users won’t 57% of Android App Store apps are free, vs. 28% for Apple App Store Android Market takes 30% commission Any purchase model other than one-time purchase must be homegrown, using Paypal or similar service PPC ads My guess is that response to these is extremely low Probably need to be very aggressive with banner ads Sell to companies?

Android Deployment Apps are packaged in .apk format, variant of .jar, then downloaded to device and installed .apks contain .dex files (bytecode), manifest and various other files Manifest contains security and link info, hardware access info, minimum OS release info, etc.

Android UI Activity: single screen with a UI, somewhat analogous to XAML / code behind pattern in .NET Email app might have one activity that shows a list of new emails, another activity to compose an email, and another activity for reading emails Implement by subclassing Activity class View: drawable object Android UI View ≠ MVC View UI contains a hierarchy of Views View is a class, subclassed by the drawable objects in the UI

Android UI Service: background operation play music in the background while the user is in a different application fetch data over the network without blocking user interaction with an activity Content Provider: DB or other data access Broadcast Receiver: responds to system messages Battery low

Android UI UI construction can be done in three ways: Programmatic, like hand-coded Java desktop GUI construction Declarative hand-written, like Java web UI construction XML Declarative with a GUI builder, like .NET UI construction GUI builder generates the XML

Programmatic UI package cs454.demo; import android.app.Activity; import android.widget.TextView; import android.os.Bundle; public class AndroidDemo extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Activity is a subclass of context, so the TextView takes this as a parameter TextView tv = new TextView(this); tv.setText("Hello, CS454"); setContentView(tv); }

Manual Declarative UI main.xml Layout File: <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/textview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="@string/hello"/> strings.xml resource file: <resources> <string name="hello">Hello Again, CS454!</string> <string name="app_name">CS454 AndroidDemo</string> </resources>

Manual Declarative UI package cs454.demo; import android.app.Activity; Java class: package cs454.demo; import android.app.Activity; import android.os.Bundle; public class AndroidDemo extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); }

What’s R? /* AUTO-GENERATED FILE. DO NOT MODIFY. This class was automatically generated by the * aapt tool from the resource data it found. It should not be modified by hand. */ package cs454.demo; public final class R { public static final class attr { } public static final class drawable { public static final int icon=0x7f020000; public static final class id { public static final int textview=0x7f050000; public static final class layout { public static final int main=0x7f030000; public static final class string { public static final int app_name=0x7f040001; public static final int hello=0x7f040000;

UI With GUI Builder

Android Event Handlers From the code file for the activity: Button ok = (Button) findViewById(R.id.button1); ok.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { CharSequence s = et.getText(); tv.setText("Welcome, " + s); } });

Copyright ©2010 Lauren Darcey and Shane Conder Sams Teach Yourself Android™Application Development in 24 Hours (0321673352) FIGURE 3.2 Important callback methods of the activity life cycle. Copyright ©2010 Lauren Darcey and Shane Conder

APIs for Android built-ins Android OS ships with many built in apps Web Browser Google Maps Navigation Camera apps Built in access for these as well as TTS and Voice Recognition, etc.

Demo

My Project Goats and Tigers is a board game, which we implemented in Java in CS 460 last term. The objective in CS460 was to implement the minmax / alpha beta pruning algorithm for the automatic player, not to create a good UI My existing interface shows an ASCII art picture of the board and provides a JOptionPane menu of available moves I will develop an Android UI and use my existing backend code as much as possible

References http://www.ibm.com/developerworks/opensource/library/os-android-devel/ http://developer.android.com/resources/browser.html?tag=tutorial Conder and Darcey, Android Wireless Application Development, Addison-Wesley, 2010 Conder and Darcey, Sams Teach Yourself Android Application Development in 24 Hours, Sams, 2010