Learn about Android Content Providers and SQLite

Size: px
Start display at page:

Download "Learn about Android Content Providers and SQLite"

Transcription

1 Tampa Bay Android Developers Group Learn about Android Content Providers and SQLite Scott A. Thisse March 20, 2012

2 Learn about Android Content Providers and SQLite What are they? How are they defined? How are they called? What do they return? SQLite March 20, 2012 Tampa Bay Android Developers Group 2 of 32

3 What Are They? Mechanism used to encapsulate data into services Required when sharing data between apps Use REST-like URIs March 20, 2012 Tampa Bay Android Developers Group 3 of 32

4 How Are They Defined? Registered in AndroidManifest.xml Name is called an authority 3 rd Party ones have FQNs Example: <provider android:name="myprovider" android:authorities="org.tbadg.myprovider" /> March 20, 2012 Tampa Bay Android Developers Group 4 of 32

5 How Are They Called? URIs are used Authority is used as a base name similar to how a domain name is used content:// is used as the scheme URI can identify an individual item or an entire collection March 20, 2012 Tampa Bay Android Developers Group 5 of 32

6 How Are They Called? Input parameters are embedded in URI Each URI path segment must be predefined, documented, and interpreted by the provider Examples: content://org.tbadg.myprovider/ content://contacts/people/ content://contacts/people/13/ March 20, 2012 Tampa Bay Android Developers Group 6 of 32

7 What Do They Return? Data returned as an Android cursor Callers expected to know structure of the returned data Returned data structured with a predefined MIME type MIME type returned for a given URI if requested via gettype() March 20, 2012 Tampa Bay Android Developers Group 7 of 32

8 MIME Types Work similar as they do in HTTP MIME type returned as 2-part string in the form <type>/<subtype> Type part for indivual items is always vnd.android.cursor.item Type part for collections is always vnd.android.cursor.dir March 20, 2012 Tampa Bay Android Developers Group 8 of 32

9 MIME Types Subtypes are more flexible Prefix with vnd for nonstandard, vendor-specific types Examples: vnd.android.cursor.item/ vnd.tbadg.info vnd.android.cursor.dir/ vnd.tbadg.info March 20, 2012 Tampa Bay Android Developers Group 9 of 32

10 Accessing Data To reiterate, all access is thru URIs Base URIs (and columns) are usually defined with Java constants Easiest access is via managed query Built-in data requires a permissions entry in AndroidManifest.xml March 20, 2012 Tampa Bay Android Developers Group 10 of 32

11 Managed Query Takes 5 parameters: Base URI Optional Array of properties (columns) Optional Constraint clause (where) Optional replacement values Optional sort statement Returns a Cursor object March 20, 2012 Tampa Bay Android Developers Group 11 of 32

12 Managed Query Examples With URI based constraint: Cursor cur = managedquery( com.someprovider.app/entries/13, null, null, null, null); Without constraints or sort: Cursor cur = managedquery(android.provider.browser.bookmarks_uri, null, null, null, null); With a property (columns) array: new String[] {"title"}, null, null, null); March 20, 2012 Tampa Bay Android Developers Group 12 of 32

13 Managed Query Examples (cont) With constraints (where) clause: null, Browser.BookmarkColumns.BOOKMARK + " = 1", null, null); With replacement value: null, "bookmark =?", new String[] {"1"}, null); With sort statement: null, null, null, "bookmark ASC title DESC"); March 20, 2012 Tampa Bay Android Developers Group 13 of 32

14 Cursors Need to know names and type of columns Columns are identified by number in methods Random access collection of data rows Use movetofirst() first and then movetonext() and isafterlast() to navigate thru data March 20, 2012 Tampa Bay Android Developers Group 14 of 32

15 Inserts, Updates, Deletes (oh my) Handled via a ContentResolver and a ContentValues dictionary Populate ContentValues with row's new or changed values, then Call appropriate ContentResolver method Example: ContentValues cv = new ContentValues(); ContentResolver cr = getcontentresolver(); Uri uri = cr.insert(some_provider_uri, cv); March 20, 2012 Tampa Bay Android Developers Group 15 of 32

16 Extending/Building Content Providers Future presentation(s) will show extending and building custom content providers See references for assistance before then March 20, 2012 Tampa Bay Android Developers Group 16 of 32

17 Live Example AndroidManifest.xml main.xml strings.xml ContentProviders.java March 20, 2012 Tampa Bay Android Developers Group 17 of 32

18 AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=" package="org.tbadg" android:versioncode="1" android:versionname="1.0"> <uses-sdk android:minsdkversion="7" /> <uses-permission android:name="com.android.browser.permission.read_history_bookmarks" /> <application > <activity android:name=".contentproviders" <intent-filter> <category android:name="android.intent.category.launcher" /> <action android:name="android.intent.action.main" /> </intent-filter> </activity> </application> </manifest> March 20, 2012 Tampa Bay Android Developers Group 18 of 32

19 main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> continued... <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <ToggleButton android:layout_width="0dp" android:layout_weight="33" android:layout_height="wrap_content" android:onclick="onclick"> </ToggleButton> March 20, 2012 Tampa Bay Android Developers Group 19 of 32

20 main.xml (cont)...continued <ToggleButton android:layout_width="0dp" android:layout_weight="33" android:layout_height="wrap_content" android:onclick="onclick"> </ToggleButton> <ToggleButton android:layout_width="0dp" android:layout_weight="33" android:layout_height="wrap_content" android:onclick="onclick"> </ToggleButton> </LinearLayout> continued... March 20, 2012 Tampa Bay Android Developers Group 20 of 32

21 main.xml (cont)...continued <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" /> <ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" /> </ScrollView> </LinearLayout> March 20, 2012 Tampa Bay Android Developers Group 21 of 32

22 strings.xml <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">contentproviders</string> <string name="show_bookmarks_str">bookmarks</string> <string name="noshow_bookmarks_str">no Bookmarks</string> <string name="show_history_str">history</string> <string name="noshow_history_str">no History</string> <string name="sorted_str">sorted</string> <string name="unsorted_str">unsorted</string> <string name="output_str"><b><u>output:</u></b></string> </resources> March 20, 2012 Tampa Bay Android Developers Group 22 of 32

23 package org.tbadg; ContentProviders.java import android.app.activity; import android.database.cursor; import android.os.bundle; import android.provider.browser; import android.view.view; import android.widget.textview; import android.widget.togglebutton; public class ContentProviders extends Activity { // Some handles to UI components: TextView _outputtvw = null; ToggleButton _bookmarksbtn = null; ToggleButton _historybtn = null; ToggleButton _sortbtn = public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); } // Set up UI component handles: _outputtvw = (TextView)findViewById(R.id.output); _bookmarksbtn = (ToggleButton)findViewById(R.id.bookmarks); _historybtn = (ToggleButton)findViewById(R.id.history); _sortbtn = (ToggleButton)findViewById(R.id.sort); continued... March 20, 2012 Tampa Bay Android Developers Group 23 of 32

24 ContentProviders.java (cont)...continued continued... public void onclick(view v) { String where = null; String sort = null; // Reset the output: _outputtvw.settext(null); // Determine (a bit redundantly) the data wanted: if (_bookmarksbtn.ischecked()) if (_historybtn.ischecked()) // Both wanted where = null; else // Just bookmarks where = Browser.BookmarkColumns.BOOKMARK + " = 1"; else // Just history if (_historybtn.ischecked()) where = Browser.BookmarkColumns.BOOKMARK + " <> 1"; else // neither return; March 20, 2012 Tampa Bay Android Developers Group 24 of 32

25 ContentProviders.java (cont)...continued // Determine whether to sort the output (via the query): if (_sortbtn.ischecked()) sort = Browser.BookmarkColumns.TITLE + " ASC"; else sort = null; // Get the data from the browser content provider: Cursor cur = managedquery(android.provider.browser.bookmarks_uri, null, where, null, sort); int titleindx = cur.getcolumnindex(browser.bookmarkcolumns.title); } } // Walk thru the data and add it to the output: cur.movetofirst(); while (!cur.isafterlast()) { _outputtvw.append(cur.getstring(titleindx) + "\n"); cur.movetonext(); } March 20, 2012 Tampa Bay Android Developers Group 25 of 32

26 Screenshot March 20, 2012 Tampa Bay Android Developers Group 26 of 32

27 SQLite Most common CP data store Installed on all Android devices Open source, embedded database Databases implemented as flat-files Executable is named sqlite3 March 20, 2012 Tampa Bay Android Developers Group 27 of 32

28 Some Built-in Databases AlarmClock Browser CallLog Contacts MediaStore Settings March 20, 2012 Tampa Bay Android Developers Group 28 of 32

29 Some Useful SQLite Commands.mode column enable column output.headers on enable column headers.output <file> redirect output to file.output stdout redirect output to screen.show display current options.help display command help March 20, 2012 Tampa Bay Android Developers Group 29 of 32

30 Some Useful SQLite Commands (cont).schema display all database info.tables display table info.indexes display index info.dump export database objects.read <file> import dumped data.exit exit the interpreter March 20, 2012 Tampa Bay Android Developers Group 30 of 32

31 Q & A Questions? March 20, 2012 Tampa Bay Android Developers Group 31 of 32

32 References Allen, G. and Owens M. (2010). The Definitive Guide to SQLite, Second Edition. New York, New York: Apress Content Providers (n.d.). Retrieved March 8, 2012, from Komatineni, S. et al. (2011). Pro Android 3. New York, New York: Apress Murphy, M. (2012). The Busy Coder's Guide to Advanced Android Development. Retrieved March 8, 2012 from March 20, 2012 Tampa Bay Android Developers Group 32 of 32

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

Android Beginners Workshop

Android Beginners Workshop Android Beginners Workshop at the M O B IL E M O N D AY m 2 d 2 D E V E L O P E R D A Y February, 23 th 2010 Sven Woltmann, AndroidPIT Sven Woltmann Studied Computer Science at the TU Ilmenau, 1994-1999

More information

Android Workshop: Model View Controller ( MVC):

Android Workshop: Model View Controller ( MVC): Android Workshop: Android Details: Android is framework that provides java programmers the ability to control different aspects of smart devices. This interaction happens through the Android SDK (Software

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

Content Provider. Introduction 01/03/2016. Session objectives. Content providers. Android programming course. Introduction. Built-in Content Provider

Content Provider. Introduction 01/03/2016. Session objectives. Content providers. Android programming course. Introduction. Built-in Content Provider Android programming course Session objectives Introduction Built-in Custom By Võ Văn Hải Faculty of Information Technologies 2 Content providers Introduction Content providers manage access to a structured

More information

8/30/15 MOBILE COMPUTING. CSE 40814/60814 Fall How many of you. have implemented a command-line user interface?

8/30/15 MOBILE COMPUTING. CSE 40814/60814 Fall How many of you. have implemented a command-line user interface? MOBILE COMPUTING CSE 40814/60814 Fall 2015 How many of you have implemented a command-line user interface? 1 How many of you have implemented a graphical user interface? HTML/CSS Java Swing.NET Framework

More information

LifeStreet Media Android Publisher SDK Integration Guide

LifeStreet Media Android Publisher SDK Integration Guide LifeStreet Media Android Publisher SDK Integration Guide Version 1.12.0 Copyright 2015 Lifestreet Corporation Contents Introduction... 3 Downloading the SDK... 3 Choose type of SDK... 3 Adding the LSM

More information

Simple Currency Converter

Simple Currency Converter Simple Currency Converter Implementing a simple currency converter: USD Euro Colon (CR) Note. Naive implementation using the rates 1 Costa Rican Colon = 0.001736 U.S. dollars 1 Euro = 1.39900 U.S. dollars

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

App Development for Android. Prabhaker Matet

App Development for Android. Prabhaker Matet App Development for Android Prabhaker Matet Development Tools (Android) Java Java is the same. But, not all libs are included. Unused: Swing, AWT, SWT, lcdui Android Studio (includes Intellij IDEA) Android

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

<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

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

Android Services. Victor Matos Cleveland State University. Services

Android Services. Victor Matos Cleveland State University. Services 22 Android Victor Matos Cleveland State University Notes are based on: Android Developers http://developer.android.com/index.html 22. Android Android A Service is an application component that runs in

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

Mobile Programming Lecture 5. Composite Views, Activities, Intents and Filters

Mobile Programming Lecture 5. Composite Views, Activities, Intents and Filters Mobile Programming Lecture 5 Composite Views, Activities, Intents and Filters Lecture 4 Review How do you get the value of a string in the strings.xml file? What are the steps to populate a Spinner or

More information

Applications. Marco Ronchetti Università degli Studi di Trento

Applications. Marco Ronchetti Università degli Studi di Trento Applications Marco Ronchetti Università degli Studi di Trento Android Applications An Android application typically consists of one or more related, loosely bound activities for the user to interact with.

More information

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

Android Exam AND-401 Android Application Development Version: 7.0 [ Total Questions: 129 ] s@lm@n Android Exam AND-401 Android Application Development Version: 7.0 [ Total Questions: 129 ] Android AND-401 : Practice Test Question No : 1 Which of the following is required to allow the Android

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 Basics. - Bhaumik Shukla Android Application STEALTH FLASH

Android Basics. - Bhaumik Shukla Android Application STEALTH FLASH Android Basics - Bhaumik Shukla Android Application Developer @ STEALTH FLASH Introduction to Android Android is a software stack for mobile devices that includes an operating system, middleware and key

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 Basics

EMBEDDED SYSTEMS PROGRAMMING Application Basics EMBEDDED SYSTEMS PROGRAMMING 2015-16 Application Basics APPLICATIONS Application components (e.g., UI elements) are objects instantiated from the platform s frameworks Applications are event driven ( there

More information

Basic UI elements: Android Buttons (Basics) Marco Ronchetti Università degli Studi di Trento

Basic UI elements: Android Buttons (Basics) Marco Ronchetti Università degli Studi di Trento Basic UI elements: Android Buttons (Basics) Marco Ronchetti Università degli Studi di Trento Let s work with the listener Button button = ; button.setonclicklistener(new.onclicklistener() { public void

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

Computer Science E-76 Building Mobile Applications

Computer Science E-76 Building Mobile Applications Computer Science E-76 Building Mobile Applications Lecture 3: [Android] The SDK, Activities, and Views February 13, 2012 Dan Armendariz danallan@mit.edu 1 http://developer.android.com Android SDK and NDK

More information

Change in Orientation. Marco Ronchetti Università degli Studi di Trento

Change in Orientation. Marco Ronchetti Università degli Studi di Trento 1 Change in Orientation Marco Ronchetti Università degli Studi di Trento Change in orientation Change in orientation For devices that support multiple orientations, Android detects a change in orientation:

More information

Created By: Keith Acosta Instructor: Wei Zhong Courses: Senior Seminar Cryptography

Created By: Keith Acosta Instructor: Wei Zhong Courses: Senior Seminar Cryptography Created By: Keith Acosta Instructor: Wei Zhong Courses: Senior Seminar Cryptography 1. Thread Summery 2. Thread creation 3. App Diagram and information flow 4. General flow of Diffie-Hellman 5. Steps of

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

Agenda. The Android GUI Framework Introduction Anatomy A real word example Life cycle Findings

Agenda. The Android GUI Framework Introduction Anatomy A real word example Life cycle Findings The Android GUI Framework Java User Group Switzerland May 2008 Markus Pilz mp@greenliff.com Peter Wlodarczak pw@greenliff.com Agenda 1. 1. Introduction 2. 2. Anatomy 3. 3. A real word example 4. 4. Life

More information

EMBEDDED SYSTEMS PROGRAMMING Android NDK

EMBEDDED SYSTEMS PROGRAMMING Android NDK EMBEDDED SYSTEMS PROGRAMMING 2014-15 Android NDK WHAT IS THE NDK? The Android NDK is a set of cross-compilers, scripts and libraries that allows to embed native code into Android applications Native code

More information

Solving an Android Threading Problem

Solving an Android Threading Problem Home Java News Brief Archive OCI Educational Services Solving an Android Threading Problem Introduction by Eric M. Burke, Principal Software Engineer Object Computing, Inc. (OCI) By now, you probably know

More information

IPN-ESCOM Application Development for Mobile Devices. Extraordinary. A Web service, invoking the SOAP protocol, in an Android application.

IPN-ESCOM Application Development for Mobile Devices. Extraordinary. A Web service, invoking the SOAP protocol, in an Android application. Learning Unit Exam Project IPN-ESCOM Application Development for Mobile Devices. Extraordinary. A Web service, invoking the SOAP protocol, in an Android application. The delivery of this project is essential

More information

Getting started: Installing IDE and SDK. Marco Ronchetti Università degli Studi di Trento

Getting started: Installing IDE and SDK. Marco Ronchetti Università degli Studi di Trento Getting started: Installing IDE and SDK Marco Ronchetti Università degli Studi di Trento Alternative: Android Studio http://developer.android.com/develop/index.html 2 Tools behind the scenes dx allows

More information

Security model. Marco Ronchetti Università degli Studi di Trento

Security model. Marco Ronchetti Università degli Studi di Trento Security model Marco Ronchetti Università degli Studi di Trento Security model 2 Android OS is a multi-user Linux in which each application is a different user. By default, the system assigns each application

More information

CS371m - Mobile Computing. Content Providers And Content Resolvers

CS371m - Mobile Computing. Content Providers And Content Resolvers CS371m - Mobile Computing Content Providers And Content Resolvers Content Providers One of the four primary application components: activities content providers / content resolvers services broadcast receivers

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

Agenda. Overview of Xamarin and Xamarin.Android Xamarin.Android fundamentals Creating a detail screen

Agenda. Overview of Xamarin and Xamarin.Android Xamarin.Android fundamentals Creating a detail screen Gill Cleeren Agenda Overview of Xamarin and Xamarin.Android Xamarin.Android fundamentals Creating a detail screen Lists and navigation Navigating from master to detail Optimizing the application Preparing

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

A Crash Course to Android Mobile Platform

A Crash Course to Android Mobile Platform Enterprise Application Development using J2EE Shmulik London Lecture #2 A Crash Course to Android Mobile Platform Enterprise Application Development Using J2EE / Shmulik London 2004 Interdisciplinary Center

More information

Android Overview. Most of the material in this section comes from

Android Overview. Most of the material in this section comes from Android Overview Most of the material in this section comes from http://developer.android.com/guide/ Android Overview A software stack for mobile devices Developed and managed by Open Handset Alliance

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

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

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 Development Tutorial. Yi Huang

Android Development Tutorial. Yi Huang Android Development Tutorial Yi Huang Contents What s Android Android architecture Android software development Hello World on Android More 2 3 What s Android Android Phones Sony X10 HTC G1 Samsung i7500

More information

1 카메라 1.1 제어절차 1.2 관련주요메서드 1.3 제작철차 서피스뷰를생성하고이를제어하는서피스홀더객체를참조해야함. 매니페스트에퍼미션을지정해야한다.

1 카메라 1.1 제어절차 1.2 관련주요메서드 1.3 제작철차 서피스뷰를생성하고이를제어하는서피스홀더객체를참조해야함. 매니페스트에퍼미션을지정해야한다. 1 카메라 1.1 제어절차 서피스뷰를생성하고이를제어하는서피스홀더객체를참조해야함. 매니페스트에퍼미션을지정해야한다. 1.2 관련주요메서드 setpreviewdisplay() : startpreview() : stoppreview(); onpicturetaken() : 사진을찍을때자동으로호출되며캡처한이미지가전달됨 1.3 제작철차 Step 1 프로젝트를생성한후매니페스트에퍼미션들을설정한다.

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

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

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

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

App Development for Smart Devices. Lec #9: Advanced Topics

App Development for Smart Devices. Lec #9: Advanced Topics App Development for Smart Devices CS 495/595 - Fall 2013 Lec #9: Advanced Topics Tamer Nadeem Dept. of Computer Science Objective Web Browsing Android Animation Android Backup Publishing Your Application

More information

LECTURE NOTES OF APPLICATION ACTIVITIES

LECTURE NOTES OF APPLICATION ACTIVITIES Department of Information Networks The University of Babylon LECTURE NOTES OF APPLICATION ACTIVITIES By College of Information Technology, University of Babylon, Iraq Samaher@inet.uobabylon.edu.iq The

More information

10.1 Introduction. Higher Level Processing. Word Recogniton Model. Text Output. Voice Signals. Spoken Words. Syntax, Semantics, Pragmatics

10.1 Introduction. Higher Level Processing. Word Recogniton Model. Text Output. Voice Signals. Spoken Words. Syntax, Semantics, Pragmatics Chapter 10 Speech Recognition 10.1 Introduction Speech recognition (SR) by machine, which translates spoken words into text has been a goal of research for more than six decades. It is also known as automatic

More information

Android for Java Developers Dr. Markus Schmall, Jochen Hiller

Android for Java Developers Dr. Markus Schmall, Jochen Hiller Android for Java Developers Dr. Markus Schmall Jochen Hiller 1 Who we are Dr. Markus Schmall m.schmall@telekom.de Deutsche Telekom AG Jochen Hiller j.hiller@telekom.de Deutsche Telekom AG 2 Agenda Introduction

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

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

App Development for Smart Devices. Lec #18: Advanced Topics

App Development for Smart Devices. Lec #18: Advanced Topics App Development for Smart Devices CS 495/595 - Fall 2011 Lec #18: Advanced Topics Tamer Nadeem Dept. of Computer Science Objective Web Browsing Android Animation Android Backup Presentation - Developing

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

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

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

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

M.C.A. Semester V Subject: - Mobile Computing (650003) Week : 2 M.C.A. Semester V Subject: - Mobile Computing (650003) Week : 2 1) What is Intent? How it is useful for transitioning between various activities? How intents can be received & broadcasted. (Unit :-2, Chapter

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

UNDERSTANDING ACTIVITIES

UNDERSTANDING ACTIVITIES Activities Activity is a window that contains the user interface of your application. An Android activity is both a unit of user interaction - typically filling the whole screen of an Android mobile device

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

Tabel mysql. Kode di PHP. Config.php. Service.php

Tabel mysql. Kode di PHP. Config.php. Service.php Tabel mysql Kode di PHP Config.php Service.php Layout Kode di Main Activity package com.example.mini.webandroid; import android.app.progressdialog; import android.os.asynctask; import android.support.v7.app.appcompatactivity;

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

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

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

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

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

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

CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015 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

More information

Embedded Systems Programming - PA8001

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

More information

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

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

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

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

M O B I L E T R A I N I N G. Beginning Your Android Programming Journey

M O B I L E T R A I N I N G. Beginning Your Android Programming Journey Beginning Your Android Programming Journey An Introductory Chapter from EDUmobile.ORG Android Development Training Program NOTICE: You Do NOT Have the Right to Reprint or Resell This ebook! You Also MAY

More information

Intents, Intent Filters, and Invoking Activities: Part I: Using Class Name

Intents, Intent Filters, and Invoking Activities: Part I: Using Class Name 2012 Marty Hall Intents, Intent Filters, and Invoking Activities: Part I: Using Class Name Originals of Slides and Source Code for Examples: http://www.coreservlets.com/android-tutorial/ Customized Java

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

Real-Time Embedded Systems

Real-Time Embedded Systems Real-Time Embedded Systems DT8025, Fall 2016 http://goo.gl/azfc9l Lecture 8 Masoumeh Taromirad m.taromirad@hh.se Center for Research on Embedded Systems School of Information Technology 1 / 51 Smart phones

More information

Advanced Android Development

Advanced Android Development Advanced Android Development review of greporter open-source project: GPS, Audio / Photo Capture, SQLite, HTTP File Upload and more! Nathan Freitas, Oliver+Coady nathan@olivercoady.com Android Platform

More information

Tłumaczenie i adaptacja materiałów: dr Tomasz Xięski. Na podstawie prezentacji udostępnionych przez Victor Matos, Cleveland State University.

Tłumaczenie i adaptacja materiałów: dr Tomasz Xięski. Na podstawie prezentacji udostępnionych przez Victor Matos, Cleveland State University. Czcionki Tłumaczenie i adaptacja materiałów: dr Tomasz Xięski. Na podstawie prezentacji udostępnionych przez Victor Matos, Cleveland State University. Portions of this page are reproduced from work created

More information

University of Stirling Computing Science Telecommunications Systems and Services CSCU9YH: Android Practical 1 Hello World

University of Stirling Computing Science Telecommunications Systems and Services CSCU9YH: Android Practical 1 Hello World University of Stirling Computing Science Telecommunications Systems and Services CSCU9YH: Android Practical 1 Hello World Before you do anything read all of the following red paragraph! For this lab you

More information

MODULE 2: GETTING STARTED WITH ANDROID PROGRAMMING

MODULE 2: GETTING STARTED WITH ANDROID PROGRAMMING This document can be downloaded from www.chetanahegde.in with most recent updates. 1 MODULE 2: GETTING STARTED WITH ANDROID PROGRAMMING Syllabus: What is Android? Obtaining the required tools, Anatomy

More information

Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department. Mobile Computing ECOM Eng. Wafaa Audah.

Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department. Mobile Computing ECOM Eng. Wafaa Audah. Islamic University of Gaza Faculty of Engineering Computer Engineering Department Mobile Computing ECOM 5341 By Eng. Wafaa Audah July 2013 1 Launch activitits, implicit intents, data passing & start activity

More information

Services. Marco Ronchetti Università degli Studi di Trento

Services. Marco Ronchetti Università degli Studi di Trento 1 Services Marco Ronchetti Università degli Studi di Trento Service An application component that can perform longrunning operations in the background and does not provide a user interface. So, what s

More information

Tutorial: Setup for Android Development

Tutorial: Setup for Android Development Tutorial: Setup for Android Development Adam C. Champion CSE 5236: Mobile Application Development Autumn 2017 Based on material from C. Horstmann [1], J. Bloch [2], C. Collins et al. [4], M.L. Sichitiu

More information

Introduction To Android

Introduction To Android Introduction To Android Mobile Technologies Symbian OS ios BlackBerry OS Windows Android Introduction to Android Android is an operating system for mobile devices such as smart phones and tablet computers.

More information

EECS 4443 Mobile User Interfaces. More About Layouts. Scott MacKenzie. York University. Overview (Review)

EECS 4443 Mobile User Interfaces. More About Layouts. Scott MacKenzie. York University. Overview (Review) EECS 4443 Mobile User Interfaces More About Layouts Scott MacKenzie York University Overview (Review) A layout defines the visual structure for a user interface, such as the UI for an activity or app widget

More information

Android Media. Pro. Developing Graphics, Music, Video and Rich Media Apps for Smartphones and Tablets

Android Media. Pro. Developing Graphics, Music, Video and Rich Media Apps for Smartphones and Tablets Utilize the Android media APIs to create dynamic mobile apps Pro Android Media Developing Graphics, Music, Video and Rich Media Apps for Smartphones and Tablets Shawn Van Every Pro Android Media Developing

More information

Android & iphone. Amir Eibagi. Localization

Android & iphone. Amir Eibagi. Localization Android & iphone Amir Eibagi Localization Topics Android Localization: Overview Language & Strings Country/region language variations Images & Media Currency, date & Time iphone Localization Language &

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

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

Gauthier Picard. MINES Saint-Étienne. October 10, 2017

Gauthier Picard. MINES Saint-Étienne. October 10, 2017 Android Programming Gauthier Picard MINES Saint-Étienne October 10, 2017 This presentation is based on Jean-Paul Jamont s one (Université Pierre Mendès France, IUT de Valence) Android Programming Gauthier

More information

Group B: Assignment No 8. Title of Assignment: To verify the operating system name and version of Mobile devices.

Group B: Assignment No 8. Title of Assignment: To verify the operating system name and version of Mobile devices. Group B: Assignment No 8 Regularity (2) Performance(5) Oral(3) Total (10) Dated Sign Title of Assignment: To verify the operating system name and version of Mobile devices. Problem Definition: Write a

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

Designing Apps Using The WebView Control

Designing Apps Using The WebView Control 28 Designing Apps Using The Control Victor Matos Cleveland State University Notes are based on: Android Developers http://developer.android.com/index.html The Busy Coder's Guide to Advanced Android Development

More information

Android Data Storage

Android Data Storage Lesson 14 Android Persistency: Victor Matos Cleveland State University Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright 2008-2009 CommonsWare, LLC. ISBN: 978-0-9816780-0-9

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

EECS 4443 Mobile User Interfaces. More About Layouts. Scott MacKenzie. York University

EECS 4443 Mobile User Interfaces. More About Layouts. Scott MacKenzie. York University EECS 4443 Mobile User Interfaces More About Layouts Scott MacKenzie York University Overview (Review) A layout defines the visual structure for a user interface, such as the UI for an activity or app widget

More information