Sie sind auf Seite 1von 9

EXAM II

Mobile and Pervasive Computing


CNT5517 - Section 2D32 & CIS4930 - Section 2D78
Fall 2014
Professor Sumi Helal
December 9, 2014
3:05-4:45 PM, CSE E222.
You must bring your laptop or tablet with you to the classroom.
Download the word file of this Exam and edit it to include your answers.
Submit your answers through the Sakai e-Learning system.
You have 100 minutes to finish this exam, which must be submitted through Sakai.
Submissions will not be accepted and will automatically close at 4:50pm.
This is an open book, notes, web Exam. However, it is not a collaborative activity. You are not
allowed to communicate with anyone via email, chat or any other digital or physical means.
Any report of misconduct will be handled firmly according to the University of Florida Student
Conduct and Honor code.
Question 1 (30 pts)
State True or False.
[True] Each Android app runs as its own Kernel managed process.
[False] All Android apps run under a single Dalvik VM.
[True] Android developers can use both application frameworks and system libraries to develop
their applications.
[True] Android content providers are wrappers of data that enables them to be portable and
sharable across different applications.
[False] startService() starts a service internal to an Android app, whereas bindService() may
start a service in another app.
[False] Only the Android system can use the notification bar. Apps cannot.
[True] Intents are the only message passing mechanism through which services, activities and
broadcast receivers can communicate.
[False] An Android activity is mainly concerned with background processing tasks.
[True] Android developers can create their own custom-made input keyboards
[False] Each activity has an XML layout associated with it.

Question 2 (20 pts)


(a) What role does the Androids resource manager framework play?

Allows programmers to decouple static resources and device specifics from the
application code

Leads to better app design and effective customization of the app to different devices

Each resource package is accessed by addressing it using its package name, resource
type, and resource name
o <package_name>.R.<resource_type>.<resource_name>

Android resource manager performs the following tasks effectively:


Providing Resources
Providing resources in the app, saving and accessing them, creating alternative resources for
specific device configurations.
Accessing Resources
Accessing resources that have been provided, either by referencing them from the
application code or from other XML resources.
Handling Runtime Changes
Manage configuration changes that occur while an Activity is running.
Localization
Localizing the application using alternative resources. While this is just one specific use of
alternative resources, it is very important in order to reach more users.
(b) What are Android Wake Locks? What are they used for? And what is the risk of
using them?
To avoid draining the battery, an Android device that is left idle quickly falls asleep.
However, there are times when an application needs to wake up the screen or the CPU and
keep it awake to complete some work.
A wake lock is a mechanism to indicate that your application needs to have the device stay
on.
The risk of using a wake lock is that it drains out the battery if turned on. Hence, as a rule of
thumb, we use it only when it is absolutely necessary and also disable it as soon as possible.

(c) What are the key differences between Android Views, View Groups and Tile
Views.
The user interface for each component of your app is defined using a hierarchy
of View and ViewGroup objects, as shown in the figure below. Each view group is an invisible
container that organizes child views, while the child views may be input controls or other
widgets that draw some part of the UI. This hierarchy tree can be as simple or complex as you
need it to be (but simplicity is best for performance).

This class represents the basic building block for user interface components. A View
occupies a rectangular area on the screen and is responsible for drawing and event handling.
View is the base class for widgets, which are used to create interactive UI components (buttons,
text fields, etc.). The View Group subclass is the base class for layouts, which are invisible
containers that hold other Views (or other ViewGroups) and define their layout properties.
The TileView is a subclass of ViewGroup that provides a mechanism to asynchronously
display tile-based images, with additional functionality for 2D dragging, flinging, pinch or
double-tap to zoom, adding overlaying Views (markers), built-in Hot Spot support, dynamic
path drawing, multiple levels of detail, and support for any relative positioning or coordinate
system. The viewgroup is hence the parent and the tileview and views are children of the
viewgroup.
(Assumption: TileView is the view that is being described in
https://github.com/moagrius/TileView)

(d) Why did Android support implicit intents? What unique capabilities can be
achieved using implicit intents?
Implicit intents, unlike explicit do not name a specific component, but instead declare a
general action to perform, which allows a component from another app to handle it. This can be
particularly useful if our app is not capable of performing certain functions that other apps can
perform like displaying a location on a map of capturing an image, etc. Using implicit intents,
we can invoke the activity that is able to perform the function that we need to be completed.
The android system give the user a choice of applications from which the user picks a single
application that can perform the desired function.
The main advantage of using implicit intent is that as a developer, we need not specify all
the details of the task to be performed but a general description of the task to be performed that
allow the android system to decide as to which application is capable of performing that task.
To inform the system which implicit intents they can handle, activities, services, and
broadcast receivers can have one or more intent filters. Each filter describes a capability of the
component, a set of intents that the component is willing to receive. It, in effect, filters in intents
of a desired type, while filtering out unwanted intents but only unwanted implicit intents
(those that don 't name a target class ) .

Question 3 (20 pts)


The

current

mobile

application

model

followed

in

todays

platforms

is

Download/Install/Use/De-Install model (DIUD). In addition to productivity and cool apps,


many organizations are offering their apps as well (e.g., many newspapers, many
magazines, almost all airlines, almost all banks, online shopping stores, and much more).
If this model continues, we will end up with a morass of apps on our mobile platforms.
Managing (organizing, viewing and accessing) the apps will soon become very difficult
(even with the use of directories, which are inadequate because some apps can be
organized according to multiple hierarchical views). Even remembering and recalling that
a particular app is available in ones mobile platform could soon be difficult, if not being
the case already.
What alternative app model would you propose that could be radically superior to DIUD.
Explain your app model clearly and chart out a comparison between your model and
DIUD on key issues of manageability and usability.

Assumption: Most apps need to be connected to the internet to display information to the
user or store user data.
I belive that an app model in which the user doesnt have to install the application but can rather
access it using a url should be the main focus of the future. The apps can be built in a modern
development framework like node.js. This way the developer needs to develop a common
application that can run on any platform, the user doesnt have to download the application in
order to use it.
S.No. DIUD

My Model

1. Installation required

Installation not required, user uses the


browser to navigate to the app that he needs
to use.

2. Since the app is stored locally, device Since the app is loaded dynamically, the
needs adequate storage space.

device need better connectivity and RAM to


perform better

3. A native application has access to Currently, there is no guarantee that the


device

specific

hardware

and webapp has access to all the device specific

permissions.

hardware and permissions. But if a proper


framework is developed, this issue can be
addressed.

4. App needs to be developed for all the Single app can work on all the platforms
platforms
5. App can run in the background and App can be stops from running in the
eat up battery life

background if the user wishes to disable it.

Question 4 (20 pts)


Cloud-mobile systems have recently emerged as a popular architecture for developing mobile
applications that need to rely on highly-available and always-adequate (elastic) resources and
services. In this architecture (let us call it Architecture I), massive interactions are initiated by
the mobile apps. Push notification frameworks and services in the cloud allow for limited
interactions to be initiated by the cloud.
Cloud-mobile systems are also an emerging architecture (Architecture II) for developing
cloud applications that need to legitimately access and query mobile devices for data or to
recruit the device owners (e.g., in crowd sourcing or crowd sensing).
(a) Which architecture (I or II) poses more challenges to mobile devices? What are these
challenges?
The second architecture presents more challenges. While it is a good idea to get data from the
device owners, the devices need not be connected to the cloud continuously. Hence, there is an
inherent challenge in getting data from devices that are not connected. Also, even if they are
connected, the device owner may choose to not share the data with the server. In this case, there
is a wastage of computing power that is being used to contact the devices. The architecture
needs requires frequent transmissions between cloud platform and mobile devices, due to the
stochastic nature of wireless networks, the transmission protocol should be carefully
designed. Context-aware and socially-aware computing are inseparable traits of contemporary
handheld computers. To achieve the vision of mobile computing among heterogeneous
converged networks and computing devices, designing resource-efcient environment-aware
applications is an essential need. Trust is an essential factor for the success of the burgeoning
cloud mobile systems paradigm.

(b) Address one of the challenges you identified in (a) and sketch a proposal of a solution
to overcome it. If you have to make any assumptions, write your assumptions down
clearly.
Using a hybrid architecture for cloud mobile system where the client cloud transactions can be
reduced by performing most of the computations in the cloud and then sending the final
information to the client whenever it contacts the cloud for the necessary information. Cloud

can also send data to the clients using push notifications that are delivered as and when the
client connects to the cloud.
We can also improve the connectivity of the clients with the cloud by using better technologies
like WIMAX. Google is also launching balloons that beam data directly to the clients. Such
improvements in technologies would mean that the client is better connected to the cloud, thus
leading to more accurate transactions.

Question 5 (10 pts)


In no more than 90 words, summarize the three most important take home lessons you learnt
from Dr. Lisa Anthonys lecture.

The most important point to note is that if a User makes a mistake while using your application,
then its a problem with the UI, not with the user. Hence, app developers need to design apps in
such a way that the workflow of the application is not counter intuitive to the users perception.
(Designs should be user centered)

While developing apps for mobile devices, the biggest challenge that the developer faces is that
he has a limited room to include all the information to engage the user. Placing appropriate UI
elements at locations that are intuitive to the user will provide a seamless experience for the
user. He can use techniques like changing the size of a particular UI element to highlight its
importance, change the fonts, colours.

Das könnte Ihnen auch gefallen