Professional Documents
Culture Documents
Sample Paper 5 (Mobile App)
Sample Paper 5 (Mobile App)
SAMPLE PAPER
Institute of Systems Science
National University of Singapore
GRADUATE DIPLOMA IN
SYSTEMS ANALYSIS
SA Term 2 Examination
Sample Paper: Mobile Application Development
Matriculation Number :
(fill in your matriculation number here)
2. Write your matriculation number on the top of this front page in the box provided.
3. Complete the front cover of each answer book you use. The blank lines on the front cover
to be filled in as follows:
5. This examination paper consists of three (3) sections with one (1) question in Section A,
one (1) question in Section B and one (1) question in Section C. There are a total of three
(3) questions. You are to answer ALL questions. There are no appendixes for this paper.
6. The total marks for this examination paper is seventy-five (75) marks. Twenty-five (25)
marks will be taken from the continuous assessment.
9. After completing the paper, tie your answer books together according to sections. List the
questions that you have answered for each section on the front page of the first answer
book for that section.
10. The question paper is to be submitted together with the answer books. You are not
allowed to take the question paper with you.
11. Scrap paper may be used as required, but only answers written in the answer book will be
considered for credits.
12. Use a pen for writing your answers. Pencil may be used only for drawing diagrams.
14. State clearly any assumptions you make in answering any question where you feel the
requirement is not sufficiently clear.
Section A
This section would be on Python programming.
Since it is a new topic, there is no sample question.
You have been task to prototype an Android native app which allows users to search the online
book store for titles and corresponding reviews.
I) The app will allow the user to key in a search string in the MainActivity.
II) Submitting the search will display a list of results in the ListBooks Activity:
III) Selecting a search result row will show a review for the corresponding book in the Review
Activity.
A WCF service hosted on ASP.NET for accessing the book database has been implemented at
http://192.168.56.101/books/ with IService.cs interface as follows:
IService.cs
using System;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
[ServiceContract]
public interface IService {
[OperationContract]
[WebGet(UriTemplate="/Search/{target}",ResponseFormat=WebMessageFormat.Json)]
Book[] SearchBooks(string target);
[DataContract]
public class Book {
string title;
string author;
string review;
float price;
[DataMember]
public string Title
{
get { return title; }
set { title = value; }
}
[DataMember]
public string Author
{
get { return author; }
set { author = value; }
}
[DataMember]
public string Review
{
get { return review; }
set { review = value; }
}
[DataMember]
public float Price
{
get { return price; }
set { price = value; }
}
}
In addition, the Java classes Book has also been implemented as follows:
Book.java
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import org.json.JSONArray;
import org.json.JSONObject;
import android.util.Log;
res/layout/activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="@string/booksearch"
android:textAppearance="?android:attr/textAppearanceLarge" />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/textView1"
android:layout_marginTop="16dp"
android:ems="10"
android:hint="@string/searchhint" >
<requestFocus />
</EditText>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/editText1"
android:layout_below="@+id/editText1"
android:layout_marginTop="24dp"
android:text="@string/searchbutton" />
</RelativeLayout>
i. performs the book search (with the search string obtained from the first Activity) (4
marks)
ii. displays the search results in a ListView (4 marks)
iii. implement an appropriate event-handler for the ListView (4 marks)
c) With the supplied review.xml, implement the onCreate() method of the third Review
Activity which
• res/layout/review.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
d) List the Android permissions which should be included in the Manifest file. (2 marks)