final Flashcards

1
Q

SQL: databaseOpenHelper:

OnUpgrade()

A

&laquo_space;if version is newer version is higher than old version. drop table statement, onCreate()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Greedy

A

finds the best language:

1) Values-EN-Rca

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Match parent

A

size of parent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

LifeCycle functions:

A
OnCreate(Bundle b)
OnStart
OnResume
OnPause
OnClose
OnDestroy
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Sharedpreference:

A

putstring, getstring if they don’t match you get default value not 0. are also used for saving files and such

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Types of Log

A
Log.i
Log.w
Log.e
Log.d
Log.v
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

ListAdapter functions:

A

getCount(), getItem(), getItemId(), getView(), setOnItemClick(), setAdapter(), notifyItemsChanged()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

SQL: databaseOpenHelper:

OnCreate()

A

&laquo_space;SQL Creation statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Log.i

A

informational messages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Android is

A

android is linux,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

APK

A

zip file that has xml, java, png, jpg

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Root tag

A

first tag being declared (not xml version tag), android.support.constraintlayout…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Android uses

A

android uses java and xml

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

FindViewById

A

returns null if not found in the layout.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Log.d

A

debug messages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

SQL: databaseOpenHelper:

OnOpen()

A

&laquo_space;all cases calls this

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Toolbar items have what

A

Items have an Id, orderInCategory, icon, showAsAction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Log.w

A

warning messages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Parameter

A

id, layout_width etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

XML is

A

case sensitive, well formed, must have closing tags.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

toolbar showAsAction

A

showAsAction can be: always(always be icon), never(be text) or if room(text)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Log.v

A

verbose messages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Logging levels:

A

info, error, debug, verbose

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What does Bundle return?

A

Bundle returns 0 or null

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Toolbar OrderInCategory

A

to left has a small order category, to the right has large order category

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Fragments for phone:

A

No frameLayout in XML

FindViewById() - returns null

OnEvents – whenever something happens you must startActivity (go from one activity to the other, second one has the frame layout)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Onclick events what happens for phone

A

either start a new activity (phone)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

SQL: databaseOpenHelper:

OnDowngrade()

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Wrap content

A

minimum size needed to show content

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Name space part in XML:

A

android, app, tools

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

String XML format and how to reference it?

A

Value

to reference it – android:text=”@string/Key”

which gives - getResources().getString(R.string.Key);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

how does Bundle and SharedPreferences work in the same way?

A

put – get(): put something get something ex. Put(name, value) get(name){returns value}

BUT

If you put in as a string and get an int, returns default value – must be matching data types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Fragments for tablet:

A

Has framLayout in XML

FindViewById() - returns not null

Both layouts are seen on one screen

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

LinearLayout – default orientation

A

horizontal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

Log.e

A

error messages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

if SharedPreferences cannot find a name

A

SharedPreferences has default answers if the name is not found

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

Onclick events what happens for tablet

A

you start a fragment transaction (tablet)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

FragmentManager beginTransaction

A

.Add (frameLayout, Fragment) , .remove (Fragment), .replace (frameLayout, Fragment)
.commit();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

Content values:

A

Put(Name, Value);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

For all columns

A

one put statement for every column. Doesn’t get called unless you call insert()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

SharedPreferences only gets called with what?

A

shared Preferences only gets called with commit();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

For a linear Layout If first button is width = match parent where will the second button appear?

A

second button will not show (off screen on layout).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

RelativeLayout – default orientation/position -

A

top left

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

What must you use for start activity

A

onActivityForResult(int requestCode) to start activity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

Where does the request code get sent for startActivity?

A

The request code gets sent to onActivityResult(requestCode, resultCode, intent) and the request code gets sent back

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

Where does the result come from for startActivity?

A

the result is from setResult(resultCode, intent).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

Which was the first smartphone available that ran Android?

A

HTC Dream

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

Is the following XML code legal syntax: “item 1 “

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

Which folder would contain the resource: “R.drawable.a_picture”

A

res/drawable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

Which folder would contain the strings.xml file for the German language?

A

values-de

51
Q

When compiling your Android project, which gets compiled first?

A

XML files

52
Q

Does Android version 4.4 (KitKat) natively support Fragments (not using the support library)?

A

Yes

53
Q

Arrayadapter

A

displaying array of strings

54
Q

Which function gets called first in the Android Lifecycle:

A

onCreate

55
Q

Is the following XML tag legal syntax: “ Hello world “

A

No

56
Q

What operating system is Android based on?

A

Linux

57
Q

BaseAdapter

A

displaying complicated data

58
Q

Does Android version 2.2 (Froyo) natively support Fragments (not using the support library)?

A

No

59
Q

Is the following XML tag legal syntax: “<ul><li>Bananas </li><li> apples </li></ul> “

A

No

60
Q

CursorAdapter

A

displaying results of SQL queries. Can handle mapping more than one value to more than one view ID.

61
Q

getCount()

A

returns the number of items

62
Q

Cursor c

A

holds the results from the SQL query

63
Q

Which folder would contain the resource: “R.layout.first_page”

A

res/layout

64
Q

Which file specifies the starting Activity for an application?

A

AndroidManifest.xml

65
Q

What does the first parameter in getSharedPreferences(“a_string”, Context.MODE_PRIVATE)?

A

The file name

66
Q

If the bundle parameter for the onCreate(Bundle savedInstance) is not null, which function gets called automatically?

A

onRestoreInstanceState(Bundle savedInstanceState)

67
Q

Which function gets called last in the Android Lifecycle:

A

onDestroy

68
Q

getItem(int position)

A

returns specific item

69
Q

Long getItemId(int i)

A

returns the database id of the item at position i

70
Q

When is the bundle parameter for the onCreate(Bundle savedInstance) null?

A

When the application is loaded for the first time

71
Q

When you call putString(“string_one”, “string_two”), which string that represents the value (not name)?

A

“string_two”

72
Q

View getView()

A

creates a view object to go in a row of the ListView

73
Q

How to start a listview

A

doesn’t start gets without this:

Listview.setAdapter(od);
Od.notifyItemsChanged();

74
Q

What order do the listView functions get called in?

A

First called: getCount second called: getView third called: getItem

getCount(# of items), then you call getItems(int I – always less than getCount params, string of I), getItemId(int I – database If of i) getItemId() important for onItemClick(int I, long ln), getView(int I, view v(recycled item that was scrolled off page and unused – to use memory), null)inflates the view from a layout.

75
Q

what does the listview setAdapter(listAdapter obj) need?

A

The adapter object needs a layout.

76
Q

for a relative layout If 2 buttons are width = match parent

A

only second button will show (buttons are laid overtop of each other)

77
Q

relative layout has what layout options

A

toRightOf
toLeftOf
below
above

78
Q

relative layout If second button is layout_above first button

A

second button will not show (off screen on layout)

79
Q

Async 3 important functions

A

doInBackground()
onProgressUpdate()
onPostExecute()

80
Q

Async will only work if you call what?

A

execute()

81
Q

code for Async

A

AsyncTask

82
Q

cursor functions

A
getCount()
moveToFirst() 
moveToNext()
getString(int columnIndex)
getInt(int column)
getColumnIndex(String columnName)
isAfterLast()
83
Q

what gets passed to onPostExecute

A

whatever gets passed from doInBackground gets passed to onpostexecute

84
Q

parameters for onPostExecute

A

T3

85
Q

parameters for DoInBackground

A

(T1 … args)

86
Q

parameters for publishProgress

A

(T2…)

87
Q

who calls publishProgress

A

we do

88
Q

who calls onProgressUpdate

A

android calls

89
Q

when can the GUI be updated

A

Can only update GUI on postExecute() or onProgressUpdate()

90
Q

where can you only access the network

A

doInBackground()

91
Q

Which function must you call to retrieve the saved string from the sharedPreferences call: putString(“string_one”, “string_two”)

A

getString(“string_one”, “string_three”)

92
Q

Which function must you call to start an activity when you want to get data back?

A

startActivityForResult()

93
Q

What function must you call to end an Activity?

A

finish()

94
Q

If you call setResult(Activity.RESULT_OK), what will be the value of the request code parameter in onActivityResult(int request, int result, Intent data)?

A

Unknown

95
Q

What is the proper format for creating a Toast message?

A

Toast.makeText(getApplicationContext(), “The message”, Toast.LENGTH_SHORT);

96
Q

What design pattern is used when chaining many function calls for creating an AlertDialog: dialog.setMessage().setTitle()
.setPositiveButton().setNegativeButton()
.show();?

A

The builder pattern

97
Q

Which of the following functions is required for implementing the ListAdapter interface

A

getCount

98
Q

What is the corresponding SQL query to this function: db.query(true, “PURCHASES”, new String []{“Price”, “Quantity”}, “Quantity > ?”, new String[] {“10” }, null, null, null, null)?

A

Select distinct Price,Quantity from PURCHASES where Quantity > 10

99
Q

When you write a ListView adapter class, which function gets called first when populating the ListView:

A

getCount

100
Q

Which of the following functions causes a ListView to start the re-population of the list:

A

notifyDataSetChanged

101
Q

This is a fragment of an SQL query clause: “ ? = ? AND ? NOT NULL”, new String [] { “Brandname”, “Nike”, “CUSTOMER_NAME”}. What will be the corresponding SQL Where clause:

A

Brandname = Nike and CUSTOMER_NAME NOT NULL

102
Q

What is the ViewHolder pattern?

A

When ListView cells that are scrolled off screen get re-used for new cells coming into view on the screen

103
Q

What function for getting a database object must you call if you want to insert values?

A

getWriteableDatabase

104
Q

In which version of Android was the Toolbar introduced?

A

5.0

105
Q

What was the previous object that represented a navigation bar?

A

ActionBar

106
Q

Where is a Toolbar placed in the Activity?

A

It depends on the Layout

107
Q

What resource object is used to specify the layout of the Toolbar?

A

Menu

108
Q

What resource object specifies what will be in the menu?

A

Item

109
Q

What controls the order of the items in a menu?

A

The orderInCategory parameter

110
Q

In which function should you inflate the menu?

A

onCreateOptionsMenu

111
Q

Which function gets called in response to the user picking an item from the menu?

A

onOptionsItemSelected

112
Q

What is the design pattern that is used for creating DialogBoxes?

A

Builder pattern

113
Q

What function do you call to set the view of a Dialog box?

A

setView

114
Q

In an AsyncTask, which function runs on a background thread?

A

doInBackground

115
Q

In an AsyncTask, which function runs on the main GUI thread?

A

onProgressUpdate

116
Q

In an XMLPullParser, which is the first event type that happens?

A

START_DOCUMENT

117
Q

In an XMLPullParser, which event type corresponds to this tag: ?

A

END_TAG

118
Q

In an XMLPullParser, which event type corresponds to “Hi” in this example: Hi ?

A

TEXT

119
Q

Which function in Android returns the directory for opening files?

A

getFilesDir

120
Q

Which permissions do you need to write to an External Folder?

A

WRITE_EXTERNAL_STORAGE

121
Q

If a tablet has a screen size of 800x600 pixels, which folder name should you use to create a layout for this tablet?

A

layout-sw600dp

122
Q

Which function should you use to inflate the view of a Fragment?

A

onAttach

123
Q

What object is used to create a FragmentTransaction?

A

FragmentManager

124
Q

What XML tag should you put in an XML layout to show where a Fragment should go?

A

framelayout