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
Toolbar OrderInCategory
to left has a small order category, to the right has large order category
26
Fragments for phone:
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)
27
Onclick events what happens for phone
either start a new activity (phone)
28
SQL: databaseOpenHelper: | OnDowngrade()
29
Wrap content
minimum size needed to show content
30
Name space part in XML:
android, app, tools
31
String XML format and how to reference it?
Value to reference it – android:text=”@string/Key” which gives - getResources().getString(R.string.Key);
32
how does Bundle and SharedPreferences work in the same way?
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
33
Fragments for tablet:
Has framLayout in XML FindViewById() - returns not null Both layouts are seen on one screen
34
LinearLayout – default orientation
horizontal
35
Log.e
error messages
36
if SharedPreferences cannot find a name
SharedPreferences has default answers if the name is not found
37
Onclick events what happens for tablet
you start a fragment transaction (tablet)
38
FragmentManager beginTransaction
.Add (frameLayout, Fragment) , .remove (Fragment), .replace (frameLayout, Fragment) .commit();
39
Content values:
Put(Name, Value);
40
For all columns
one put statement for every column. Doesn’t get called unless you call insert()
41
SharedPreferences only gets called with what?
shared Preferences only gets called with commit();
42
For a linear Layout If first button is width = match parent where will the second button appear?
second button will not show (off screen on layout).
43
RelativeLayout – default orientation/position -
top left
44
What must you use for start activity
onActivityForResult(int requestCode) to start activity.
45
Where does the request code get sent for startActivity?
The request code gets sent to onActivityResult(requestCode, resultCode, intent) and the request code gets sent back
46
Where does the result come from for startActivity?
the result is from setResult(resultCode, intent).
47
Which was the first smartphone available that ran Android?
HTC Dream
48
Is the following XML code legal syntax: “item 1 "
Yes
49
Which folder would contain the resource: "R.drawable.a_picture"
res/drawable
50
Which folder would contain the strings.xml file for the German language?
values-de
51
When compiling your Android project, which gets compiled first?
XML files
52
Does Android version 4.4 (KitKat) natively support Fragments (not using the support library)?
Yes
53
Arrayadapter
displaying array of strings
54
Which function gets called first in the Android Lifecycle:
onCreate
55
Is the following XML tag legal syntax: " Hello world "
No
56
What operating system is Android based on?
Linux
57
BaseAdapter
displaying complicated data
58
Does Android version 2.2 (Froyo) natively support Fragments (not using the support library)?
No
59
Is the following XML tag legal syntax: “
  • Bananas
  • apples
"
No
60
CursorAdapter
displaying results of SQL queries. Can handle mapping more than one value to more than one view ID.
61
getCount()
returns the number of items
62
Cursor c
holds the results from the SQL query
63
Which folder would contain the resource: "R.layout.first_page"
res/layout
64
Which file specifies the starting Activity for an application?
AndroidManifest.xml
65
What does the first parameter in getSharedPreferences("a_string", Context.MODE_PRIVATE)?
The file name
66
If the bundle parameter for the onCreate(Bundle savedInstance) is not null, which function gets called automatically?
onRestoreInstanceState(Bundle savedInstanceState)
67
Which function gets called last in the Android Lifecycle:
onDestroy
68
getItem(int position)
returns specific item
69
Long getItemId(int i)
returns the database id of the item at position i
70
When is the bundle parameter for the onCreate(Bundle savedInstance) null?
When the application is loaded for the first time
71
When you call putString("string_one", "string_two"), which string that represents the value (not name)?
"string_two"
72
View getView()
creates a view object to go in a row of the ListView
73
How to start a listview
doesn’t start gets without this: Listview.setAdapter(od); Od.notifyItemsChanged();
74
What order do the listView functions get called in?
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
what does the listview setAdapter(listAdapter obj) need?
The adapter object needs a layout.
76
for a relative layout If 2 buttons are width = match parent
only second button will show (buttons are laid overtop of each other)
77
relative layout has what layout options
toRightOf toLeftOf below above
78
relative layout If second button is layout_above first button
second button will not show (off screen on layout)
79
Async 3 important functions
doInBackground() onProgressUpdate() onPostExecute()
80
Async will only work if you call what?
execute()
81
code for Async
AsyncTask
82
cursor functions
``` getCount() moveToFirst() moveToNext() getString(int columnIndex) getInt(int column) getColumnIndex(String columnName) isAfterLast() ```
83
what gets passed to onPostExecute
whatever gets passed from doInBackground gets passed to onpostexecute
84
parameters for onPostExecute
T3
85
parameters for DoInBackground
(T1 … args)
86
parameters for publishProgress
(T2…)
87
who calls publishProgress
we do
88
who calls onProgressUpdate
android calls
89
when can the GUI be updated
Can only update GUI on postExecute() or onProgressUpdate()
90
where can you only access the network
doInBackground()
91
Which function must you call to retrieve the saved string from the sharedPreferences call: putString("string_one", "string_two")
getString("string_one", "string_three")
92
Which function must you call to start an activity when you want to get data back?
startActivityForResult()
93
What function must you call to end an Activity?
finish()
94
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)?
Unknown
95
What is the proper format for creating a Toast message?
Toast.makeText(getApplicationContext(), "The message", Toast.LENGTH_SHORT);
96
What design pattern is used when chaining many function calls for creating an AlertDialog: dialog.setMessage().setTitle() .setPositiveButton().setNegativeButton() .show();?
The builder pattern
97
Which of the following functions is required for implementing the ListAdapter interface
getCount
98
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)?
Select distinct Price,Quantity from PURCHASES where Quantity > 10
99
When you write a ListView adapter class, which function gets called first when populating the ListView:
getCount
100
Which of the following functions causes a ListView to start the re-population of the list:
notifyDataSetChanged
101
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:
Brandname = Nike and CUSTOMER_NAME NOT NULL
102
What is the ViewHolder pattern?
When ListView cells that are scrolled off screen get re-used for new cells coming into view on the screen
103
What function for getting a database object must you call if you want to insert values?
getWriteableDatabase
104
In which version of Android was the Toolbar introduced?
5.0
105
What was the previous object that represented a navigation bar?
ActionBar
106
Where is a Toolbar placed in the Activity?
It depends on the Layout
107
What resource object is used to specify the layout of the Toolbar?
Menu
108
What resource object specifies what will be in the menu?
Item
109
What controls the order of the items in a menu?
The orderInCategory parameter
110
In which function should you inflate the menu?
onCreateOptionsMenu
111
Which function gets called in response to the user picking an item from the menu?
onOptionsItemSelected
112
What is the design pattern that is used for creating DialogBoxes?
Builder pattern
113
What function do you call to set the view of a Dialog box?
setView
114
In an AsyncTask, which function runs on a background thread?
doInBackground
115
In an AsyncTask, which function runs on the main GUI thread?
onProgressUpdate
116
In an XMLPullParser, which is the first event type that happens?
START_DOCUMENT
117
In an XMLPullParser, which event type corresponds to this tag: ?
END_TAG
118
In an XMLPullParser, which event type corresponds to "Hi" in this example: Hi ?
TEXT
119
Which function in Android returns the directory for opening files?
getFilesDir
120
Which permissions do you need to write to an External Folder?
WRITE_EXTERNAL_STORAGE
121
If a tablet has a screen size of 800x600 pixels, which folder name should you use to create a layout for this tablet?
layout-sw600dp
122
Which function should you use to inflate the view of a Fragment?
onAttach
123
What object is used to create a FragmentTransaction?
FragmentManager
124
What XML tag should you put in an XML layout to show where a Fragment should go?
framelayout