Mobile Application Development Data Storage. Android provides several options for you to save persistent application data. The solution you choose depends.

Slides:



Advertisements
Similar presentations
Bruce Scharlau, University of Aberdeen, 2012 Data storage options for mobiles Mobile Computing.
Advertisements

Android og persistens
Application Fundamentals Android Development. Announcements Posting in D2L Tutorials.
Joemarie Comeros Amparo Android Development Orientation for Starters.
 data/data-storage.html#pref data/data-storage.html#pref 
Programming with Android: SDK install and initial setup Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna.
Tracking & Login Data persistence User tracking.
OSGi: Open Services Gateway Initiative Richard Chapman 5 Sept
M1G Introduction to Database Development 1. Databases and Database Design.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
A Guide to Getting Started
Emerging Platform#4: Android Bina Ramamurthy.  Android is an Operating system.  Android is an emerging platform for mobile devices.  Initially developed.
Data Persistence in Android
Data Access Patterns. Motivation Most software systems require persistent data (i.e. data that persists between program executions). In general, distributing.
Data Storage: Part 1 (Preferences)
About me Yichuan Wang Android Basics Credit goes to Google and UMBC.
McGraw-Hill© 2007 The McGraw-Hill Companies, Inc. All rights reserved. 1-1.
Java Beans.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
XML in SQL Server Overview XML is a key part of any modern data environment It can be used to transmit data in a platform, application neutral form.
Favorite Twitter® Searches App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Android development basics Introduction,Structure,Development Boncho Valkov.Net Developer.
Developing Enterprise Mobile Apps with Xamarin Loren Horsager CEO, Mobile Composer.
Mobile Application Development using Android Lecture 2.
DUE Hello World on the Android Platform.
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.
INTRODUCTION TO ANDROID. Slide 2 Application Components An Android application is made of up one or more of the following components Activities We will.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
Serialization. Serialization is the process of converting an object into an intermediate format that can be stored (e.g. in a file or transmitted across.
COMP 365 Android Development.  Every android application has a manifest file called AndroidManifest.xml  Found in the Project folder  Contains critical.
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.
Nilesh Singh Local Data Storage option Android provides several options for you to save persistent application data. - Shared preferences - Creation.
Data persistence How to save data using SharedPreferences, Files, and SQLite database 1Data persistence.
0 Y! Mail Application Development Platform Open Hack day 14 th Feb 2009.
Data Persistence Nasrullah Niazi. Share Preferences The SharedPreferences class provides a general framework that allows you to save and retrieve persistent.
Creating an Example Android App in Android Studio Activity lifecycle & UI Resources.
Object Oriented Software Development 10. Persistent Storage.
First Venture into the Android World Chapter 1 Part 2.
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.
ASP.Net, Web Forms and Web Controls 1 Outline Session Tracking Cookies Session Tracking with HttpSessionState.
A Guide to Getting Started. 2 Free social learning network for teachers, students, schools and districts Safe and easy way to connect Exchange ideas Share.
Android System Security Xinming Ou. Android System Basics An open-source operating system for mobile devices (AOSP, led by Google) – Consists of a base.
A Guide to Getting Started BCPS – Office of Instructional Technology.
ANDROID AND MODEL / VIEW / CONTROLLER. Slide 2 Design Patters Common solutions to programming problems are called design patterns Design patterns are.
SQLite DB Storing Data in Android RAVI GAURAV PANDEY 1.
© 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.
CHAPTER 9 File Storage Shared Preferences SQLite.
Exploring Networked Data and Data Stores Lesson 3.
INTRODUCTION TO ANDROID. Slide 2 Introduction I take a top-down approach to describing an application’s anatomy.
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.
Chapter 2 – Introduction to Windows Operating System II Manipulating Windows GUI 1CMPF112 Computing Skills for Engineers.
Data Persistence Chapter 9. Objectives Learn about data storage methods Understand use of Shared Preferences Understand file-based storage and the differences.
Menus. Menus are a common user interface component in many types of applications. The options menu is the primary collection of menu items for an activity.
Mobile Applications (Android Programming)
Android Application Data Storage 1.
MAD.
Mobile Application Development Chapter 5 [Persistent Data in Android]
Store, Share, Sync and Collaborate
The Object-Oriented Thought Process Chapter 12
Reactive Android Development
Phonegap Bridge Configuration file
Application Development A Tutorial Driven Course
HTML5 and Local Storage.
A QUICK START TO OPL IBM ILOG OPL V6.3 > Starting Kit >
Emerging Platform#3 Android & Programming an App
Android Development Tools
Preference Activity class
Presentation transcript:

Mobile Application Development Data Storage

Android provides several options for you to save persistent application data. The solution you choose depends on your specific needs, such as whether the data should be private to your application or accessible to other applications (and the user) and how much space your data requires.

Your data storage options are the following: Shared PreferencesStore private primitive data in key-value pairs. Internal Storage Store private data on the device memory. External Storage store public data on the shared external storage. SQLLite databasesStore structured data in a private database. Network ConnectionStore data on the web with your own network server.

What is preferences Shared preferences are simply sets of data values that are stored persistently. By persistence, we are talking about data that persists across application lifecycle events. In other words, the application (or device, for that matter) can be started and stopped without losing the data. The next time the user launches the application, that data will still be available. An individual preference is simply a key-value pair with a specific data type for the value. The preference key is simply a string that uniquely identifies the preference and the value is just that: the value of that preference.

For example, your application might want to store the user’s name. The application could have a single preference to store this information: The data type of the preference could be a String The key could be a string called “UserName” The value would be the actual username string, such as “AndroidPowerUser123” or “NASR”

A preference can be any of a number of different data types. The following data types are supported by the SharedPreferences class:  Boolean values  Float values  Integer values  Long values  String values

How shared Preference work a game application might have a set of preferences for user information (user name, , high score, etc.) and a set of preferences for game state (current level, current score, etc.). Preferences can be stored at the activity or application level. Application-level preferences are available across all activities. These preferences are retrieved using the application Context class method called getSharedPreferences() by name. For example:

How shared Preference work Import android.content.sharedPreferences;

Preferences Preferences are user-specific settings for an application. Preferences usually consist of some configuration data as well as a user interface to manipulate that data

Preferences From user interface point of view preferences can be simple text values, checkboxes, selections from a pull-down menu, or similar. From data point of view, preferences is a collection of name-value pairs, also known as key-value or attribute-value pairs. The values are basic data types, such as integers, Booleans, strings, and similar

preferences is the root element that defines our main preference screen. It has three children, all. This is simply a piece of editable text. Other common elements here could be,, and so on.

Android System Resources To refer to Android system resources prefix them with with android:keyword in XML, for es. If you are referring to an Android system resource from Java, then you use android.R instead the usual R reference. The actual resource files are in your SDK, inside specific platform folder. For example, if you are using Android 9 (Gingerbread), the location of the resource folder would be android- sdk/platforms/android-9/data/res/.

Shared Preferences class this class is called SharedPreference refers to the fact that this preference is easily accessible from anywhere in this application. So, any component of an Android application, such as Activities, Services, Broadcast Receivers, and Content Providers.