Cit 3211 Computer Application Programming Question Paper-1
Cit 3211 Computer Application Programming Question Paper-1
a) Android was developed by Google and later the OHA (Open Handset Alliance),
define android and explain what is Open Handset Alliance
Page 1 of 4
5.0- Lollipop
4.4- KitKat
d) Explain the importance of android emulator?
Allows the developer to run, debug and test android application without
requiring the physical device i.e. phone.
e) Explain the different types of layouts in android.
f) Describe the different screen orientations in android, a section of xml code for the
different orientation (4 Marks)
g) What is the use Android SDK?
It provides tools and APIs necessary for developing mobile applications on
the android platform using java programming language.
h) Differentiate how the following UI widgets are used in android.
i. Rating Bar - Rating Bar displays the rating bar.
ii. DatePicker - Datepicker displays the datepicker dialog that can be
used to pick the date.
iii. Time Picker - Time Picker displays the time picker dialog that can be
used to pick the time.
iv. ProgressBar - ProgressBar displays progress task.
i) Android applications can be used in different industries. Explain the applications
can be applied in four industries of your choice (4 Marks)
a) An activity is the single screen in android. It is like window or frame of Java. The
7-lifecycle method of Activity describes how activity will behave at different
states. Explain how the lifecycle of an android activity works?
onResume called when activity will start interacting with the user.
Page 2 of 4
onStop called when activity is no longer visible to the user.
ii. In java file, write a section of code to implement the list in (c)
above
public class MainActivity extends
AppCompatActivity {
ListView listView;
TextView textView;
String[] listItem;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
listView=(ListView)findViewById(R.id.listView);
textView=(TextView)findViewById(R.id.textView);
listItem = getResources().getStringArray(R.array.list);
final ArrayAdapter<String> languages = new
ArrayAdapter<String>(this,
R.layout.listview, listItem);
listView.setAdapter(List);
}
}
Page 3 of 4
Question 3: (15 Marks)
Page 4 of 4