2015-mobile-scheme
2015-mobile-scheme
SLIATE
SRI LANKA INSTITUTE OF ADVANCED TECHNOLOGICAL EDUCATION
(Established in the Ministry of Higher Education, vide in Act No. 29 of 1995)
Question 01
[Total Marks=20]
i. Mention three android versions with their code names (3 Marks)
ii. Identify the following widgets (4 Marks)
a. c.
b. d.
<Button
android:id="@+id/btnButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 1"/>
<Button
android:id="@+id/btnButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 2"
android:layout_toRightOf="@+id/btnButton1"/>
<Button
android:id="@+id/btnButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button 3"
android:layout_below="@+id/btnButton1"/>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/btnButton3"
android:layout_marginTop="94dp"
android:text="User :"
android:textAppearance="?android:attr/textAppearanceLarge" />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/textView1"
android:layout_toRightOf="@+id/btnButton3" />
<Button
android:id="@+id/btnSubmit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/editText1"
android:text="Submit" />
</RelativeLayout>
Question 02
[Total Marks=20]
i. Define what is an Android Activity. (2 marks)
ii. The following user interface has been created with Android Studio. When the user
clicks on the submit button after entering the correct username and the password
program redirects to home page which is another activity called CompanyHome. In
the case of incorrect username or password, toast message will be displayed as
“Username or password invalid”.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
@Override
public void onClick(View v) {
//redirects toCompanyHome
………………………………. in1=new Intent(getApplicationContext(),……………………………………………);
startActivity(…………………………………); (2 marks)
}else {
iii. Explain the purpose of setOnClickListener() method mentioned in the above code?
(3 marks)
ii. What is the purpose of strings.xml file in an Android Project? (03 Marks)
iv. What is the purpose of match_parent and wrap_content in following code . (04 marks)
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
v. Following table shows hardware configurations for two mobile devices. From the following
two devices, which device will you select to purchase? Briefly explain why you have selected
that device. (06 marks)
Device A Device B
NETWORK Technology GSM / HSPA / LTE GSM / HSPA
3G Network HSDPA 850 / 900 / 1900 / 2100 HSDPA 900 / 2100
4G Network LTE band 1(2100), 2(1900), 3(1800),
4(1700/2100), 5(850), 7(2600), 8(900),
17(700), 20(800)
Speed HSPA, LTE HSPA
LAUNCH Announced 2015, July 2015, March
BODY Dimensions 198.6 x 134.8 x 5.6 mm (7.82 x 5.31 x 0.22 191.8 x 107 x 8.5 mm (7.55 x 4.21
in) x 0.33 in)
Weight 265 g (Wi-Fi) / 272 g (LTE) (9.59 oz) 278 (9.81 oz)
SIM Nano-SIM Micro-SIM
DISPLAY Type Super AMOLED capacitive touchscreen, IPS LCD capacitive touchscreen,
16M colors 16M colors
Size 8.0 inches (~74.0% screen-to-body ratio) 7.0 inches (~67.2% screen-to-
body ratio)
Resolution 1536 x 2048 pixels (~320 ppi pixel density) 600 x 1024 pixels (~170 ppi pixel
density)
PLATFORM OS Android OS, v5.0.2 (Lollipop) Android OS, v4.4.2 (KitKat)
MEMORY Card slot microSD, up to 128 GB microSD, up to 32 GB
Internal 32/64 GB, 3 GB RAM 8 GB, 1 GB RAM
CAMERA Primary 8 MP, autofocus 2 MP
FEATURES Sensors Fingerprint, accelerometer, gyro, proximity, Accelerometer
compass
Question 05
[Total Marks=20]
i. Android has number of APIs. Which API is used when you want to save data using
key-value pairs (04 marks)
iii. Which methods are calling to retrieve Integer and String values from a shared
preferences file (02 marks)
iv. Following program is written to save Student record using key value pairs. Fill in the
blanks in following program segment. (10 marks)
ii. Write the necessary import statement to use SQLite in an Android application?
(03 marks)
iii. Give the purpose of the following statement. (04 marks)
db=openOrCreateDatabase("StudentDB", Context.MODE_PRIVATE, null);
iv. Explain the first and second arguments of the method openOrCreateDatabase(… , … , …)
(02 marks)
After execution of above code fragment, what will be the value of the variable P? (Assume
all necessary declarations and initializations were done correctly)
-------End of Paper-------