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

Size: px
Start display at page:

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

Transcription

1 CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015 Comment and Evaluation: This lab introduces us about Android SDK and how to write a program for Android platform. The calculator is pretty easy, everything mostly come from the instructions. The fragment program explanation is already on Youtube, anyway we think it s a good lab to begin with Android SDK. Evaluation: We have done everything in the lab successfully, therefore, I would rate our works 30/30. I. A Simple Calculator 4. Compile and run the program: First we copied pasted all the code from instructions, and here is the Running Program: Minus Add

2 Multiple Divide. 5. Modify the above code so that the buttons of the operators are replaced by images of them. First we add 4 image of +, -, x, / button into workspace/calculator/res/ drawable-hdpi directory. Then we change Button to ImageButton to display button as an image. Code: //MainActivity.java import android.widget.imagebutton; public class MainActivity extends Activity implements View.OnClickListener{ EditText t1; EditText t2; ImageButton plus; ImageButton minus; ImageButton multiply; ImageButton divide; TextView displayresult;

3 String oper = ""; /** Called when the activity is first created. public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // find the EditText elements (defined in res/layout/activity_main.xml t1 = (EditText) findviewbyid(r.id.t1); t2 = (EditText) findviewbyid(r.id.t2); plus = (ImageButton) findviewbyid(r.id.plus); minus = (ImageButton) findviewbyid(r.id.minus); multiply = (ImageButton) findviewbyid(r.id.multiply); divide = (ImageButton) findviewbyid(r.id.divide); displayresult = (TextView) findviewbyid(r.id.displayresult); // set listeners plus.setonclicklistener( this ); minus.setonclicklistener( this); multiply.setonclicklistener( this); divide.setonclicklistener( this); //activity_main.xml <LinearLayout android:id="@+id/linearlayout2" android:layout_margintop="4pt" android:layout_marginleft="6pt" android:layout_marginright="6pt"> <ImageButton android:id="@+id/minus" android:layout_width="90dp" android:layout_height="90dp" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:layout_marginright="40dp" android:adjustviewbounds="true" android:background="@drawable/minus" android:scaletype="centercrop"

4 />// here we load the minus image from src. <ImageButton android:layout_width="90dp" android:layout_height="90dp" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:layout_marginleft="37dp" android:adjustviewbounds="true" android:scaletype="centercrop" /> //here we load the add image from src. <LinearLayout android:layout_margintop="4pt" android:layout_marginleft="6pt" android:layout_marginright="6pt"> <ImageButton android:layout_width="90dp" android:layout_height="90dp" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:layout_marginright="40dp" android:adjustviewbounds="true" android:scaletype="centercrop" /> //here we load the devide image from src. <ImageButton android:layout_width="90dp" android:layout_height="90dp" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:layout_marginleft="37dp" android:adjustviewbounds="true" android:scaletype="centercrop" /> //here we load the multiply image from src.

5 Running Program: Add Devide

6 Minus Multiply II. Android Fragments We added 2 java class: FragmentA and FragmentB, then we added 2 xml linear layout: fragment_a and fragment_b. Code: //MainActivity.java public class MainActivity extends FragmentActivity protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); FragmentManager myfragmentmanager = getsupportfragmentmanager();

7 FragmentTransaction fragmenttransaction = myfragmentmanager.begintransaction(); FragmentA fragmenta = new FragmentA();//Set default as fragment A fragmenttransaction.add(r.id.fragment_placeholder, fragmenta); fragmenttransaction.commit(); //This procedure do the swap between fragment A and B. public void selectfragment(view v) { Fragment newfragment; if (v == findviewbyid(r.id.buttona)) { newfragment = new FragmentA(); //else if (v == findviewbyid(r.id.buttonb)) { else { newfragment = new FragmentB(); FragmentManager myfragmentmanager = getsupportfragmentmanager(); FragmentTransaction fragmenttransaction = myfragmentmanager.begintransaction(); fragmenttransaction.replace(r.id.fragment_placeholder, newfragment); fragmenttransaction.addtobackstack(null); fragmenttransaction.commit(); //FragmentA.java package example.fragment; import android.os.bundle; import android.support.v4.app.fragment; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; public class FragmentA extends Fragment public View oncreateview(layoutinflater inflater, ViewGroup container, Bundle savedinstancestate) { // Inflate the layout for this fragment return inflater.inflate(r.layout.fragment_a, container, false);

8 //FragmentB.java package example.fragment; import android.os.bundle; import android.support.v4.app.fragment; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; public class FragmentB extends Fragment public View oncreateview(layoutinflater inflater, ViewGroup container, Bundle savedinstancestate) { // Inflate the layout for this fragment return inflater.inflate(r.layout.fragment_b, container, false); //fragment_b.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=" android:layout_height="match_parent" android:background="#00ffff"//here to set color for fragment B android:orientation="vertical" > <TextView android:id="@+id/textview1" android:layout_width="wrap_content" android:text="i am Fragment B" android:textappearance="?android:attr/textappearancelarge" /> //fragment_a.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=" android:layout_height="match_parent" android:background="#ff9999"//here to set color for fragment A android:orientation="vertical" >

9 <TextView android:layout_width="wrap_content" android:text="i am Fragment A" android:textappearance="?android:attr/textappearancelarge" > </TextView> //activity_main.xml <LinearLayout xmlns:android=" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <LinearLayout android:orientation="vertical" > <Button // Fragment B swap button android:id="@+id/buttona" android:onclick="selectfragment" android:text="fragment A" /> <Button // Fragment A swap button android:id="@+id/buttonb" android:onclick="selectfragment" android:text="fragment B" /> <LinearLayout // Display the fragment. android:id="@+id/fragment_placeholder" android:layout_height="match_parent" android:orientation="vertical" >

10 Running Program: Fragment A Fragment B

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

Fragment Example Create the following files and test the application on emulator or device. Fragment Example Create the following files and test the application on emulator or device. File: AndroidManifest.xml

More information

CSE 660 Lab 7. Submitted by: Arumugam Thendramil Pavai. 1)Simple Remote Calculator. Server is created using ServerSocket class of java. Server.

CSE 660 Lab 7. Submitted by: Arumugam Thendramil Pavai. 1)Simple Remote Calculator. Server is created using ServerSocket class of java. Server. CSE 660 Lab 7 Submitted by: Arumugam Thendramil Pavai 1)Simple Remote Calculator Server is created using ServerSocket class of java Server.java import java.io.ioexception; import java.net.serversocket;

More information

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

Mobile Application Development Lab [] Simple Android Application for Native Calculator. To develop a Simple Android Application for Native Calculator. Simple Android Application for Native Calculator Aim: To develop a Simple Android Application for Native Calculator. Procedure: Creating a New project: Open Android Stdio and then click on File -> New

More information

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

ITU- FAO- DOA- TRCSL. Training on. Innovation & Application Development for E- Agriculture. Shared Preferences ITU- FAO- DOA- TRCSL Training on Innovation & Application Development for E- Agriculture Shared Preferences 11 th - 15 th December 2017 Peradeniya, Sri Lanka Shahryar Khan & Imran Tanveer, ITU Experts

More information

Intents. Your first app assignment

Intents. Your first app assignment Intents Your first app assignment We will make this. Decidedly lackluster. Java Code Java Code XML XML Preview XML Java Code Java Code XML Buttons that work

More information

Basic GUI elements - exercises

Basic GUI elements - exercises Basic GUI elements - exercises https://developer.android.com/studio/index.html LIVE DEMO Please create a simple application, which will be used to calculate the area of basic geometric figures. To add

More information

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation EMBEDDED SYSTEMS PROGRAMMING 2016-17 Application Tip: Managing Screen Orientation ORIENTATIONS Portrait Landscape Reverse portrait Reverse landscape ON REVERSE PORTRAIT Android: all four orientations are

More information

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

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 2 Workshop 1. Compare different layout by using Change Layout button (Page 1 5) Relative Layout Linear Layout (Horizontal) Linear Layout (Vertical) Frame Layout 2. Revision on basic programming skill - control

More information

Fragments. Lecture 11

Fragments. Lecture 11 Fragments Lecture 11 Situational layouts Your app can use different layouts in different situations Different device type (tablet vs. phone vs. watch) Different screen size Different orientation (portrait

More information

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

Create Parent Activity and pass its information to Child Activity using Intents. Create Parent Activity and pass its information to Child Activity using Intents. /* MainActivity.java */ package com.example.first; import android.os.bundle; import android.app.activity; import android.view.menu;

More information

Android CardView Tutorial

Android CardView Tutorial Android CardView Tutorial by Kapil - Wednesday, April 13, 2016 http://www.androidtutorialpoint.com/material-design/android-cardview-tutorial/ YouTube Video We have already discussed about RecyclerView

More information

Lampiran Program : Res - Layout Activity_main.xml

More information

Android HelloWorld - Example. Tushar B. Kute,

Android HelloWorld - Example. Tushar B. Kute, Android HelloWorld - Example Tushar B. Kute, http://tusharkute.com Anatomy of Android Application Anatomy of Android Application Java This contains the.java source files for your project. By default, it

More information

M.A.D Assignment # 1

M.A.D Assignment # 1 Submitted by: Rehan Asghar Roll no: BSSE (7) 15126 M.A.D Assignment # 1 Submitted to: Sir Waqas Asghar Submitted by: M. Rehan Asghar 4/25/17 Roll no: BSSE 7 15126 XML Code: Calculator Android App

More information

Multiple devices. Use wrap_content and match_parent Use RelativeLayout/ConstraintLayout Use configuration qualifiers

Multiple devices. Use wrap_content and match_parent Use RelativeLayout/ConstraintLayout Use configuration qualifiers Multiple devices Multiple devices Use wrap_content and match_parent Use RelativeLayout/ConstraintLayout Use configuration qualifiers Create a new directory in your project's res/ and name it using the

More information

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

<uses-permission android:name=android.permission.internet/> Chapter 11 Playing Video 11.1 Introduction We have discussed how to play audio in Chapter 9 using the class MediaPlayer. This class can also play video clips. In fact, the Android multimedia framework

More information

Programming with Android: Android for Tablets. Dipartimento di Scienze dell Informazione Università di Bologna

Programming with Android: Android for Tablets. Dipartimento di Scienze dell Informazione Università di Bologna Programming with Android: Android for Tablets Luca Bedogni Marco Di Felice Dipartimento di Scienze dell Informazione Università di Bologna Outline Android for Tablets: A Case Study Android for Tablets:

More information

UI Fragment.

UI Fragment. UI Fragment 1 Contents Fragments Overviews Lifecycle of Fragments Creating Fragments Fragment Manager and Transactions Adding Fragment to Activity Fragment-to-Fragment Communication Fragment SubClasses

More information

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

TextView Control. EditText Control. TextView Attributes. android:id - This is the ID which uniquely identifies the control. A TextView displays text to the user. TextView Attributes TextView Control android:id - This is the ID which uniquely identifies the control. android:capitalize - If set, specifies that this TextView has

More information

Android Application Development. By : Shibaji Debnath

Android Application Development. By : Shibaji Debnath Android Application Development By : Shibaji Debnath About Me I have over 10 years experience in IT Industry. I have started my career as Java Software Developer. I worked in various multinational company.

More information

Android UI Development

Android UI Development Android UI Development Android UI Studio Widget Layout Android UI 1 Building Applications A typical application will include: Activities - MainActivity as your entry point - Possibly other activities (corresponding

More information

Action Bar. (c) 2010 Haim Michael. All Rights Reserv ed.

Action Bar. (c) 2010 Haim Michael. All Rights Reserv ed. Action Bar Introduction The Action Bar is a widget that is shown on top of the screen. It includes the application logo on its left side together with items available from the options menu on the right.

More information

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

ActionBar. import android.support.v7.app.actionbaractivity; public class MyAppBarActivity extends ActionBarActivity { } Android ActionBar import android.support.v7.app.actionbaractivity; public class MyAppBarActivity extends ActionBarActivity { Layout, activity.xml

More information

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

Android App Development. Mr. Michaud ICE Programs Georgia Institute of Technology Android App Development Mr. Michaud ICE Programs Georgia Institute of Technology Android Operating System Created by Android, Inc. Bought by Google in 2005. First Android Device released in 2008 Based

More information

ANDROID PROGRAMS DAY 3

ANDROID PROGRAMS DAY 3 ANDROID PROGRAMS DAY 3 //Android project to navigate from first page to second page using Intent Step 1: Create a new project Step 2: Enter necessary details while creating project. Step 3: Drag and drop

More information

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

MAD ASSIGNMENT NO 3. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. MAD ASSIGNMENT NO 3 Submitted by: Rehan Asghar BSSE 7 15126 AUGUST 25, 2017 SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. MainActivity.java File package com.example.tutorialspoint; import android.manifest;

More information

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State EMBEDDED SYSTEMS PROGRAMMING 2016-17 Application Tip: Saving State THE PROBLEM How to save the state (of a UI, for instance) so that it survives even when the application is closed/killed The state should

More information

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 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

More information

COMP4521 EMBEDDED SYSTEMS SOFTWARE

COMP4521 EMBEDDED SYSTEMS SOFTWARE COMP4521 EMBEDDED SYSTEMS SOFTWARE LAB 1: DEVELOPING SIMPLE APPLICATIONS FOR ANDROID INTRODUCTION Android is a mobile platform/os that uses a modified version of the Linux kernel. It was initially developed

More information

Android Programs Day 5

Android Programs Day 5 Android Programs Day 5 //Android Program to demonstrate the working of Options Menu. 1. Create a New Project. 2. Write the necessary codes in the MainActivity.java to create OptionMenu. 3. Add the oncreateoptionsmenu()

More information

Practical 1.ListView example

Practical 1.ListView example Practical 1.ListView example In this example, we show you how to display a list of fruit name via ListView. Android Layout file File : res/layout/list_fruit.xml

More information

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

android:orientation=horizontal android:layout_margintop=30dp> <Button android:text=button2 Parametrų keitimas veikiančioje aplikacijoje Let s create a project: Project name: P0181_DynamicLayout3 Build Target: Android 2.3.3 Application name: DynamicLayout3 Package name: ru.startandroid.develop.dynamiclayout3

More information

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

Programming with Android: Introduction. Layouts. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna Programming with Android: Introduction Layouts Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna Views: outline Main difference between a Drawable and

More information

Statistics http://www.statista.com/topics/840/smartphones/ http://www.statista.com/topics/876/android/ http://www.statista.com/statistics/271774/share-of-android-platforms-on-mobile-devices-with-android-os/

More information

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs EMBEDDED SYSTEMS PROGRAMMING 2015-16 Application Tip: Switching UIs THE PROBLEM How to switch from one UI to another Each UI is associated with a distinct class that controls it Solution shown: two UIs,

More information

Adaptation of materials: dr Tomasz Xięski. Based on presentations made available by Victor Matos, Cleveland State University.

Adaptation of materials: dr Tomasz Xięski. Based on presentations made available by Victor Matos, Cleveland State University. Creating dialogs Adaptation of materials: dr Tomasz Xięski. Based on presentations made available by Victor Matos, Cleveland State University. Portions of this page are reproduced from work created and

More information

Topics of Discussion

Topics of Discussion Reference CPET 565 Mobile Computing Systems CPET/ITC 499 Mobile Computing Fragments, ActionBar and Menus Part 3 of 5 Android Programming Concepts, by Trish Cornez and Richard Cornez, pubslihed by Jones

More information

Lecture 14. Android Application Development

Lecture 14. Android Application Development Lecture 14 Android Application Development Notification Instructor Muhammad Owais muhammad.owais@riphah.edu.pk Cell: 03215500223 Notifications Used to notify user for events Three general forms of Notifications

More information

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

Applied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB) Applied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB) In this exercise, we will create a simple Android application that uses IBM Bluemix Cloudant NoSQL DB. The application

More information

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

TPCT s College of Engineering, Osmanabad. Laboratory Manual SDL-II. Mobile Application Development (Android) For. Third Year Students (CSE) TPCT s College of Engineering, Osmanabad Laboratory Manual SDL-II Mobile Application Development (Android) For Third Year Students (CSE) Manual Prepared by Prof. Sujata A. Gaikwad Author COE, Osmanabad

More information

Arrays of Buttons. Inside Android

Arrays of Buttons. Inside Android Arrays of Buttons Inside Android The Complete Code Listing. Be careful about cutting and pasting.

More information

Vienos veiklos būsena. Theory

Vienos veiklos būsena. Theory Vienos veiklos būsena Theory While application is running, we create new Activities and close old ones, hide the application and open it again and so on, and Activity can process all these events. It is

More information

EMBEDDED SYSTEMS PROGRAMMING UI Specification: Approaches

EMBEDDED SYSTEMS PROGRAMMING UI Specification: Approaches EMBEDDED SYSTEMS PROGRAMMING 2016-17 UI Specification: Approaches UIS: APPROACHES Programmatic approach: UI elements are created inside the application code Declarative approach: UI elements are listed

More information

Mobile Computing Fragments

Mobile Computing Fragments Fragments APM@FEUP 1 Fragments (1) Activities are used to define a full screen interface and its functionality That s right for small screen devices (smartphones) In bigger devices we can have more interface

More information

Adapter.

Adapter. 1 Adapter An Adapter object acts as a bridge between an AdapterView and the underlying data for that view The Adapter provides access to the data items The Adapter is also responsible for making a View

More information

Software Practice 3 Before we start Today s lecture Today s Task Team organization

Software Practice 3 Before we start Today s lecture Today s Task Team organization 1 Software Practice 3 Before we start Today s lecture Today s Task Team organization Prof. Hwansoo Han T.A. Jeonghwan Park 43 2 Lecture Schedule Spring 2017 (Monday) This schedule can be changed M A R

More information

Manifest.xml. Activity.java

Manifest.xml. Activity.java Dr.K.Somasundaram Ph.D Professor Department of Computer Science and Applications Gandhigram Rural Institute, Gandhigram, Tamil Nadu-624302, India ka.somasundaram@gmail.com Manifest.xml

More information

Introduction to Android Development

Introduction to Android Development Introduction to Android Development What is Android? Android is the customizable, easy to use operating system that powers more than a billion devices across the globe - from phones and tablets to watches,

More information

Dynamically Create Admob Banner and Interstitial Ads

Dynamically Create Admob Banner and Interstitial Ads Dynamically Create Admob Banner and Interstitial Ads activity_main.xml file 0 0 0

More information

Android Layout Types

Android Layout Types Android Layout Types Android Linear Layout Android LinearLayout is a view group that aligns all children in either vertically or horizontally. android:divider - This is drawable to use as a vertical divider

More information

Android Application Model I. CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr.

Android Application Model I. CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr. Android Application Model I CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr. Rajiv Ramnath 1 Framework Support (e.g. Android) 2 Framework Capabilities

More information

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

MAD ASSIGNMENT NO 2. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. MAD ASSIGNMENT NO 2 Submitted by: Rehan Asghar BSSE 7 15126 AUGUST 25, 2017 SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. Android Widgets There are given a lot of android widgets with simplified

More information

Android Application Model I

Android Application Model I Android Application Model I CSE 5236: Mobile Application Development Instructor: Adam C. Champion, Ph.D. Course Coordinator: Dr. Rajiv Ramnath Reading: Big Nerd Ranch Guide, Chapters 3, 5 (Activities);

More information

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

M.A.D ASSIGNMENT # 2 REHAN ASGHAR BSSE 15126 M.A.D ASSIGNMENT # 2 REHAN ASGHAR BSSE 15126 Submitted to: Sir Waqas Asghar MAY 23, 2017 SUBMITTED BY: REHAN ASGHAR Intent in Android What are Intent? An Intent is a messaging object you can use to request

More information

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 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

More information

android-espresso #androidespresso

android-espresso #androidespresso android-espresso #androidespresso Table of Contents About 1 Chapter 1: Getting started with android-espresso 2 Remarks 2 Examples 2 Espresso setup instructions 2 Checking an Options Menu items (using Spoon

More information

Our First Android Application

Our First Android Application Mobile Application Development Lecture 04 Imran Ihsan Our First Android Application Even though the HelloWorld program is trivial in introduces a wealth of new ideas the framework, activities, manifest,

More information

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 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

More information

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

Tablets have larger displays than phones do They can support multiple UI panes / user behaviors at the same time Tablets have larger displays than phones do They can support multiple UI panes / user behaviors at the same time The 1 activity 1 thing the user can do heuristic may not make sense for larger devices Application

More information

Android Specifics. Jonathan Diehl (Informatik 10) Hendrik Thüs (Informatik 9)

Android Specifics. Jonathan Diehl (Informatik 10) Hendrik Thüs (Informatik 9) Android Specifics Jonathan Diehl (Informatik 10) Hendrik Thüs (Informatik 9) Android Specifics ArrayAdapter Preferences Widgets Jonathan Diehl, Hendrik Thüs 2 ArrayAdapter Jonathan Diehl, Hendrik Thüs

More information

ANDROID USER INTERFACE

ANDROID USER INTERFACE 1 ANDROID USER INTERFACE Views FUNDAMENTAL UI DESIGN Visual interface element (controls or widgets) ViewGroup Contains multiple widgets. Layouts inherit the ViewGroup class Activities Screen being displayed

More information

Starting Another Activity Preferences

Starting Another Activity Preferences Starting Another Activity Preferences Android Application Development Training Xorsat Pvt. Ltd www.xorsat.net fb.com/xorsat.education Outline Starting Another Activity Respond to the Button Create the

More information

User Interface Development. CSE 5236: Mobile Application Development Instructor: Adam C. Champion Course Coordinator: Dr.

User Interface Development. CSE 5236: Mobile Application Development Instructor: Adam C. Champion Course Coordinator: Dr. User Interface Development CSE 5236: Mobile Application Development Instructor: Adam C. Champion Course Coordinator: Dr. Rajiv Ramnath 1 Outline UI Support in Android Fragments 2 UI Support in the Android

More information

Fragments. Lecture 10

Fragments. Lecture 10 Fragments Lecture 10 Situa2onal layouts Your app can use different layouts in different situa2ons Different device type (tablet vs. phone vs. watch) Different screen size Different orienta2on (portrait

More information

Produced by. Mobile Application Development. Eamonn de Leastar

Produced by. Mobile Application Development. Eamonn de Leastar Mobile Application Development 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 A First

More information

UI (User Interface) overview Supporting Multiple Screens Touch events and listeners

UI (User Interface) overview Supporting Multiple Screens Touch events and listeners http://www.android.com/ UI (User Interface) overview Supporting Multiple Screens Touch events and listeners User Interface Layout The Android user interface (UI) consists of screen views (one or more viewgroups

More information

Fragments were added to the Android API in Honeycomb, API 11. The primary classes related to fragments are: android.app.fragment

Fragments were added to the Android API in Honeycomb, API 11. The primary classes related to fragments are: android.app.fragment FRAGMENTS Fragments An activity is a container for views When you have a larger screen device than a phone like a tablet it can look too simple to use phone interface here. Fragments Mini-activities, each

More information

App Development for Smart Devices. Lec #7: Audio, Video & Telephony Try It Out

App Development for Smart Devices. Lec #7: Audio, Video & Telephony Try It Out App Development for Smart Devices CS 495/595 - Fall 2013 Lec #7: Audio, Video & Telephony Try It Out Tamer Nadeem Dept. of Computer Science Trt It Out Example - SoundPool Example - VideoView Page 2 Fall

More information

Getting Started. Dr. Miguel A. Labrador Department of Computer Science & Engineering

Getting Started. Dr. Miguel A. Labrador Department of Computer Science & Engineering Getting Started Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu http://www.csee.usf.edu/~labrador 1 Goals Setting up your development environment Android Framework

More information

Create new Android project in Android Studio Add Button and TextView to layout Learn how to use buttons to call methods. Modify strings.

Create new Android project in Android Studio Add Button and TextView to layout Learn how to use buttons to call methods. Modify strings. Hello World Lab Objectives: Create new Android project in Android Studio Add Button and TextView to layout Learn how to use buttons to call methods. Modify strings.xml What to Turn in: The lab evaluation

More information

Mobile Software Development for Android - I397

Mobile Software Development for Android - I397 1 Mobile Software Development for Android - I397 IT COLLEGE, ANDRES KÄVER, 2015-2016 EMAIL: AKAVER@ITCOLLEGE.EE WEB: HTTP://ENOS.ITCOLLEGE.EE/~AKAVER/2015-2016/DISTANCE/ANDROID SKYPE: AKAVER Layout fundamentals

More information

Chapter 8 Positioning with Layouts

Chapter 8 Positioning with Layouts Introduction to Android Application Development, Android Essentials, Fifth Edition Chapter 8 Positioning with Layouts Chapter 8 Overview Create user interfaces in Android by defining resource files or

More information

JAVA. Real-Time Java

JAVA. Real-Time Java JAVA Real-Time Java Real-time system non-real-time system a system behaves correctly if produces correct results real-time system a system behaves correctly if produces correct results at required time

More information

Meniu. Create a project:

Meniu. Create a project: Meniu Create a project: Project name: P0131_MenuSimple Build Target: Android 2.3.3 Application name: MenuSimple Package name: ru.startandroid.develop.menusimple Create Activity: MainActivity Open MainActivity.java.

More information

Database Development In Android Applications

Database Development In Android Applications ITU- FAO- DOA- TRCSL Training on Innovation & Application Development for E- Agriculture Database Development In Android Applications 11 th - 15 th December 2017 Peradeniya, Sri Lanka Shahryar Khan & Imran

More information

EMBEDDED SYSTEMS PROGRAMMING UI and Android

EMBEDDED SYSTEMS PROGRAMMING UI and Android EMBEDDED SYSTEMS PROGRAMMING 2016-17 UI and Android STANDARD GESTURES (1/2) UI classes inheriting from View allow to set listeners that respond to basic gestures. Listeners are defined by suitable interfaces.

More information

COMP61242: Task /04/18

COMP61242: Task /04/18 COMP61242: Task 2 1 16/04/18 1. Introduction University of Manchester School of Computer Science COMP61242: Mobile Communications Semester 2: 2017-18 Laboratory Task 2 Messaging with Android Smartphones

More information

Android 4: New features for Application Development

Android 4: New features for Application Development Android 4: New features for Application Development Develop Android applications using the new features of Android Ice Cream Sandwich Murat Aydin BIRMINGHAM - MUMBAI Android 4: New features for Application

More information

Data Persistence. Chapter 10

Data Persistence. Chapter 10 Chapter 10 Data Persistence When applications create or capture data from user inputs, those data will only be available during the lifetime of the application. You only have access to that data as long

More information

Mobile Development Lecture 10: Fragments

Mobile Development Lecture 10: Fragments Mobile Development Lecture 10: Fragments Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Elgayyar.weebly.com Situational Layouts Your app can use different layout in different situations: different device type

More information

Diving into Android. By Jeroen Tietema. Jeroen Tietema,

Diving into Android. By Jeroen Tietema. Jeroen Tietema, Diving into Android By Jeroen Tietema Jeroen Tietema, 2015 1 Requirements 4 Android SDK 1 4 Android Studio (or your IDE / editor of choice) 4 Emulator (Genymotion) or a real device. 1 See https://developer.android.com

More information

05. RecyclerView and Styles

05. RecyclerView and Styles 05. RecyclerView and Styles 08.03.2018 1 Agenda Intents Creating Lists with RecyclerView Creating Cards with CardView Application Bar Menu Styles and Themes 2 Intents 3 What is Intent? An Intent is an

More information

Embedded Systems Programming - PA8001

Embedded Systems Programming - PA8001 Embedded Systems Programming - PA8001 http://goo.gl/ydeczu Lecture 9 Mohammad Mousavi m.r.mousavi@hh.se Center for Research on Embedded Systems School of Information Science, Computer and Electrical Engineering

More information

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

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 4. Workshop Workshop 1. Create an Option Menu, and convert it into Action Bar (Page 1 8) Create an simple Option Menu Convert Option Menu into Action Bar Create Event Listener for Menu and Action Bar Add System Icon

More information

ListView (link) An ordered collection of selectable choices. key attributes in XML:

ListView (link) An ordered collection of selectable choices. key attributes in XML: CS 193A Lists This document is copyright (C) Marty Stepp and Stanford Computer Science. Licensed under Creative Commons Attribution 2.5 License. All rights reserved. ListView (link) An ordered collection

More information

PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE)

PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE) PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE) Network Connection Web Service K Candra Brata andra.course@gmail.com Mobille App Lab 2015-2016 Network Connection http://developer.android.com/training/basics/network-ops/connecting.html

More information

Fragments. Fragments may only be used as part of an ac5vity and cannot be instan5ated as standalone applica5on elements.

Fragments. Fragments may only be used as part of an ac5vity and cannot be instan5ated as standalone applica5on elements. Fragments Fragments A fragment is a self- contained, modular sec5on of an applica5on s user interface and corresponding behavior that can be embedded within an ac5vity. Fragments can be assembled to create

More information

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

1. Location Services. 1.1 GPS Location. 1. Create the Android application with the following attributes. Application Name: MyLocation 1. Location Services 1.1 GPS Location 1. Create the Android application with the following attributes. Application Name: MyLocation Project Name: Package Name: MyLocation com.example.mylocation 2. Put

More information

Mobile Technologies JULY 24, 2018

Mobile Technologies JULY 24, 2018 Mobile Technologies JULY 24, 2018 Overview Motivation Application Android Development What is a Mobile Technology Cellphones, Mobile Gadgets Services that power them (GPS, Radio) Why Mobile? Why Mobile?

More information

API Guide for Gesture Recognition Engine. Version 2.0

API Guide for Gesture Recognition Engine. Version 2.0 API Guide for Gesture Recognition Engine Version 2.0 Table of Contents Gesture Recognition API... 3 API URI... 3 Communication Protocol... 3 Getting Started... 4 Protobuf... 4 WebSocket Library... 4 Project

More information

Overview. What are layouts Creating and using layouts Common layouts and examples Layout parameters Types of views Event listeners

Overview. What are layouts Creating and using layouts Common layouts and examples Layout parameters Types of views Event listeners Layouts and Views http://developer.android.com/guide/topics/ui/declaring-layout.html http://developer.android.com/reference/android/view/view.html Repo: https://github.com/karlmorris/viewsandlayouts Overview

More information

Programmatically Working with Android Fragments

Programmatically Working with Android Fragments Visit: www.intertech.com/blog Programmatically Working with Android Fragments Fragments (since Android ) can be used to organize the display of information in Activities, especially those that have to

More information

Android - JSON Parser Tutorial

Android - JSON Parser Tutorial Android - JSON Parser Tutorial JSON stands for JavaScript Object Notation.It is an independent data exchange format and is the best alternative for XML. This chapter explains how to parse the JSON file

More information

else if(rb2.ischecked()) {

else if(rb2.ischecked()) { Problem :Toy Calculator Description:Please design an Android application that contains 2 activities: cal_main and cal_result. The following figure is a suggested layout for the cal_main activity. For the

More information

Open Lecture Mobile Programming. Intro to Material Design

Open Lecture Mobile Programming. Intro to Material Design Open Lecture Mobile Programming Intro to Material Design Agenda Introduction to Material Design Applying a Material Theme Toolbar/Action Bar Navigation Drawer RecyclerView CardView Support Design Widgets/Tools

More information

Notification mechanism

Notification mechanism Notification mechanism Adaptation of materials: dr Tomasz Xięski. Based on presentations made available by Victor Matos, Cleveland State University. Portions of this page are reproduced from work created

More information