Lab6 Self Assessment

Lab6 Self Assessment

Questions

1) Persistent data in Android can be stored in:

When taking the question, it would appear as:

Persistent data in Android can be stored in:

Question options:

When grading the question, it would appear as:

Persistent data in Android can be stored in:

SharedPreferences (internal memory)

Files (internal memory/external SD card)

Database (internal memory/external SD card)

Correct Answer

All of the above

Comment: (given as feedback)

Hint:

2) What is true about Fragment in Android?

When taking the question, it would appear as:

What is true about Fragment in Android?

Question options:

When grading the question, it would appear as:

What is true about Fragment in Android?

Correct Answer

A Fragment cannot live on their own--they must be hosted by an activity or another fragment

A Fragment does not have its own life cycle

A Fragment cannot define and manage its own layout like Activity

A Fragment cannot handle any input events

Comment: (given as feedback)

Hint:

3) Complete the code: (answers are case-sensitive) Share

When taking the question, it would appear as:

Question options:

Complete the code: (answers are case-sensitive)


SharedPreferences pref = ___________________("pfile",0);

SharedPreferences.Editor e = pref.edit();

e.______________("val1",3.15);

e.putBoolean("val2", true);

e.commit();

boolean b = pref.getBoolean("val2", false);

When grading the question, it would appear as:

Complete the code: (answers are case-sensitive)


SharedPreferences pref = ___________________("pfile",0);

SharedPreferences.Editor e = pref.edit();

e.______________("val1",3.15);

e.putBoolean("val2", true);

e.commit();

boolean b = pref.getBoolean("val2", false);

Comment: (given as feedback)

Hint:

4) Complete the code: (answers are case-sensitive) Share

When taking the question, it would appear as:

Question options:

Complete the code: (answers are case-sensitive)


SharedPreferences pref = getSharedPreferences("pfile",0);

SharedPreferences.Editor e = _________________;

e.putBoolean("val2", true);

e._______________;

boolean b = pref.getBoolean("val2", false);

When grading the question, it would appear as:

Complete the code: (answers are case-sensitive)


SharedPreferences pref = getSharedPreferences("pfile",0);

SharedPreferences.Editor e = _________________;

e.putBoolean("val2", true);

e._______________;

boolean b = pref.getBoolean("val2", false);

Comment: (given as feedback)

Hint:

5) Which object stores the data only in key-value pair?

When taking the question, it would appear as:

Which object stores the data only in key-value pair?

Question options:

When grading the question, it would appear as:

Which object stores the data only in key-value pair?

SQLite Database

Access Database

Correct Answer

SharedPreferences

ContentProvider

Comment: (given as feedback)

Hint:

6) You want to store website name by using SharedPreferences. Choose the correct option for doing this, given that the website name is CareerRide.com

When taking the question, it would appear as:

You want to store website name by using SharedPreferences. Choose the correct option for doing this, given that the website name is CareerRide.com

Question options:

When grading the question, it would appear as:

You want to store website name by using SharedPreferences. Choose the correct option for doing this, given that the website name is CareerRide.com

SharedPreferences obj = new SharedPreferences ("MySharedFile", Context.MODE_PRIVATE);

String n=obj.getString("name", "CareerRide.com");

obj.commit();

SharedPreferences obj = getSharedPreferences("MySharedFile", Context.MODE_PRIVATE);

Editor editor=obj.edit();

editor.putInt("name", "CareerRide.com");

editor.commit();

SharedPreferences obj = getSharedPreferences("MySharedFile", Context.MODE_PRIVATE);

obj.putString("name", "CareerRide.com");

obj.commit();

Correct Answer

SharedPreferences obj = getSharedPreferences("MySharedFile", Context.MODE_PRIVATE);

Editor editor=obj.edit();

editor.putString("name", "CareerRide.com");

editor.commit();

Comment: (given as feedback)

Hint:

7) A __________ is a piece of an activity which enable more modular activity design.

When taking the question, it would appear as:

A __________ is a piece of an activity which enable more modular activity design.

Question options:

When grading the question, it would appear as:

A __________ is a piece of an activity which enable more modular activity design.

Intent

Context

Correct Answer

Fragment

Filter

Comment: (given as feedback)

Hint:

8) What is true about Fragment? 

When taking the question, it would appear as:

What is true about Fragment? 

Question options:

When grading the question, it would appear as:

What is true about Fragment? 

You can add or remove fragments in an activity while the activity is running.

A fragment has its own layout and its own behaviour with its own life cycle callbacks

You can combine multiple fragments in a single activity to build a multi-pane UI

Correct Answer

All of the above

Comment: (given as feedback)

Hint:

9) Fragments are independent from Activities. 

When taking the question, it would appear as:

Fragments are independent from Activities. 

Question options:

When grading the question, it would appear as:

Fragments are independent from Activities. 

True
Correct Answer
False

Comment: (given as feedback)

Hint:

Comments

Popular posts from this blog

Simple Login Example (PHP Server + Android Client)

Lab 6: Using split