lec 05 Admin stuff; schedule IOS versus Android Preferences

Slides:



Advertisements
Similar presentations
Google Android Introduction to Mobile Computing. Android is part of the build a better phone process Open Handset Alliance produces Android Comprises.
Advertisements

Cosc 5/4730 Android: “Dynamic” data.. Saving Dynamic data. While there are a lot of ways to save data – Via the filesystem, database, etc. You can also.
Cosc 5/4730 Android Services. What is a service? From android developer web pages: Most confusion about the Service class actually revolves around what.
CSE2102 Introduction to Software Engineering Lab 2 Sept/4/2013.
Programming with Android: Activities
Android 02: Activities David Meredith
All About Android Introduction to Android 1. Creating a New App “These aren’t the droids we’re looking for.” Obi-wan Kenobi 1. Bring up Eclipse. 2. Click.
The Android Activity Lifecycle. Slide 2 Introduction Working with the Android logging system Rotation and multiple layouts Understanding the Android activity.
Lec 06 AsyncTask Local Services IntentService Broadcast Receivers.
The Activity Class 1.  One application component type  Provides a visual interface for a single screen  Typically supports one thing a user can do,
APPFORUM2014 Helping the developer community build next-generation, multi-platform apps. SCHAUMBURG, ILLINOIS | SEPTEMBER 8-10.
Data Persistence in Android
Data Storage: Part 1 (Preferences)
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
Software Architecture of Android Yaodong Bi, Ph.D. Department of Computing Sciences University of Scranton.
Android Mobile computing for the rest of us.* *Prepare to be sued by Apple.
Take a leap towards the most promising technology
Android Info mostly based on Pro Android 3.  User Applications  Java Libraries – most of Java standard edition ◦ Activities/Services ◦ UI/Graphics/View.
Android development basics Introduction,Structure,Development Boncho Valkov.Net Developer.
Intro to Android Development Ben Lafreniere. Getting up and running Don’t use the VM! ials/hello-world.html.
Lec 04 Content Providers Adapters CursorLoaders Advanced Debugging.
This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit
CS378 - Mobile Computing Intents.
16 Services and Broadcast Receivers CSNB544 Mobile Application Development Thanks to Utexas Austin.
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.
Copyright© Jeffrey Jongko, Ateneo de Manila University Of Activities, Intents and Applications.
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
Understand applications and their components activity service broadcast receiver content provider intent AndroidManifest.xml.
Android Storage. There are several options for storage of data with Android We can put data into a preferences file. We can put data into a ‘normal’ file.
Data persistence How to save data using SharedPreferences, Files, and SQLite database 1Data 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.
Persistence Dr. David Janzen Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License.
1 CMSC 628: Introduction to Mobile Computing Nilanjan Banerjee Introduction to Mobile Computing University of Maryland Baltimore County
Applications with Multiple Activities. Most applications will have more than one activity. The main activity is started when the application is started.
Android: “Dynamic” data and Preferences data.
Android Application Lifecycle and Menus
Activities and Intents Richard S. Stansbury 2015.
Recap of Part 1 Terminology Windows FormsAndroidMVP FormActivityView? ControlViewView? ?ServiceModel? Activities Views / ViewGroups Intents Services.
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Android Programming Steve Ko Computer Sciences and Engineering University at Buffalo.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Lecture 2: Android Concepts
Persistent Data Management Daniel Angermeier
Activities and Intents Chapter 3 1. Objectives Explore an activity’s lifecycle Learn about saving and restoring an activity Understand intents and how.
CHAPTER 9 File Storage Shared Preferences SQLite.
The Ingredients of Android Applications. A simple application in a process In a classical programming environment, the OS would load the program code.
Mobile Application Development Data Storage. Android provides several options for you to save persistent application data. The solution you choose depends.
The Flag Quiz app tests your ability to correctly identify 10 flags from various countries and territories.
Working with Multiple Activities. Slide 2 Introduction Working with multiple activities Putting together the AndroidManifest.xml file Creating multiple.
Data Storage in Android Димитър Н. Димитров. Why talk about data? Why not 3D graphics or network connectivity? Data as fundamental term in computer science.
Editing a Twitter search. Viewing search results in a browser.
CS371m - Mobile Computing Intents 1. Allow us to use applications and components that are already part of Android System – start activities – start services.
Android Application -Architecture.
Reactive Android Development
Lecture 2: Android Concepts
Android 01: Fundamentals
CS371m - Mobile Computing Persistence.
Android Application Data Storage 1.
Android System Security
Android Studio, Android System Basics and Git
Activities and Intents
Android Activities An application can have one or more activities, where Each activity Represents a screen that an app present to its user Extends the.
HUJI Post PC Workshop 1 Introduction to Android Development Ari Sprung
Android Storage.
Activities and Intents
Activities and Intents
Activities and Intents
It is used to Start an Activity Start a Service Deliver a Broadcast
Lecture 2: Android Concepts
Activities and Fragments
Microsoft Teams User Interface
Presentation transcript:

lec 05 Admin stuff; schedule IOS versus Android Preferences Configuration Changes Advanced UI 1

You can persist data in several ways : Preferences: key/value pairs SQLite: Use a very small RDBMS that is sandboxed to your app and then expose it to other apps using a content provider Files: You can read/write files to your raw directory-- avoid this. Network: store data on the internet and read/write using any available Internet protocol – avoid this.

You must declare an object called SharedPreferences SharedPreferences shp; Assign it like so: shp = PreferenceManager.getDefaultSharedPreferences(this); Access elements like so: String strName = shp.getString("name_key", ""); Put elements like so: SharedPreferences.Editor sheEditor = shp.edit(); sheEditor.putString("name", "Rumpelstilskin"); sheEditor.commit();

Configuration Changes aka rotate screen To force rotate a screen in emulator, press cntrl-F12 (on PC)

Usually you restore your state in onCreate Usually you restore your state in onCreate. It is possible to restore it in onRestoreInstanceState as well, but not very common. (onRestoreInstanceState is called after onStart, whereas onCreate is called before onStart. Use the put methods to store values in onSaveInstanceState: protected void onSaveInstanceState(Bundle icicle) { icicle.putLong("param", value); super.onSaveInstanceState(outState); } And restore the values in onCreate: public void onCreate(Bundle icicle) { if (icicle != null){ value = icicle.getLong("param");

Student presentations: A: AsyncTask: How to get/parse JSON data (weather data) from RESTful web service (with recipe) B: MediaStore: Taking pictures and videos and storing them for use in an app (not the standard gallery) (with recipe) C: Voice Recognition: How to use voice recognition inside an app (with recipe) D: Tracking locations (using GPS) for a jog or a race. Data capture so that I can map where I went and how far I traveled, avg speed (with recipe) Activies, Receivers, Services, and Content-Providers all must be declared in the manifest. Intnets are calls to the op-system. It handles all intents, explicit and implicit.