Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Similar documents
Produced by. Mobile Application Development. Eamonn de Leastar

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar


Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation

Tip Calculator. xmlns:tools=" android:layout_width="match_parent"

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 2

Create Parent Activity and pass its information to Child Activity using Intents.

MAD ASSIGNMENT NO 2. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept.

EMBEDDED SYSTEMS PROGRAMMING UI Specification: Approaches

Time Picker trong Android

Applied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB)

M.A.D ASSIGNMENT # 2 REHAN ASGHAR BSSE 15126

Fragments. Lecture 11

EMBEDDED SYSTEMS PROGRAMMING Android Services

Dynamically Create Admob Banner and Interstitial Ads

PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE)

Fragment Example Create the following files and test the application on emulator or device.

User Interface Development in Android Applications

ITU- FAO- DOA- TRCSL. Training on. Innovation & Application Development for E- Agriculture. Shared Preferences

Android - JSON Parser Tutorial

MAD ASSIGNMENT NO 3. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept.

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar

SD Module-1 Android Dvelopment

ANDROID PROGRAMS DAY 3

Produced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar

TextView Control. EditText Control. TextView Attributes. android:id - This is the ID which uniquely identifies the control.

ELET4133: Embedded Systems. Topic 15 Sensors

使用 TensorFlow 設計矩陣乘法計算並轉移執行在 Android 上 建國科技大學資管系 饒瑞佶 2017/8


Screen Slides. The Android Studio wizard adds a TextView to the fragment1.xml layout file and the necessary code to Fragment1.java.

Android - Widgets Tutorial

APPENDIX CODE TO STORE THE BUTTON MENU AND MOVE THE PAGE

Android Programs Day 5

05. RecyclerView and Styles

South Africa

StoppUhr. <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="start1"

// MainActivity.java ; Noah Spenser; Senior Design; Diabetic Breathalyzer

Android Application Development. By : Shibaji Debnath

Adapter.

Android UI Development

<uses-permission android:name="android.permission.internet" />

Intents. Your first app assignment

Mobile Application Development Lab [] Simple Android Application for Native Calculator. To develop a Simple Android Application for Native Calculator.

PROGRAMMING APPLICATIONS DECLARATIVE GUIS

Programming with Android: Introduction. Layouts. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Starting Another Activity Preferences

Android Apps Development for Mobile Game Lesson 5

Learning Android Canvas

Sizing and Positioning

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar

Chapter 5 Flashing Neon FrameLayout

Topics of Discussion

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar

Diving into Android. By Jeroen Tietema. Jeroen Tietema,

TPCT s College of Engineering, Osmanabad. Laboratory Manual SDL-II. Mobile Application Development (Android) For. Third Year Students (CSE)

android:layout_margintop="5dp" > <EditText android:layout_width="210dp"

Create a local SQL database hosting a CUSTOMER table. Each customer includes [id, name, phone]. Do the work inside Threads and Asynctasks.

Database Development In Android Applications

Produced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar

Arrays of Buttons. Inside Android

Produced by. Design Patterns. MSc Computer Science. Eamonn de Leastar

Introduction to Android Development

Produced by. Mobile Application Development. Eamonn de Leastar

Mobile Application Development MyRent Settings

Mobile Software Development for Android - I397

1. Location Services. 1.1 GPS Location. 1. Create the Android application with the following attributes. Application Name: MyLocation

Chapter 8 Positioning with Layouts

Mobile Computing Practice # 2c Android Applications - Interface

Debojyoti Jana (Roll ) Rajrupa Ghosh (Roll ) Sreya Sengupta (Roll )

An Overview of the Android Programming

Advanced Computer Networks. Project Report. Name - Rahul Deepak Prabhu NET ID - rdp Name - ShubhankarVenkatesh NET ID - sxv148130

else if(rb2.ischecked()) {

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 4. Workshop

1. Explain the architecture of an Android OS. 10M The following diagram shows the architecture of an Android OS.

<uses-permission android:name="android.permission.internet"/>

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar

android:orientation="horizontal" android:layout_margintop="30dp"> <Button android:text="button2"

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

Android App Development. Mr. Michaud ICE Programs Georgia Institute of Technology

Fragments. Lecture 10

ActionBar. import android.support.v7.app.actionbaractivity; public class MyAppBarActivity extends ActionBarActivity { }

ListView Containers. Resources. Creating a ListView

Android Navigation Drawer for Sliding Menu / Sidebar

Tablets have larger displays than phones do They can support multiple UI panes / user behaviors at the same time

Lecture 14. Android Application Development

Creating a Custom ListView

Programming with Android: Layouts, Widgets and Events. Dipartimento di Scienze dell Informazione Università di Bologna

ANDROID USER INTERFACE

Meniu. Create a project:

Our First Android Application

Basic GUI elements - exercises

Produced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar

Transcription:

Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie

donation-android case study

3

Layout TextView Button RadioGroup ProgressBar NumberPicker 4

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".donate" > <TextView android:id="@+id/donatetitle" android:layout_alignparentleft="true" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:text="@string/donatetitle" android:textappearance="?android:attr/textappearancelarge" /> <TextView android:id="@+id/donatesubtitle" android:layout_alignparentleft="true" android:layout_alignparentright="true" android:layout_below="@+id/donatetitle" android:text="@string/donatesubtitle" android:textappearance="?android:attr/textappearancemedium" /> <Button android:id="@+id/donatebutton" android:layout_alignparentbottom="true" android:layout_centerhorizontal="true" android:onclick="donatebuttonpressed" android:text="@string/donatebutton" /> <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">donation</string> <string name="action_settings">settings</string> <string name="donatetitle">welcome Homer</string> <string name="donatesubtitle">please give generously</string> <string name="donatebutton">donate</string> <string name="paypal">paypal</string> <string name="direct">direct</string> </resources> <RadioGroup android:id="@+id/paymentmethod" android:layout_above="@+id/progressbar" android:layout_alignleft="@+id/donatesubtitle" android:layout_below="@+id/donatesubtitle" android:layout_marginleft="14dp" android:layout_margintop="26dp" android:layout_toleftof="@+id/amountpicker" > <RadioButton android:id="@+id/paypal" android:checked="true" android:text="@string/paypal" /> <RadioButton android:id="@+id/direct" android:text="@string/direct" /> </RadioGroup> <ProgressBar android:id="@+id/progressbar" style="?android:attr/progressbarstylehorizontal" android:layout_above="@+id/donatebutton" android:layout_alignparentleft="true" android:layout_alignparentright="true" android:layout_marginbottom="67dp" /> <NumberPicker android:id="@+id/amountpicker" android:layout_alignright="@+id/donatesubtitle" android:layout_aligntop="@+id/paymentmethod" /> </RelativeLayout> xml files 5

Keep track of the outline view Give appropriate names to each control 6

public class Donate extends Activity private int totaldonated = 0; private RadioGroup paymentmethod; private ProgressBar progressbar; private NumberPicker amountpicker; @Override protected void oncreate(bundle savedinstancestate) super.oncreate(savedinstancestate); setcontentview(r.layout.activity_donate); paymentmethod = (RadioGroup) findviewbyid(r.id.paymentmethod); progressbar = (ProgressBar) findviewbyid(r.id.progressbar); amountpicker = (NumberPicker) findviewbyid(r.id.amountpicker); amountpicker.setminvalue(0); amountpicker.setmaxvalue(1000); progressbar.setmax(10000); @Override public boolean oncreateoptionsmenu(menu menu) getmenuinflater().inflate(r.menu.donate, menu); return true; public void donatebuttonpressed (View view) totaldonated = totaldonated + amountpicker.getvalue(); String method = paymentmethod.getcheckedradiobuttonid() == R.id.PayPal? "PayPal" : "Direct"; progressbar.setprogress(totaldonated); Log.v("Donate", amountpicker.getvalue() + " donated by " + method + "\ncurrent total " + totaldonated); 7

public class Donate extends Activity private int totaldonated = 0; private RadioGroup paymentmethod; private ProgressBar progressbar; private NumberPicker amountpicker; @Override protected void oncreate(bundle savedinstancestate) super.oncreate(savedinstancestate); setcontentview(r.layout.activity_donate); paymentmethod = (RadioGroup) findviewbyid(r.id.paymentmethod); progressbar = (ProgressBar) findviewbyid(r.id.progressbar); amountpicker = (NumberPicker) findviewbyid(r.id.amountpicker); amountpicker.setminvalue(0); amountpicker.setmaxvalue(1000); progressbar.setmax(10000); @Override public boolean oncreateoptionsmenu(menu menu) getmenuinflater().inflate(r.menu.donate, menu); return true; public void donatebuttonpressed (View view) totaldonated = totaldonated + amountpicker.getvalue(); String method = paymentmethod.getcheckedradiobuttonid() == R.id.PayPal? "PayPal" : "Direct"; progressbar.setprogress(totaldonated); Log.v("Donate", amountpicker.getvalue() + " donated by " + method + "\ncurrent total " + totaldonated); 8

public class Donate extends Activity private int totaldonated = 0; private RadioGroup paymentmethod; private ProgressBar progressbar; private NumberPicker amountpicker; @Override protected void oncreate(bundle savedinstancestate) super.oncreate(savedinstancestate); setcontentview(r.layout.activity_donate); paymentmethod = (RadioGroup) findviewbyid(r.id.paymentmethod); progressbar = (ProgressBar) findviewbyid(r.id.progressbar); amountpicker = (NumberPicker) findviewbyid(r.id.amountpicker); amountpicker.setminvalue(0); amountpicker.setmaxvalue(1000); progressbar.setmax(10000); @Override public boolean oncreateoptionsmenu(menu menu) getmenuinflater().inflate(r.menu.donate, menu); return true; public void donatebuttonpressed (View view) totaldonated = totaldonated + amountpicker.getvalue(); String method = paymentmethod.getcheckedradiobuttonid() == R.id.PayPal? "PayPal" : "Direct"; progressbar.setprogress(totaldonated); Log.v("Donate", amountpicker.getvalue() + " donated by " + method + "\ncurrent total " + totaldonated); 9

Donate Button Event Handler <Button android:id="@+id/donatebutton" android:layout_alignparentbottom="true" android:layout_centerhorizontal="true" android:onclick="donatebuttonpressed" android:text="@string/donatebutton" /> public class Donate extends Activity //... public void donatebuttonpressed (View view) totaldonated = totaldonated + amountpicker.getvalue(); String method = paymentmethod.getcheckedradiobuttonid() == R.id.PayPal? "PayPal" : "Direct"; progressbar.setprogress(totaldonated); Log.v("Donate", amountpicker.getvalue() + " donated by " + method + "\ncurrent total " + totaldonated); 10

11

12

13

14

Except where otherwise noted, this content is licensed under a Creative Commons Attribution-NonCommercial 3.0 License. For more information, please see http:// creativecommons.org/licenses/by-nc/3.0/