Android Components. Android Smartphone Programming. Matthias Keil. University of Freiburg

Similar documents
Android Components Android Smartphone Programming. Outline University of Freiburg. Data Storage Database University of Freiburg. Notizen.

The Basis of Data. Steven R. Bagley

Mobile Application Development Android

Android Application Development Course 28 Contact Hours

Mobile Application Development Android

Automatically persisted among application sessions

How-to s and presentations. Be prepared to demo them in class. ons

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

Mobile Application Development Android

CS371m - Mobile Computing. Persistence - SQLite

07. Data Storage

Mr. Pritesh N. Patel Assistant Professor MCA ISTAR, V. V. Nagar ANDROID DATABASE TUTORIAL

Android Programming Lecture 15 11/2/2011

Android User Interface

CS371m - Mobile Computing. Content Providers And Content Resolvers

Android User Interface Android Smartphone Programming. Outline University of Freiburg

Java Training Center - Android Application Development

Android: Data Storage

Accelerating Information Technology Innovation

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

Introduction to Android Android Smartphone Programming. Outline University of Freiburg. What is Android? Background University of Freiburg.

Android Programming - Jelly Bean

android application development CONTENTS 1.1 INTRODUCTION TO O ANDROID OPERATING SYSTEM... TURES Understanding the Android Software Stack...

ANDROID SYLLABUS. Advanced Android

Mobile and Ubiquitous Computing: Android Programming (part 4)

M.C.A. Semester V Subject: - Mobile Computing (650003) Week : 2

Android Fundamentals - Part 1

application components

MFA Instructions. Getting Started. 1. Go to Apps, select Play Store 2. Search for Microsoft Authenticator 3. Click Install

Introduction. Lecture 1. Operating Systems Practical. 5 October 2016

CS378 -Mobile Computing. Persistence -SQLite

Android Application Development Course Code: AND-401 Version 7 Duration: 05 days

Android Application Development using Kotlin

Step 1 Turn on the device and log in with the password, PIN, or other passcode, if necessary.

Add the Counties Power App to your smartphone. app.countiespower.com

Android App Development

Android Training Overview (For Demo Classes Call Us )

CS Android. Vitaly Shmatikov

SportPesa for Android

Programming in Android. Nick Bopp

Learn about Android Content Providers and SQLite

ATC Android Application Development

CSCU9YH: Development with Android

Presentation Outline 10/16/2016

GfK Digital Trends for Android. GfK Digital Trends Version 1.21

Android Application Development 101. Jason Chen Google I/O 2008

M.C.A. Semester V Subject: - Mobile Computing (650003) Week : 1

ORACLE UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

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

v5: How to restore Exchange databases

SQLite Database. References. Overview. Structured Databases

MFA Pilot Instructions

Using Freegal on an Android Device

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

MetaTrader 4 for Android. User Manual

Management Interface User Guide

Syllabus- Java + Android. Java Fundamentals

1. What are the key components of Android Architecture? 2. What are the advantages of having an emulator within the Android environment?

Practical Problem: Create an Android app that having following layouts.

Lab - Working with Android

Lecture 1 - Introduction to Android

Beginning Android 4 Application Development

CS378 -Mobile Computing. What's Next?

MiCloud Office. Android guide. Copyright Mitel Communications AB

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

ANDROID DEVELOPMENT. Course Details

Android Essentials with Java

Sqlite Update Failed With Error Code 19 Android

ANDROID APPLICATION DEVELOPMENT COURSE Training Program

Android Programming Lecture 16 11/4/2011

1. Use Wireless Data Transfer with FlashAir App for

App Development for Smart Devices. Lec #5: Content Provider

ECM Extensions xcp 2.2 xcelerator Abstract

Introduction to Mobile Application and Development

Using Microsoft Access to Create Queries and Write SQL Statements

COURSE SYLLABUS ANDROID. Industrial Training (4 MONTHS) PH : , Vazhoor Road Changanacherry-01.

Visualizing Venice Historic Environment Record (Geospatial Database)

Android Dialogs. Dialogs are simple visual objects that pop up and display a message or prompt for some user input.

An Android Studio SQLite Database Tutorial

Introduction to Android

XAMARIN Application Development - Workshop

Q.1 Explain the dialog and also explain the Demonstrate working dialog in android.

Android Programming (5 Days)

Beginning Android Tablet

ZEED T-Connect User Guide for DA Linkage

owncloud Android App Manual

User Manual Please read the manual before use.

Developer s Tip Print to Scale Feature in Slide

Version Release Date Description V The first version Change History V1.0.0 i

Remote Workspace. Nubo End User Guide. Version: 1.3 Date: June, Copyright 2017 by Nubo Inc. All rights reserved. Page 1

Android Exam AND-401 Android Application Development Version: 7.0 [ Total Questions: 129 ]

University of Mary Washington. FOC Planning Tool User s Guide Kwadwo Brobbey, Kelly Brown, Rebecca Wright

4D Widgets. 4D Widget components DatePicker SearchPicker TimePicker Alphabetical list of commands - 1 -

On the left hand side is the Dashboard which is effectively a menu.

SIS Simplified Interline Settlement SIS User Guide for TOU SIS. User Guide. SIS TOU Guide Version 1.2 1

LECTURE 08 UI AND EVENT HANDLING

Expense Approvals on Nexonia s Mobile Application

S1 Smart Watch APPS GUIDE. Models: S1, S1C & S1 PLUS

NetIQ Advanced Authentication Framework. Smartphone Authentication Provider User's Guide for Windows. Version 5.1.0

S1 Smart Watch APPS GUIDE. Models: S1, S1C & S1 PLUS

Transcription:

Android Components Android Smartphone Programming Matthias Keil Institute for Computer Science Faculty of Engineering 3. November 2014

Outline 1 Data Storage 2 Messages to the User 3 Background Work 4 App Widgets 5 Useful Widgets 6 Summary Matthias Keil Android Components 3. November 2014 2 / 16

Data Storage Database Many ways to store data of the application. Android provides support for SQLite databases[3]. Accessible for every class inside the application. No possibility to access from outside of application. Use Cursor object to loop through data inside the database. Easy to display cursor data inside an activity by creating an adapter and binding it to the activity, for example ListAdapter for ListView. Matthias Keil Android Components 3. November 2014 3 / 16

Data Storage Example: Creating and filling a table 1 try { Use method execsql to execute one SQL statement. Exceptions: Do not use a SELECT statement or one that returns data. 2 SQLiteDatabase db = openorcreatedatabase (" mydb ", MODE_PRIVATE, null ); 3 db. execsql (" CREATE TABLE IF NOT EXISTS mytable ( Driver TEXT, Team TEXT );"); 4 db. execsql (" INSERT OR IGNORE INTO mytable VALUES ( Glock, Toyota );"); 5... 6 } Matthias Keil Android Components 3. November 2014 4 / 16

Data Storage Examples Creation of Cursor object to access data from database 1 Cursor SQLiteDatabase. query ( boolean distinct, String table, String [] columns, String selection, String [] selectionargs, String groupby, String having, String orderby, String limit ) Example 1 Cursor c = db. query (true, " mydb ", values, null, null, null, null, null, null ); Matthias Keil Android Components 3. November 2014 5 / 16

Data Storage Example: Accessing data from a table 1 try { 2 Cursor c =... 3 c. movetofirst (); 4 String driverstr = c. getstring ( c. getcolumnindexorthrow (" Driver ")); 5 String teamstr = c. getstring ( c. getcolumnindexorthrow (" Team ")); 6 c. movetonext (); 7... 8 } Matthias Keil Android Components 3. November 2014 6 / 16

Data Storage Content Provider Mostly used to share data between applications[2]. Many predefined Content Providers available, for example to access phone contacts. Provide mechanisms to define data security. Access of data through content URI. Example: people.content URI to access the phone contacts. Matthias Keil Android Components 3. November 2014 7 / 16

Data Storage Example: Usage of a Content Provider 1 String [] proj = new String [] { People._ID, People.NAME, People. NUMBER }; 2 try { 3 Cursor c = managedquery ( People. CONTENT_ URI, proj, null, null, null ); 4 if ( c == null ) return ; 5 int name = c. getcolumnindexorthrow ( People. NAME ); 6 if (!c. movetofirst ()) return ; 7 String namestring = c. getstring ( name ); 8... 9 } Matthias Keil Android Components 3. November 2014 8 / 16

Messages to the User Status Bar Notifications Can be created using the Notification class. Adds an icon to the status bar and a message in the notifications window of the system[5]. Used to notify the user about an event from a background service, not from a visible application. Can be selected in the notifications window, which fires a predefined intent (message). Matthias Keil Android Components 3. November 2014 9 / 16

Messages to the User Toast Notifications Toast: Small message that pops up when shown[6]. User s current activity remains visible and interactive. Fades in and out. Does not provide any means for user interaction. Used to display short text messages. Matthias Keil Android Components 3. November 2014 10 / 16

Messages to the User Dialog Notifications Dialog: Small window that appears in front of current Activity[4]. Used for notifications or interaction directly related with the application. Example usage scenarios: Display of a progress bar till the application is updated. Display a short message the user needs to confirm with OK or Cancel. Matthias Keil Android Components 3. November 2014 11 / 16

Background Work: Services Used to perform long-running operations in background[7]. Does not provide a user interface. Continues to run even when starting component is not active anymore. Interprocess communication (IPC) possible for interaction between component and service. Used for example for handling network transactions, play music, etc. Matthias Keil Android Components 3. November 2014 12 / 16

App Widgets Miniature application view that can be embedded in other application, for example home screen[1]. Receives periodic updates. Example usage: Displaying current song of music player as seen in picture below. Matthias Keil Android Components 3. November 2014 13 / 16

Useful Widgets DatePicker can be used to pick a date including year, month and day. TimePicker enables the user to specify a time in 24 hour or AM/PM mode. Matthias Keil Android Components 3. November 2014 14 / 16

Summary Persistent data storage can be archived with SQLite databases. Data can be shared between different applications using Content Providers. Messages to the user can be displayed as small text message through a Toast, a Status Bar Notification from a service or a Dialog, if user interaction is required. Services are used to perform background work. App Widgets can be placed on the home screen and receive periodic updates. Matthias Keil Android Components 3. November 2014 15 / 16

Bibliography Android Developers. App Widgets. http://developer.android.com/guide/topics/appwidgets/index.html. Android Developers. Content Providers. http://developer.android.com/guide/topics/providers/content-providers.html. Android Developers. Data Storage using Databases. http://developer.android.com/guide/topics/data/data-storage.html#db. Android Developers. Notifications: Dialog. http://developer.android.com/guide/topics/ui/notifiers/index.html#dialog. Android Developers. Notifications: Status Bar. http://developer.android.com/guide/topics/ui/notifiers/index.html#statusbar. Android Developers. Notifications: Toast. http://developer.android.com/guide/topics/ui/notifiers/index.html#toast. Android Developers. Services. http://developer.android.com/guide/topics/fundamentals/services.html. Matthias Keil Android Components 3. November 2014 16 / 16