Mobile and Ubiquitous Computing: Android Programming (part 4)

Size: px
Start display at page:

Download "Mobile and Ubiquitous Computing: Android Programming (part 4)"

Transcription

1 Mobile and Ubiquitous Computing: Android Programming (part 4) Master studies, Winter 2015/2016 Dr Veljko Pejović Examples from: Mobile and Ubiquitous Computing Jo Vermeulen, University of Birmingham, UK

2 Data Storage SharedPreferences Internal storage External storage SQLite database

3 SharedPreference Preserve a small amount of primitive type (int, float, String, Boolean) data on a device Data are saved as key-value pairs Should be read/written by your app only Stored for as long as the app is installed on a device Common use: User preferences username, customisations, such as preferred WiFi AP, preferred theme, etc. Variables for conditional app execution When the app is launched for the first time set launched to True; next time, check if launched was set or not

4 Accessing SharedPreferences Reading SharedPreferences settings = getapplicationcontext().getsharedpreferences( preferences, MODE_PRIVATE); boolean waslaunched = settings.getboolean( launched, false); Need to know the type of data: getboolean() getstring() getall() returns a Map of key-value pairs Always use MODE_PRIVATE

5 Accessing SharedPreferences Writing SharedPreferences settings = getapplicationcontext().getsharedpreferences( preferences, MODE_PRIVATE); SharedPreferences.Editor editor = settings.edit(); editor.putboolean( launched, true); editor.commit(); Different put methods for different data types Don t forget to commit!

6 PreferenceFragment A special Fragment that connects XML preference hierarchy with SharedPreferences <PreferenceScreen xmlns:android=" > <PreferenceCategory android:title="@string/inline_preferences"> <CheckBoxPreference android:key="checkbox_preference android:title="@string/title_checkbox_preference /> <EditTextPreference android:key="edittext_preference" android:title="@string/title_edittext_preference /> </PreferenceCategory> <PreferenceScreen/> public class PrefsFragment extends PreferenceFragment public void oncreate(bundle savedinstancestate{ super.oncreate(savedinstancestate); addpreferencesfromresource(r.xml.preferences); } }

7 File Storage Android uses the common Java File API Files saved as internal or external files INTERNAL Always available. Files saved here are accessible by only your app by default. When the user uninstalls your app, the system removes all your app's files from internal storage. EXTERNAL Not always available a user can mount the external storage as USB storage World-readable, so files saved here may be read outside of your control. When the user uninstalls your app, the system removes your app's files from here only if you save them in the directory from getexternalfilesdir().

8 Internal Files Find where to save files getfilesdir() an internal directory for your app getcachedir() an internal directory for your app's temporary cache files If the system begins running low on storage, it may delete these cache files Read/write methods FileOutputStream openfileoutput (String name, int mode) opens file for writing (creates it if needed) FileInputStream openfileinput (String name) opens a file for reading

9 External Files Check if the storage is mounted public boolean isexternalstoragewritable() { String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { return true; } return false; } Write to private external storage: getexternalfilesdir() Write to public external storage: getexternalstoragepublicdirectory()

10 External Files If written to public external storage your files remain on the device even after your app is uninstalled Use Environment class constants for storing files in appropriate directories File file = new File(context.getExternalFilesDir( Environment.DIRECTORY_PICTURES), albumname);

11 SQLite A relational database implementation for embedded systems A library added to an app, rather than a standalone client-served DB engine The whole database is kept in a single file, and a write operation gets an exclusive lock over the file (no concurrent writing) SQL-92 language standard implemented (mostly) Supports ACID transactions (Atomic, Consistent, Isolated and Durable)

12 SQLite Use Android s SQLite database for structured data, especially if SQL queries can be used for improved data presentation Key classes: SQLiteOpenHelper To create, open, modify the tables in the database SQLiteDatabase To query the database

13 SQLiteOpenHelper Subclass SQLiteOpenHelper for your database Define your schema - formal declaration of how the database is organized, and the SQL statements that you use to create your database Call super() from the subclass constructor to initialize the underlying database Execute database creation in oncreate() oncreate() of the helper is called when a component tries to access a not-yet-existing database SQLiteOpenHelper abstracts the costly DB creation operations, and does not run them when not needed

14 SQLiteOpenHelper Access the database via SQLiteOpenHelper: getreadabledatabase() getwritabledatabase() These operations may take some time, thus, run them on a background thread using AsyncTask or IntentService

15 SQLiteOpenHelper Example Use _id for the primary key

16 SQLiteOpenHelper Example Use in Activity:

17 SQLiteDatabase Insert into database by calling insert() with ContentValues key-value pairs Query the database with query() and rawquery()

18 SQLiteDatabase ListViews populated with Adapters connected to the database are often the most convenient way of displaying DB content

19 Examining DB Content Databases stored in /data/data/<package name>/databases/ Can examine database with sqlite3 # adb -s emulator-5554 shell # sqlite3 /data/data/ si.uni_lj.fri.lrss.databaseexample/databases/ contacts_db

20 Examining DB Content

21 Background Processing

22 Concurrency in Android Java Threads The most general method Service Runs work in the background, however, by default on the same thread as the UI IntentService Background work on a separate thread, to contact the UI use local broadcast AsyncTask Background work on a separate thread, but with a tight integration with the UI

23 IntentService Suitable for long running one-off tasks when we don t want to affect the UI responsiveness IntentService survives Activity lifecycle changes No need to cancel the service when Activity is rebuilt Called using explicit Intent Starts on demand handles each Intent in turn; stops itself when it runs out of work

24 IntentService Define in AndroidManifest.XML Extend the class in your Java code

25 Invoking IntentService Create an explicit Intent for your IntentService Use startservice() to start the IntentService Add additional data if needed with the extra field

26 Handling Results (1) ResultReceiver in your Activity Subclass ResultReceiver, implement onreceiveresult Pass ResultReceiver through Intent

27 Handling Results (1) ResultReceiver IntentService sends results to ResultReceiver in a Bundle with send() method Example Display location address h"p://developer.android.com/training/loca4on/display- address.html

28 Handling Results (2) Broadcast A different approach Subclass BroadcastReceiver in your Activity Broadcast from IntentService

29 AsyncTask For short, more interactive tasks Runs on a separate worker thread, but keeps a link with the main UI thread via: onpreexecute onprogressupdate onpostexecute Define what we want to do in the background in: doinbackground Start with YourTask().execute() AsyncTask <?,?,?>? param types for input, progress, output

30 h"ps://github.com/googlesamples/android- play- loca4on/tree/master/ac4vityrecogni4on AsyncTask Example Just before the task starts This is done in the background, and the status is communicated via publishprogress()

31 AsyncTask Example Connects with the UI thread Immediately after the task is finished

Spring Lecture 5 Lecturer: Omid Jafarinezhad

Spring Lecture 5 Lecturer: Omid Jafarinezhad Mobile Programming Sharif University of Technology Spring 2016 - Lecture 5 Lecturer: Omid Jafarinezhad Storage Options Android provides several options for you to save persistent application data. The

More information

SharedPreferences Internal Storage External Storage SQLite databases

SharedPreferences Internal Storage External Storage SQLite databases SharedPreferences Internal Storage External Storage SQLite databases Use when you want to store small amounts of primitive data A persistent map that holds key-value pairs of simple data types Automatically

More information

MOBILE APPLICATIONS PROGRAMMING

MOBILE APPLICATIONS PROGRAMMING Data Storage 23.12.2015 MOBILE APPLICATIONS PROGRAMMING Krzysztof Pawłowski Polsko-Japońska Akademia Technik Komputerowych STORAGE OPTIONS Shared Preferences SQLite Database Internal Storage External Storage

More information

Android: Data Storage

Android: Data Storage Android: Data Storage F. Mallet Frederic.Mallet@unice.fr Université Nice Sophia Antipolis Outline Data Storage Shared Preferences Internal Storage External Storage SQLite Databases Network Connection F.

More information

The Basis of Data. Steven R. Bagley

The Basis of Data. Steven R. Bagley The Basis of Data Steven R. Bagley So far How to create a UI View defined in XML Java-based Activity as the Controller Services Long running processes Intents used to send messages between things asynchronously

More information

Eng. Jaffer M. El-Agha Android Programing Discussion Islamic University of Gaza. Data persistence

Eng. Jaffer M. El-Agha Android Programing Discussion Islamic University of Gaza. Data persistence Eng. Jaffer M. El-Agha Android Programing Discussion Islamic University of Gaza Data persistence Shared preferences A method to store primitive data in android as key-value pairs, these saved data will

More information

Mobile Application Development Android

Mobile Application Development Android Mobile Application Development Android Lecture 3 MTAT.03.262 Satish Srirama satish.srirama@ut.ee Android Lecture 2 - recap Views and Layouts Events Basic application components Activities Intents 9/22/2017

More information

Mobile Application Development Android

Mobile Application Development Android Mobile Application Development Android Lecture 3 MTAT.03.262 Satish Srirama satish.srirama@ut.ee Android Lecture 2 - recap Views and Layouts Events Basic application components Activities Intents 9/15/2014

More information

CS371m - Mobile Computing. Persistence

CS371m - Mobile Computing. Persistence CS371m - Mobile Computing Persistence Storing Data Multiple options for storing data associated with apps Shared Preferences Internal Storage device memory External Storage SQLite Database Network Connection

More information

CS378 -Mobile Computing. Persistence

CS378 -Mobile Computing. Persistence CS378 -Mobile Computing Persistence Saving State We have already seen saving app state into a Bundle on orientation changes or when an app is killed to reclaim resources but may be recreated later 2 Storing

More information

07. Data Storage

07. Data Storage 07. Data Storage 22.03.2018 1 Agenda Data storage options How to store data in key-value pairs How to store structured data in a relational database 2 Data Storage Options Shared Preferences Store private

More information

Mobile Application Development Android

Mobile Application Development Android Mobile Application Development Android Lecture 3 MTAT.03.262 Satish Srirama satish.srirama@ut.ee Android Lecture 2 -recap Views and Layouts Events Basic application components Activities Intents BroadcastReceivers

More information

Data storage and exchange in Android

Data storage and exchange in Android Mobile App Development 1 Overview 2 3 SQLite Overview Implementation 4 Overview Methods to implement URI like SQL 5 Internal storage External storage Overview 1 Overview 2 3 SQLite Overview Implementation

More information

SAVING SIMPLE APPLICATION DATA

SAVING SIMPLE APPLICATION DATA 1 DATA PERSISTENCE OBJECTIVES In this chapter, you will learn how to persist data in your Android applications. Persisting data is an important topic in application development, as users typically expect

More information

CSCU9YH: Development with Android

CSCU9YH: Development with Android : Development with Android Computing Science and Mathematics University of Stirling Data Storage and Exchange 1 Preferences: Data Storage Options a lightweight mechanism to store and retrieve keyvalue

More information

Distributed Systems 2011 Assignment 1

Distributed Systems 2011 Assignment 1 Distributed Systems 2011 Assignment 1 Gábor Sörös gabor.soros@inf.ethz.ch The Exercise Objectives Get familiar with Android programming Emulator, debugging, deployment Learn to use UI elements and to design

More information

Mediensystemen mit Android

Mediensystemen mit Android LFE Medieninformatik i ik Prof. Dr. Heinrich i Hußmann (Dozent), Alexander De Luca, Gregor Broll, Max-Emanuel Maurer (supervisors) Praktikum Entwicklung von Mediensystemen mit Android Storing, Retrieving

More information

Automatically persisted among application sessions

Automatically persisted among application sessions STORAGE OPTIONS Storage options SharedPreference Small amount of data, as Key-value pairs Private to an Activity or Shared among Activities Internal storage Small to medium amount of data Private to the

More information

Mobile Application Development MyRent Settings

Mobile Application Development MyRent Settings Mobile Application Development MyRent Settings Waterford Institute of Technology October 13, 2016 John Fitzgerald Waterford Institute of Technology, Mobile Application Development MyRent Settings 1/19

More information

Lecture 7: Data Persistence : shared preferences. Lecturer : Ali Kadhim Al-Bermani Mobile Fundamentals and Programming

Lecture 7: Data Persistence : shared preferences. Lecturer : Ali Kadhim Al-Bermani Mobile Fundamentals and Programming University of Babylon College of Information Technology Department of Information Networks Mobile Fundamentals and Programming Lecture 7: Data Persistence : shared preferences Lecturer : Ali Kadhim Al-Bermani

More information

Android Programming - Jelly Bean

Android Programming - Jelly Bean 1800 ULEARN (853 276) www.ddls.com.au Android Programming - Jelly Bean Length 5 days Price $4235.00 (inc GST) Overview This intensive, hands-on five-day course teaches programmers how to develop activities,

More information

SQLite. 5COSC005W MOBILE APPLICATION DEVELOPMENT Lecture 6: Working with Databases. What is a Database Server. Advantages of SQLite

SQLite. 5COSC005W MOBILE APPLICATION DEVELOPMENT Lecture 6: Working with Databases. What is a Database Server. Advantages of SQLite SQLite 5COSC005W MOBILE APPLICATION DEVELOPMENT Lecture 6: Working with Databases Dr Dimitris C. Dracopoulos SQLite is a tiny yet powerful database engine. Besides Android, it can be found in: Apple iphone

More information

Single Application Persistent Data Storage. CS 282 Principles of Operating Systems II Systems Programming for Android

Single Application Persistent Data Storage. CS 282 Principles of Operating Systems II Systems Programming for Android Single Application Persistent Data Storage CS 282 Principles of Operating Systems II Systems Programming for Android Android offers several ways to store data Files SQLite database SharedPreferences Android

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

Distributed Systems Assignment 1

Distributed Systems Assignment 1 Distributed Systems Assignment 1 Marian.george@inf.ethz.ch Distributed Systems Assignment 1 1 The Exercise Objectives Get familiar with Android programming Emulator, debugging, deployment Learn to use

More information

SharedPreference. <map> <int name="access_count" value="3" /> </map>

SharedPreference. <map> <int name=access_count value=3 /> </map> 1 Android Data Storage Options Android provides several data storage options for you to save persistent application data depends on your specific needs: private/public, small/large datasets :- Internal

More information

Answers to Exercises

Answers to Exercises Answers to Exercises CHAPTER 1 ANSWERS 1. What is an AVD? Ans: An AVD is an Android Virtual Device. It represents an Android emulator, which emulates a particular configuration of an actual Android device.

More information

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

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar Design Patterns MSc 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

More information

Software Practice 3 Today s lecture Today s Task

Software Practice 3 Today s lecture Today s Task 1 Software Practice 3 Today s lecture Today s Task Prof. Hwansoo Han T.A. Jeonghwan Park 43 2 MULTITHREAD IN ANDROID 3 Activity and Service before midterm after midterm 4 Java Thread Thread is an execution

More information

Thread. A Thread is a concurrent unit of execution. The thread has its own call stack for methods being invoked, their arguments and local variables.

Thread. A Thread is a concurrent unit of execution. The thread has its own call stack for methods being invoked, their arguments and local variables. 1 Thread A Thread is a concurrent unit of execution. The thread has its own call stack for methods being invoked, their arguments and local variables. Each virtual machine instance has at least one main

More information

Software Engineering Large Practical: Storage, Settings and Layouts. Stephen Gilmore School of Informatics October 27, 2017

Software Engineering Large Practical: Storage, Settings and Layouts. Stephen Gilmore School of Informatics October 27, 2017 Software Engineering Large Practical: Storage, Settings and Layouts Stephen Gilmore School of Informatics October 27, 2017 Contents 1. Storing information 2. Settings 3. Layouts 1 Storing information Storage

More information

Lab 5 Periodic Task Scheduling

Lab 5 Periodic Task Scheduling Lab 5 Periodic Task Scheduling Scheduling a periodic task in Android is difficult as it goes against the philosophy of keeping an application active only while the user is interacting with it. You are

More information

Services. service: A background task used by an app.

Services. service: A background task used by an app. CS 193A Services This document is copyright (C) Marty Stepp and Stanford Computer Science. Licensed under Creative Commons Attribution 2.5 License. All rights reserved. Services service: A background task

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

How-to s and presentations. Be prepared to demo them in class. https://sites.google.com/site/androidhowto/presentati ons

How-to s and presentations. Be prepared to demo them in class. https://sites.google.com/site/androidhowto/presentati ons Upcoming Assignments Readings: Chapter 6 by today Lab 3 due today (complete survey) Lab 4 will be available Friday (due February 5) Friday Quiz in Blackboard 2:10-3pm (Furlough) Vertical Prototype due

More information

Developing Android Applications Introduction to Software Engineering Fall Updated 1st November 2015

Developing Android Applications Introduction to Software Engineering Fall Updated 1st November 2015 Developing Android Applications Introduction to Software Engineering Fall 2015 Updated 1st November 2015 Android Lab 3 & Midterm Additional Concepts No Class Assignment 2 Class Plan Android : Additional

More information

Computer Science Large Practical: Storage, Settings and Layouts. Stephen Gilmore School of Informatics October 26, 2017

Computer Science Large Practical: Storage, Settings and Layouts. Stephen Gilmore School of Informatics October 26, 2017 Computer Science Large Practical: Storage, Settings and Layouts Stephen Gilmore School of Informatics October 26, 2017 Contents 1. Storing information 2. Kotlin compilation 3. Settings 4. Layouts 1 Storing

More information

Android File & Storage

Android File & Storage Files Lecture 9 Android File & Storage Android can read/write files from two locations: Internal (built into the device) and external (an SD card or other drive attached to device) storage Both are persistent

More information

Required Core Java for Android application development

Required Core Java for Android application development Required Core Java for Android application development Introduction to Java Datatypes primitive data types non-primitive data types Variable declaration Operators Control flow statements Arrays and Enhanced

More information

Distributed Systems Assignment 1

Distributed Systems Assignment 1 Distributed Systems Assignment 1 marian.george@inf.ethz.ch Distributed Systems Assignment 1 1 The Exercise Objectives Get familiar with Android programming Emulator, debugging, deployment Learn to use

More information

Communicating with a Server

Communicating with a Server Communicating with a Server Client and Server Most mobile applications are no longer stand-alone Many of them now have a Cloud backend The Cloud Client-server communication Server Backend Database HTTP

More information

32. And this is an example on how to retrieve the messages received through NFC.

32. And this is an example on how to retrieve the messages received through NFC. 4. In Android applications the User Interface (UI) thread is the main thread. This thread is very important because it is responsible with displaying/drawing and updating UI elements and handling/dispatching

More information

ANDROID SYLLABUS. Advanced Android

ANDROID SYLLABUS. Advanced Android Advanced Android 1) Introduction To Mobile Apps I. Why we Need Mobile Apps II. Different Kinds of Mobile Apps III. Briefly about Android 2) Introduction Android I. History Behind Android Development II.

More information

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology Mobile Application Development Produced by David Drohan (ddrohan@wit.ie) Department of Computing & Mathematics Waterford Institute of Technology http://www.wit.ie Android Persistence," Multithreading &

More information

Mobile Programming Practice Background processing AsynTask Service Broadcast receiver Lab #5

Mobile Programming Practice Background processing AsynTask Service Broadcast receiver Lab #5 1 Mobile Programming Practice Background processing AsynTask Service Broadcast receiver Lab #5 Prof. Hwansoo Han T.A. Sung-in Hong T.A. Minseop Jeong 2 Background processing Every Android app has a main

More information

COMP4521 EMBEDDED SYSTEMS SOFTWARE

COMP4521 EMBEDDED SYSTEMS SOFTWARE COMP4521 EMBEDDED SYSTEMS SOFTWARE LAB 5: USING WEBVIEW AND USING THE NETWORK INTRODUCTION In this lab we modify the application we created in the first three labs. Instead of using the default browser,

More information

An Android Studio SQLite Database Tutorial

An Android Studio SQLite Database Tutorial An Android Studio SQLite Database Tutorial Previous Table of Contents Next An Android Studio TableLayout and TableRow Tutorial Understanding Android Content Providers in Android Studio Purchase the fully

More information

CS378 -Mobile Computing. Services and Broadcast Receivers

CS378 -Mobile Computing. Services and Broadcast Receivers CS378 -Mobile Computing Services and Broadcast Receivers Services One of the four primary application components: activities content providers services broadcast receivers 2 Services Application component

More information

Android" Application Development SAMS. Sams Teach Yourself. Shane Conder. Lauren Darcey. Second Edition

Android Application Development SAMS. Sams Teach Yourself. Shane Conder. Lauren Darcey. Second Edition Lauren Darcey Shane Conder Sams Teach Yourself Android" Application Development Second Edition SAMS 800 East 96th Street, Indianapolis, Indiana, 46240 USA Table of Contents Introduction 1 Who Should Read

More information

Basic UI elements: Defining Activity UI in the code. Marco Ronchetti Università degli Studi di Trento

Basic UI elements: Defining Activity UI in the code. Marco Ronchetti Università degli Studi di Trento 1 Basic UI elements: Defining Activity UI in the code Marco Ronchetti Università degli Studi di Trento UI Programmatically public class UIThroughCode extends Activity { LinearLayout llayout; TextView tview;

More information

Understand applications and their components. activity service broadcast receiver content provider intent AndroidManifest.xml

Understand applications and their components. activity service broadcast receiver content provider intent AndroidManifest.xml Understand applications and their components activity service broadcast receiver content provider intent AndroidManifest.xml Android Application Written in Java (it s possible to write native code) Good

More information

Mobile Programming Lecture 10. ContentProviders

Mobile Programming Lecture 10. ContentProviders Mobile Programming Lecture 10 ContentProviders Lecture 9 Review In creating a bound service, why would you choose to use a Messenger over extending Binder? What are the differences between using GPS provider

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

Mobile Application Programing: Android. Data Persistence

Mobile Application Programing: Android. Data Persistence Mobile Application Programing: Android Data Persistence Activities Apps are composed of activities Activities are self-contained tasks made up of one screen-full of information Activities start one another

More information

CS 403X Mobile and Ubiquitous Computing Lecture 5: Web Services, Broadcast Receivers, Tracking Location, SQLite Databases Emmanuel Agu

CS 403X Mobile and Ubiquitous Computing Lecture 5: Web Services, Broadcast Receivers, Tracking Location, SQLite Databases Emmanuel Agu CS 403X Mobile and Ubiquitous Computing Lecture 5: Web Services, Broadcast Receivers, Tracking Location, SQLite Databases Emmanuel Agu Web Services What are Web Services? Means to call a remote method

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

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

Introduction to Android

Introduction to Android Introduction to Android Ambient intelligence Alberto Monge Roffarello Politecnico di Torino, 2017/2018 Some slides and figures are taken from the Mobile Application Development (MAD) course Disclaimer

More information

Mobile Programming Lecture 7. Dialogs, Menus, and SharedPreferences

Mobile Programming Lecture 7. Dialogs, Menus, and SharedPreferences Mobile Programming Lecture 7 Dialogs, Menus, and SharedPreferences Agenda Dialogs Menus SharedPreferences Android Application Components 1. Activity 2. Broadcast Receiver 3. Content Provider 4. Service

More information

The Broadcast Class Registration Broadcast Processing

The Broadcast Class Registration Broadcast Processing The Broadcast Class Registration Broadcast Processing Base class for components that receive and react to events BroadcastReceivers register to receive events in which they are interested When Events occur

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

Upon completion of the second part of the lab the students will have:

Upon completion of the second part of the lab the students will have: ETSN05, Fall 2017, Version 2.0 Software Development of Large Systems Lab 2 1. INTRODUCTION The goal of lab 2 is to introduce students to the basics of Android development and help them to create a starting

More information

SQLite Database. References. Overview. Structured Databases

SQLite Database. References. Overview. Structured Databases SQLite Database References Android Developers Article https://developer.android.com/training/basics/data-storage/databases.html Android SQLite Package Reference https://developer.android.com/reference/android/database/sqlite/package-summary.html

More information

Android Application Development Course 28 Contact Hours

Android Application Development Course 28 Contact Hours Android Application Development Course 28 Contact Hours Course Overview This course that provides the required knowledge and skills to design and build a complete Androidâ application. It delivers an extensive

More information

OFFLINE MODE OF ANDROID

OFFLINE MODE OF ANDROID OFFLINE MODE OF ANDROID APPS @Ajit5ingh ABOUT ME new Presenter( Ajit Singh, github.com/ajitsing, www.singhajit.com, @Ajit5ingh ) AGENDA Why offline mode? What it takes to build an offline mode Architecture

More information

Android Essentials with Java

Android Essentials with Java Android Essentials with Java Before You Program o Exercise in algorithm generation Getting Started o Using IntelliJ CE Using Variables and Values o Store data in typed variables Static Methods o Write

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

Multiple Activities. Many apps have multiple activities

Multiple Activities. Many apps have multiple activities Intents Lecture 7 Multiple Activities Many apps have multiple activities An activity A can launch another activity B in response to an event The activity A can pass data to B The second activity B can

More information

10/27/17. Network Connec1on. Outline. Connect to the Internet. Connect to the Internet. Perform Network Operations. Perform Network Operations

10/27/17. Network Connec1on. Outline. Connect to the Internet. Connect to the Internet. Perform Network Operations. Perform Network Operations Connecting to the Internet Outline Network Connec1on CS443 Mobile Applica1ons Instructor: Bo Sheng Perform network operations Manage network usage Parsing data 1 2 Connect to the Internet Permissions in

More information

CMSC436: Fall 2013 Week 3 Lab

CMSC436: Fall 2013 Week 3 Lab CMSC436: Fall 2013 Week 3 Lab Objectives: Familiarize yourself with the Activity class, the Activity lifecycle, and the Android reconfiguration process. Create and monitor a simple application to observe

More information

EMBEDDED SYSTEMS PROGRAMMING Android Services

EMBEDDED SYSTEMS PROGRAMMING Android Services EMBEDDED SYSTEMS PROGRAMMING 2016-17 Android Services APP COMPONENTS Activity: a single screen with a user interface Broadcast receiver: responds to system-wide broadcast events. No user interface Service:

More information

CORE JAVA& ANDROID SYLLABUS

CORE JAVA& ANDROID SYLLABUS CORE JAVA& ANDROID SYLLABUS AAvhdvchdvchdvhdh CORE JAVA Assignment s Introduction Programming language Types and Paradigms Why Java? Flavors of Java Java Designing Goal Role of Java Programmer in Industry

More information

Android Application Development

Android Application Development Android Application Development Octav Chipara What is Android A free, open source mobile platform A Linux-based, multiprocess, multithreaded OS Android is not a device or a product It s not even limited

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

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

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology Mobile Application Development Produced by David Drohan (ddrohan@wit.ie) Department of Computing & Mathematics Waterford Institute of Technology http://www.wit.ie Android Anatomy Android Anatomy 2! Agenda

More information

Java Training Center - Android Application Development

Java Training Center - Android Application Development Java Training Center - Android Application Development Android Syllabus and Course Content (3 months, 2 hour Daily) Introduction to Android Android and it's feature Android releases and Versions Introduction

More information

Syllabus- Java + Android. Java Fundamentals

Syllabus- Java + Android. Java Fundamentals Introducing the Java Technology Syllabus- Java + Android Java Fundamentals Key features of the technology and the advantages of using Java Using an Integrated Development Environment (IDE) Introducing

More information

MOBILE APPLICATION DEVELOPMENT LECTURE 10 SERVICES IMRAN IHSAN ASSISTANT PROFESSOR

MOBILE APPLICATION DEVELOPMENT LECTURE 10 SERVICES IMRAN IHSAN ASSISTANT PROFESSOR MOBILE APPLICATION DEVELOPMENT LECTURE 10 SERVICES IMRAN IHSAN ASSISTANT PROFESSOR WWW.IMRANIHSAN.COM Android Component A Service is an application component that runs in the background, not interacting

More information

Android. Operating System and Architecture. Android. Screens. Main features

Android. Operating System and Architecture. Android. Screens. Main features Android Android Operating System and Architecture Operating System and development system from Google and Open Handset Alliance since 2008 At the lower level is based on the Linux kernel and in a higher

More information

Software Engineering Large Practical: Accessing remote data and XML parsing. Stephen Gilmore School of Informatics October 8, 2017

Software Engineering Large Practical: Accessing remote data and XML parsing. Stephen Gilmore School of Informatics October 8, 2017 Software Engineering Large Practical: Accessing remote data and XML parsing Stephen Gilmore School of Informatics October 8, 2017 Contents 1. Android system permissions 2. Getting a network connection

More information

Android/Java Lightning Tutorial JULY 30, 2018

Android/Java Lightning Tutorial JULY 30, 2018 Android/Java Lightning Tutorial JULY 30, 2018 Java Android uses java as primary language Resource : https://github.mit.edu/6178-2017/lec1 Online Tutorial : https://docs.oracle.com/javase/tutorial/java/nutsandbolts/inde

More information

AND-401 Android Certification. The exam is excluded, but we cover and support you in full if you want to sit for the international exam.

AND-401 Android Certification. The exam is excluded, but we cover and support you in full if you want to sit for the international exam. Android Programming This Android Training Course will help you build your first working application quick-quick. You ll learn hands-on how to structure your app, design interfaces, create a database, make

More information

MC Android Programming

MC Android Programming MC1921 - Android Programming Duration: 5 days Course Price: $3,395 Course Description Android is an open source platform for mobile computing. Applications are developed using familiar Java and Eclipse

More information

Android Connectivity & Google APIs

Android Connectivity & Google APIs Android Connectivity & Google APIs Lecture 5 Operating Systems Practical 2 November 2016 This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license,

More information

Writing Efficient Drive Apps for Android. Claudio Cherubino / Alain Vongsouvanh Google Drive Developer Relations

Writing Efficient Drive Apps for Android. Claudio Cherubino / Alain Vongsouvanh Google Drive Developer Relations Writing Efficient Drive Apps for Android Claudio Cherubino / Alain Vongsouvanh Google Drive Developer Relations Raise your hand if you use Google Drive source: "put your hands up!" (CC-BY) Raise the other

More information

CS 528 Mobile and Ubiquitous Computing Lecture 4a: Fragments, Camera Emmanuel Agu

CS 528 Mobile and Ubiquitous Computing Lecture 4a: Fragments, Camera Emmanuel Agu CS 528 Mobile and Ubiquitous Computing Lecture 4a: Fragments, Camera Emmanuel Agu Fragments Recall: Fragments Sub-components of an Activity (screen) An activity can contain multiple fragments, organized

More information

Lecture 2 Android SDK

Lecture 2 Android SDK Lecture 2 Android SDK This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a

More information

Android App Development

Android App Development Android App Development Course Contents: Android app development Course Benefit: You will learn how to Use Advance Features of Android with LIVE PROJECTS Original Fees: 15000 per student. Corporate Discount

More information

An Overview of the Android Programming

An Overview of the Android Programming ID2212 Network Programming with Java Lecture 14 An Overview of the Android Programming Hooman Peiro Sajjad KTH/ICT/SCS HT 2016 References http://developer.android.com/training/index.html Developing Android

More information

PROFILE MANAGER ANDROID APPLICATION. A Project. Presented to the faculty of the Department of Computer Science

PROFILE MANAGER ANDROID APPLICATION. A Project. Presented to the faculty of the Department of Computer Science PROFILE MANAGER ANDROID APPLICATION A Project Presented to the faculty of the Department of Computer Science California State University, Sacramento Submitted in partial satisfaction of the requirements

More information

Overview of Frameworks: Part 3

Overview of Frameworks: Part 3 : Part 3 d.schmidt@vanderbilt.edu www.dre.vanderbilt.edu/~schmidt Institute for Software Integrated Systems Vanderbilt University Nashville, Tennessee, USA CS 282 Principles of Operating Systems II Systems

More information

CS 4518 Mobile and Ubiquitous Computing Lecture 6: Databases, Camera, Face Detection Emmanuel Agu

CS 4518 Mobile and Ubiquitous Computing Lecture 6: Databases, Camera, Face Detection Emmanuel Agu CS 4518 Mobile and Ubiquitous Computing Lecture 6: Databases, Camera, Face Detection Emmanuel Agu Administrivia Project 2 Emailed out last week Should be done in groups of 5 or 6 Due this Thursday, 11.59PM

More information

Software Engineering Large Practical: Preferences, storage, and testing

Software Engineering Large Practical: Preferences, storage, and testing Software Engineering Large Practical: Preferences, storage, and testing Stephen Gilmore (Stephen.Gilmore@ed.ac.uk) School of Informatics November 9, 2016 Contents A simple counter activity Preferences

More information

Hydrogen Car Mobile Display

Hydrogen Car Mobile Display Hydrogen Car Mobile Display Andrew Schulze Course Instructor: Dr. Guilherme DeSouza, PhD ECE 4220 Project Report Department of Electrical and Computer Engineering University of Missouri Columbia December

More information

CS 4330/5390: Mobile Application Development Exam 1

CS 4330/5390: Mobile Application Development Exam 1 1 Spring 2017 (Thursday, March 9) Name: CS 4330/5390: Mobile Application Development Exam 1 This test has 8 questions and pages numbered 1 through 7. Reminders This test is closed-notes and closed-book.

More information

External Services. CSE 5236: Mobile Application Development Course Coordinator: Dr. Rajiv Ramnath Instructor: Adam C. Champion

External Services. CSE 5236: Mobile Application Development Course Coordinator: Dr. Rajiv Ramnath Instructor: Adam C. Champion External Services CSE 5236: Mobile Application Development Course Coordinator: Dr. Rajiv Ramnath Instructor: Adam C. Champion 1 External Services Viewing websites Location- and map-based functionality

More information

Topics Covered in the Android Apps Development Training

Topics Covered in the Android Apps Development Training Topics Covered in the Android Apps Development Training 1. Android Architecture sdk, jdk, class files,.dex, installation, sdk manager, avd manager, avd configurations, emulator, Android Framework Versions,

More information

Android Fundamentals - Part 1

Android Fundamentals - Part 1 Android Fundamentals - Part 1 Alexander Nelson September 1, 2017 University of Arkansas - Department of Computer Science and Computer Engineering Reminders Projects Project 1 due Wednesday, September 13th

More information

Understanding Application

Understanding Application Introduction to Android Application Development, Android Essentials, Fifth Edition Chapter 4 Understanding Application Components Chapter 4 Overview Master important terminology Learn what the application

More information