• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/126

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

126 Cards in this Set

  • Front
  • Back

what was the timeline of major players of early mobile devices?

Motorola Brick


- expensive, big




Apple Newton


- PDA


- tablet and stylus




Motorola Marco/Envoy


- wireless

what was important about the form factor of mobile devices?

PDAs were large devices




palm-sized devices were introduced later, and hand-held form factor became very common

what was the role of the telecommunications industry in shaping mobile devices? what's an example of such device and what did it look like and have?

combined PDA features with networked applications (telnet, phone, fax) / digital cellular telephony




Nokia Communicator


- clamshell design


- qwerty keyboard

what are two initial innovations of mobile devices?

Low-power mobile processors


Higher quality displays


- gaming and multimedia capable


- eased disappearance of hardware keyboard


- evolution to multi touch screens

what are two initial technologies of mobile devices?

Low-power, meter-accuracy GPS technologies


Embedded sensors

what are the 3 new software architectures/native platforms?

Apple iOS


Google Android


Microsoft Windows Phone

what is android? (composed of two things)

mobile operating system + app framework

what are some multiplatform examples of android/

smartwatch


TV


car systems

what is the latest version of Android? what are some of the latest?

marshmallow (6.0)




lollipop, kitkat, jellybean, ice cream sandwich

what is android's OS based on, and what is it designed to run on?

based on linux


designed to run on mobile devices

what does android's complete application framework allow us to do?

allows us to create and deploy our own custom apps

what are the 4 application components?

activities


services


broadcast receivers


content providers

what things do you put in:




res/layout


res/menu


res/drawable


res/raw


res/values

res/layout - XML for layout


res/menu - XML for menu specs


res/drawable - images


res/raw - general purpose files (e.g. audio)


res/values - strings, dimensions, styles

what is in the AndroidManifest.xml file?

contains app name, app activities, permissions, etc.

what is the Android Device Monitor (DDMS)?

provides a graphical user interface for several Android application debugging and analysis tools

how to log messages with LogCat?

Log.v(String tag, String message);

what is an activity?

an application component that provides a screen

why do we need to know about the activity lifecycle?

fine-tune behaviour of activity/app




- app shouldn't crash when another starts


- don't lose user progress


- don't lose user data


- don't do heavy processing when user is away in another app

what is the activity lifecycle?

onCreate() (or onRestart())


onStart()


onResume()




onPause()


onStop()




onDestroy()

when logging, what should you keep in mind and what should you do after the app is complete?

Logging uses memory and CPU resources




When app is complete (ready to be released) make sure that you remove the log messages

every time device orientation changes, what lifecycle methods get called and what does this mean?


activity is destroyed and recreated




onPause


onStop


onDestroy


onCreate


onStart


onResume

when is onSaveInstanceState() called? (after which method)

the onSaveInstanceState() method is called each time the activity is paused -> after onPause

when is onRestoreInstanceState() called? (after which method)

Called automatically by the Android system aper onStart()

what is bundle? and which two methods share the same bundle as a parameter?

a map: Key – Value




after the system recreates the activity aper destroying it, the onRestoreInstanceState() and onCreate() methods receive the same Bundle

how to save things in the bundle? (code)

in saveinstancestate:


outstate.putInt("KEY", value);

how to get things from the bundle? (code)

in onRestoreInstanceState:


int retrievedCounter = savedInstanceState.getInt("KEY");

what is the Context class?

Interface to global information about an application environment

what can the application context do?

- retrieve app resources (strings, images, XML)

- access app preferences


- manage private app files and directories


- work with app permissions

difference between app and system resources

App resources - defined by the developer within the Android project files and are specific to the application




System resources - common resources defined by the Android platform and accessible to all applications through the Android SDK

how to reference application resources programmatically?

using the generated classfilecalled R.java

what are the 3 steps in a button click in terms of android system?

1. button is clicked


2. android system receives event


3. only the listener is interested in reacting to the event

what are the 4 steps to implementing button click?

1. tell android we want to listen to button click


- implement View.OnClickListener




2. retrieve button from XML into Java code


- findViewById




3. tell java we're listening to button


- setOnClickListener




4. create behaviour for what should happen when button is clicked


- onClick method

what is the difference between a view and a view group?

view - object, occupies a rectangular area on screen and is responsible for handling events (e.g. button)




view group - occupies rectangular area on screen, is invisible and holds other views in a certain structure (vertically, horizontally, grid, etc)

what does layout_weight do? what happens if you give something weight 1 and everything else isn't set?

assign priority or importance to a certain view (more space)




if something's set to 1, that will fill up all the space remaining





what is LinearLayout?

viewgroup that stacks items horizontally or vertically

difference between layout_gravity and gravity

layout_gravity is where the item is positioned in its parent




gravity is where item is positioned inside itself (doesn't work if it's wrap_content)

what can a ListView do?

Can display large amount of data




Manages the data for display on devices of various sizes

what are the 3 steps to creating a ListView?

1. define data source (e.g. array)


2. define listadapter


3. define user interaction


- onItemClick

what does an adapter do?

adapter accesses the data and displays it in a view (ListView, GridView, Spinner, etc)

what are intents and what do they do?

Asynchronous messages that allow Android components to request functionality from other components of the Android system

what do intent filters do?

specifies the types of intents that an activity, service, or broadcast receiver can respond to

what can intents do in terms of signalling? how do components understand this signalling?

used to signal the Android system that a certain event has occurred




components can register to this event via intent filters

what 3 components can intents be sent to?

activities


services


broadcast receivers

difference between explicit and implicit intents?

explicit = explicitly define the component which should be called by the Android system, using java class identifier




implicit = specify the action which should be performed

what are the two methods you need to retrieve result data from the called activity? what's an example?

startActivityForResult()




onActivityResult()




e.g. start contacts app to select contact; receive contact details as result

what are the 3 types of sensors? give examples

motion sensors


- accelerometer


environmental sensors


- temperature sensor


position sensors


- orientation sensor, magnometer

guidelines when accessing hardware

- don't assume hardware exists


- always check and verify optional features


- exception handling and errors


- return value checking


- acquire late and release early


- do not drain the device battery by misusing hardware resources

what 4 classes are part of the sensor framework? what do they do?

SensorManager


- access sensors, register




Sensor


- instance of sensor with methods that let you determine sensor capabilities




SensorEvent


- event object provides info like raw data, type of sensor, etc




SensorEventListener


- interface with 2 callback methods that notifies you when sensor accuracy and values change

what are 2 sensor related tasks?

Identifying sensors and sensor capabilities


- disable parts of app that use sensors not present on device


- choose optimum sensor for your app




Monitor sensor events


- get data when sensor changes

4 step process in working with sensors

1. Determine which sensors are available on a device




2. Determine an individual sensor's capabilities, such as its maximum range, manufacturer, power requirements, and resolution




3. Acquire raw sensor data and define the minimum rate at which you acquire sensor data




4. Register and unregister sensor event listeners that monitor sensor changes

what are android system services? give examples

gives you info about the various system components




e.g. PowerService gives info about power of system so you can detect low battery




e.g. VibrationService allows you to vibrate the phone

how to get android system services with code

PowerManager sm = (PowerManager) getSystemService(Context.POWER_SERVICE);

5 types of persistent storage

SharedPrefs


internal storage


external storage


SQLite database


network connection


- on the web with network server

what are shared prefs? are they private?

primitive data stored as key/ value pairs




private to the app

what kind of data can be stored in shared prefs? what are examples of things you would store?

Only allow primitive data types: boolean, long, int, float, string




e.g. store username pasword

two methods to access preferences and why use them?

getPreferences() - just one file


getSharedPreferences() - more than one file

5 use cases where you'd use preferences

- store user details


- remember last user location


- check when app was last updated


- store user settings


- check if user using app for first time

4 steps to using sharedprefs to store data?

1. get reference to SharedPreferences object


- getSharedPreferences() or getPreferences()


2. call editor - edit()


3. use editor to add data with key


- putBoolean, putInt


4. commit editor changes - commit()

what is SQLite?

language for managing data in relational databases

3 characteristics of app database

- self-contained


- transaction-based


- no server

3 steps to creating SQLite database schema

1. define schema (database name, version, table name, column names)




2. create database using queries




3. execute queries (e.g. insert, delete, update)

what does the SQLiteOpenHelper class do? 3 things

- opens database if it exists


- creates database if it doesn't exist


- updates database as necessary

what are the 2 methods that SQLiteOpenHelper has?

onCreate() - called when db first created


onUpgrade() - called whenever db updated

how to insert values in database?

create ContentValues object


put key and value into content values e.g.


contentValues.put("name", name);




db.insert(table name, null, contentValues);

what does the query method do? how does it work? what does it return?

reads data from database




pass selection criteria and the desired columns, returns a Cursor

what does a cursor object do?

gives us access to the results returned from a database query




allows navigation through the result set

what can SimpleCursorAdapter do? what can you specify?

easy adapter to map columns from a cursor to TextViews or ImageViews defined in an XML file




specify which columns you want, which views you want to display the columns, and the XML file that defines the appearance of these views

what is a process? what memory space does it run in?

an executing instance of an application, that runs in its own memory space

what is a thread? does it run in its own memory space?

path of execution within a process




threads share the same memory space

what is the relationship between a process and a thread?

one process can be associated with several threads

what are the 3 steps of a default process starting?

1. Application component starts first time


2. Android starts a new process, in a single thread of execution (default)


3. Another component of the app starts (e.g. a service) it will run in the same process and same thread

what is the process ranking of termination?

1. foreground process


2. visible process (e.g. onPause)


3. service process


4. background process


5. empty process

4 ways to avoid blocking UI thread

- don't perform long running operations in main thread


- use additional threads for complex tasks


- do not modify UI from background threads


- use services

what is async thread good for?

tasks lasting between 100ms to a few seconds

why use async task? 2 reasons

easier to implement in comparison to thread and handler




automates


- creation / termination of background thread


- managing of message queues


- Updating on progress

what are the steps to implement async task

1. create subclass of AsyncTask


2. Override one or more AsyncTask methods to:


- do work in bg thread


- handle UI updates in main thread

what are async task methods and where do they get called?

main thread


- execute()


- onPreExecute()




bg thread


- doInBackground()


- publishProcess()




main thread


- onProgressUpdate()


- onPostExecute()

what are the 3 parameters for async task and explain them

Param - type of parameter sent to the task for exercution




Progress - Type of the info used to indicate progress




Result - Type of the result received from the background task

what are the 2 types of services?

started


- started by app component




bound


- app binds to it

what are uses for service?

- handle network transactions


- play music


- interact with content provider


- perform file i/o

how to create a service?

1. create subclass of service


2. declare service in manifest


3. override onCreate() and onDestroy()


4. override onBind() for cases when a new component binds to the service after it has been already created


5. activate service from external trigger

how does a started service start and stop itself?

starts when another component calls startService()




stops by calling stopSelf() or another component calls stopService()

how does a bound service start and stop itself?

created when another component (client) calls bindService()




client closes connection with unbindService()




stops when all clients unbind

what is webview?

View that displays web pages/online content in your activity



2 ways how can webview be used?

1. instead of built in browser


- provide info like user guide


- display documents hosted online




2. application provides data that always requires internet connection to retrieve data


- as opposed to performing network request and parsing data to display in Android layout

what are the built in webview functionality

display page


navigate forward/back


zoom in and out


perform searches


capture images of page


search page for string


deal with cookies



what are web services

means of exposing an API over a technology-neutral network endpoint

Steps in accessing and capturing data from a web service

1. check network connection


2. perform network operation in separate thread


3. connect and download data


4. convert data from network into a target data type

what is JSON

javascript object notation




way to represent JavaScript objects as Strings

when you check network connection (1st step) what 2 methods do you use and what 2 things should you look out for

getActiveNetworkInfo()


isConnected()




watch out for:


- device maybe out of range of network


- user disabled wifi or data

in step 2, perform network op in separate thread, what is the process in AsyncTask?

use AsyncTask




in doInBackground(), connect to web service using URL




readJSONData() method returns a JSON string with the result from the web service




JSON string with the result is provided to the onPostExecute() method

in step 3, connect and download data, what do you use to send/receive data and what's the 5 step process?

HTTPUrlConnection




1. obtain connection by calling URL.openConnection()


2. prepare request


3. transmit data with getInputStream()


4. read response


5. disconnect with disconnect()

what is a fragment?

“Chunks” of UI

4 fragment characteristics

- Small component / portion / chunk of UI


- has its own lifecycle


- can process its own events


- can be added or removed when activity runs

2 pros of using fragments

- combine several fragments in one activity for flexibility and dynamic UI design


- accommodate larger screen sizes and portrait/landscape

what are the 4 steps to create fragments?

1. create class for fragment


2. provide layout/appearance for fragment


3. override onCreateView() method to link the layout to the Java class from Step 1


4. use fragment in XML or java

what is the fragment lifecycle?

onAttach()


onCreate()


onCreateView()


onActivityCreated()


onStart()


onResume()


onPause()


onSaveInstanceState()


onStop()


onDestroyView()


onDetach()

how to add fragment to activity? 2 ways

XML - static


java - add fragment at runtime in response to user interaction

what are the 3 steps of fragment transactions? with code

1. begin transaction


- get reference to fragment manager and fragment


- instantiate transaction




2. add/remove/replace fragments


- transaction.add(R.id.mylayout, frag, "frag");




3. commit transaction


- transaction.commit()

why do you need communication between fragments give example

user performs some interaction on Fragment 1; this interaction will lead to some event happening in Fragment 2




e.g. edit text enter some text, display in textview

what's the rule when communicating between fragments and how do you do it

rule = do not maintain references of one fragment within another fragment




create interface with method


contain Communicate interface object in frag1, and call the method


override method in MainActivity and pass data from frag1 to frag2

what is drag and drop?

Allow users to move data from one View to another View in the current layout using a graphical drag and drop gesture

what are the 5 steps of drag and drop?

1. user makes gesture


2. app tells system that drag is starting


3. gets representation of data being dragged (drag shadow)


4. system sends drag events to drag listeners, and drag event callbacks associated with view


5. once user releases drag shadow, drag op ends

what are the 4 states of drag and drop?

started - user makes gesture to begin drag


continuing - user continues to drag


dropped - user releases drag shadow within bounding box of view that can accept it


ended - drag operation over



what's the drag shadow? how to create?

the shadow image represents the data being dragged




View.DragShadowBuilder

5 steps in designing drag/drop operation?

1. start a drag


- create ClipData and DragShadowBuilder


- in onTouch




2. respond to events during drag


- listeners should react by calling getAction() to figure out action type, and switch


- in onDrag




3. handling events during the drag


- listeners receive events like location of drag shadow and visibility of listener's view




4. responding to a drop


- view previously reported that it could accept the content being dragged


- system dispatches a drag event to that View with the action type ACTION_DROP




5. responding to drag end


- system sends a drag event to all of the drag event listeners in the activity, with an action type of ACTION_DRAG_ENDED


- this says it's over

what are the 3 requirements for adding a Google Map into an app?

1. provide API key in manifest file


2. edit manifest file to integrate google play services


3. check google APK in java with servicesOK()

how to display a google map? 2 steps

create new layout file, which is a fragment


setContentView if servicesOK()

how to change where we center on the map? XML and java approach

XML


- set camera attributes inside fragment




java


- gotoLocation(double lat, double lng) method


- CameraUpdate

what can geocoding do? 2 things

Pass in lat and lng and get back matching location




Pass in city name, postal code or landmark and get back lat and lng

what does GeoCoder class do? what are its 2 methods

Wraps up all request and response functionality, returns everything back to us as a Java object




getFromLocation()


getFromLocationName()

how to use getFromLocation?

mygeocoder.getFromLocation(Double.parseDouble(latString), Double.parseDouble(lngString));




save that into a list, and then get the first index from the list




Address add = list.get(0);


add.getLocality();


add.getLongitude();


add.getLatitude();

how to find current location in non-code approach?

add permissions to manifest


ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION




map.setMyLocationEnabled(true);




this shows a button

how to find current location in code approach?

1. add menu item - current location


2. implement GoogleApiClient


3. create location client


4. showCurrentLocation method

how does showCurrentLocation method work?

use getLastLocation method and assign that to a currentLocation object




then do same thing with cameraupdate and latlng with currentLocation.getLatitude() etc

describe linux kernel layer




what's an example

linux itself and a set of drivers




each driver interfaces with some aspect of the Android device




e.g. camera driver

describe libraries and android runtime layer




what's an example of a library



set of core libraries and a virtual machine


(e.g. sqlite database)

describe application framework layer and give example

modules for controlling the different components of an app




e.g. activity manager

describe application layer and give example

apps we download, are included, or build ourselves




phone

what lifecycle methods get called if user launches an app for first time?

onCreate()


onStart()


onResume()

what are some examples of blocking operations?

- complex calculations


- accessing network resources


- accessing local database


- parsing data set


- accessing content provider

what two managers monitor the app for responsiveness? what happens if it's not responsive?

activity manager


window manager




if it takes more than 5 seconds, ANR dialog triggered

what is the bound service lifecycle?

call to bindService()




onCreate()


onBind()


onUnbind()


onDestroy()

what is the started service lifecycle?

call to startService()




onCreate()


onStartCommand()


onDestroy



what are the general service lifecycle callbacks?

onCreate()


onStartCommand()


onBind()


onDestroy()

if a service is bound to an activity and the activity is destroyed or paused, what happens to the service?

keeps running