final Flashcards
SQL: databaseOpenHelper:
OnUpgrade()
«_space;if version is newer version is higher than old version. drop table statement, onCreate()
Greedy
finds the best language:
1) Values-EN-Rca
Match parent
size of parent
LifeCycle functions:
OnCreate(Bundle b) OnStart OnResume OnPause OnClose OnDestroy
Sharedpreference:
putstring, getstring if they don’t match you get default value not 0. are also used for saving files and such
Types of Log
Log.i Log.w Log.e Log.d Log.v
ListAdapter functions:
getCount(), getItem(), getItemId(), getView(), setOnItemClick(), setAdapter(), notifyItemsChanged()
SQL: databaseOpenHelper:
OnCreate()
«_space;SQL Creation statement
Log.i
informational messages
Android is
android is linux,
APK
zip file that has xml, java, png, jpg
Root tag
first tag being declared (not xml version tag), android.support.constraintlayout…
Android uses
android uses java and xml
FindViewById
returns null if not found in the layout.
Log.d
debug messages
SQL: databaseOpenHelper:
OnOpen()
«_space;all cases calls this
Toolbar items have what
Items have an Id, orderInCategory, icon, showAsAction
Log.w
warning messages
Parameter
id, layout_width etc.
XML is
case sensitive, well formed, must have closing tags.
toolbar showAsAction
showAsAction can be: always(always be icon), never(be text) or if room(text)
Log.v
verbose messages
Logging levels:
info, error, debug, verbose
What does Bundle return?
Bundle returns 0 or null
Toolbar OrderInCategory
to left has a small order category, to the right has large order category
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)
Onclick events what happens for phone
either start a new activity (phone)
SQL: databaseOpenHelper:
OnDowngrade()
Wrap content
minimum size needed to show content
Name space part in XML:
android, app, tools
String XML format and how to reference it?
Value
to reference it – android:text=”@string/Key”
which gives - getResources().getString(R.string.Key);
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
Fragments for tablet:
Has framLayout in XML
FindViewById() - returns not null
Both layouts are seen on one screen
LinearLayout – default orientation
horizontal
Log.e
error messages
if SharedPreferences cannot find a name
SharedPreferences has default answers if the name is not found
Onclick events what happens for tablet
you start a fragment transaction (tablet)
FragmentManager beginTransaction
.Add (frameLayout, Fragment) , .remove (Fragment), .replace (frameLayout, Fragment)
.commit();
Content values:
Put(Name, Value);
For all columns
one put statement for every column. Doesn’t get called unless you call insert()
SharedPreferences only gets called with what?
shared Preferences only gets called with commit();
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).
RelativeLayout – default orientation/position -
top left
What must you use for start activity
onActivityForResult(int requestCode) to start activity.
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
Where does the result come from for startActivity?
the result is from setResult(resultCode, intent).
Which was the first smartphone available that ran Android?
HTC Dream
Is the following XML code legal syntax: “item 1 “
Yes
Which folder would contain the resource: “R.drawable.a_picture”
res/drawable