GoConqr has a new look! Let us know what you think.

Quiz

Mobile midterm

Duncan Levings 39 questions

Take the quiz

This quiz has question types that open in the usual player.

Questions in this quiz (39)

  1. 1To create a click event for a button, there are 2 ways:
    Using onClick============
    XML:
    android:onClick="name"
    code:
    public void name (View view) {
    //code
    }

    using click listener===========
    Button btn = findViewById(R.id.name);
    btn.setOnClickListener(new View.OnClickListener() {
    @override
    public void onClick (View v) {
    //code
    }
    });
    1. ATrue
    2. BFalse
  2. 2Which of these layouts are most commonly used in our projects:
    1. AConstraintLayout
    2. BLinerLayout
    3. CFrameLayout
    4. DRelativeLayout
  3. 3Toasts:

    Toast.makeText(this, "hello", Toast.LENGTH_LONG).show();
    1. ATrue
    2. BFalse
  4. 4OnClick in XML
    Advantages:
    Easy to implement
    Disadvantages:
    Only available in OnClick event
    callback method must be in parent activity
    1. ATrue
    2. BFalse
  5. 5Inner class listener
    Advantages:
    Can use all events
    Disadvantages:
    harder to implement
    1. ATrue
    2. BFalse
  6. 6Widgets are design time created, when inflated it becomes a view
    1. ATrue
    2. BFalse
  7. 7Button hierarchy:
    Textview
    ^
    Button
    ^
    CompoundButton
    ^
    CheckBox, RadioButton, Switch, ToggleButton
    1. ATrue
    2. BFalse
  8. 8RadioButtons require a parent RadioGroup, which is a subclass of LinerLayout
    1. ATrue
    2. BFalse
  9. 9Spinners are a drop down selection of items that can be selected.
    Usually uses a string-array in string.xml to populate it.
    Can set the array in xml or by using an ArrayAdapter.
    Selected values can be get using getSelectedItemPosition or getSelectedItem.
    1. ATrue
    2. BFalse
  10. 10this vs MainActivity.this
    When the method call is directly within the Activity, use this
    When the method call is within an inner class, use MainActivity.this
    1. ATrue
    2. BFalse

Information

Description
Computer Science Quiz on Mobile midterm, created by Duncan Levings on 17/10/2018.
Language
English
Views
6
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?