Sie sind auf Seite 1von 7

Cse-535

Non-Programming
Assignment
-by
Deepak Kumar Sood
MT15013
Mtech-1st

1.How can I change the main screen/Launcher of


my application?
Answer: By changing the name of the activity one
wants
to
launch
in
the
android
manifest
(AndroidManifest.xml) file.

2.

State basic difference between activity and


a service.

Answer: Activity is a user interface page that appears


on screen and user can perform some actions on it. It
contains all the Layout and widgets like text boxes and
buttons. While a service is a process that runs in
background to perform OS works and other hardware
interactions. It does not have a user interface.
Ex. Opening music launches a playlist which is an
activity where you can select songs, but after closing
also song plays in background because it is a service.
3.Mention
File?

components

of

AndroidManifest

Answer: The 4 components of android manifest file are:


<manifest />: It must contain <application />. This
is the root element of AndroidManifest.xml file.
<application />: This element contains sub
elements that declare each of the applications
components and has attributes that can affect all
the components.
<activity />: This element is present in
<application />. Declares an activity that
implements part of the application's visual user
interface. All activities must be represented by

activity elements in the manifest file. Any that are


not declared there will not be seen by the system
and will never be run. It also contains the main
launcher activity that will launch when the app
runs.
<intent-filter />: Specifies the type of intents that
an activity, service, or broadcast receiver can
respond to.

4.

State functional difference between using


Explicit and Implicit Intent in Android?

Answer: Explicit intent specify the component to start


by name while an intent is passed. But implicit intent
do not name a specific component, but instead declare
a general action to perform, which allows a component
from another app to handle it.
Ex:
Explicit intent: Start a new activity or service when user
generates an intent (like click of a button).
Implicit intent: Generate an intent and another activity
from another app handles the intent if intent matches
its <intent-filter /> in manifest file.

5.

Why is it important to set permissions in


app development?

Answers: A basic Android application has no permissions


associated with it by default, meaning it cannot do
anything that would adversely impact the user
experience or any data on the device. To make use of
protected features of the device, we must include in your
AnroidManifest.xml one or more <uses-permissions> tags

declaring the permissions that the application needs. So


to access any users private data or any system resources
we must set permissions in app which must be accepted
by the user to install the app.
6.Mention major classes of broadcast receivers
that can be received?
Answer: There are two major classes of broadcasts that
can be received:

Normal
broadcasts (sent
with
Context.sendBroadcast) are completely asynchronous.
All receivers of the broadcast are run in an undefined
order, often at the same time. This is more efficient, but
means that receivers cannot use the result or abort APIs
included here.

Ordered
broadcasts (sent
with
Context.sendOrderedBroadcast) are delivered to one
receiver at a time. As each receiver executes in turn, it
can propagate a result to the next receiver, or it can
completely abort the broadcast so that it won't be
passed to other receivers. The order receivers run in
can be controlled with the android:priority attribute of
the matching intent-filter; receivers with the same
priority will be run in an arbitrary order.

7.

Which property attribute in android can be


used to define the order of broadcast
receivers?

Answer: android:priority attribute can be used to define


the order of the broadcast receivers.

8.

Mention
Sandboxing?

salient

features

of

android

Answer:
1. Android Sandbox isolates our app data and code
execution from other apps.
2. Used to improve security.
3. Prevent outside malwares, intruders, system
resources or other applications from interacting
with the protected app.
4. Isolates each application in its own virtual
machine (micro-virtualization).
5. Limits the environment in which a code can
execute.

9.

When is the onStop() method invoked?

Answer: onStop() method is invoked when activity is no


longer visible.
Activity first goes to onPause() state from where it goes
to onStop().
Example: When we switch from an activity to home.

10.

How can one pass data to sub-activities?

Answer: By adding it to the intent that is used to open


other activities.
It is done by using .putExtra attribute in the intent.
Ex:
newIntent.putExtra(<string_name>,<key_identifier>)
;

11.

Is it possible to run standard Java

bytecode on Android? Give reasons?


Answer: No, it is not possible to run java bytecode on
android. Because of following reasons:
Virtual Machine used android is different from
traditional JVM. It uses Davik virtual machine.
The class file (byte code) for android is optimized
more to make it mobile friendly, which is different
from traditional java bytecode.
Traditional bytecode does not have supporting files
like AndroidManifest.xml and other user interface
files.

12.

In reference to parcs paper: Mention one


example of ubiquitous computing you witness in your
daily life activities?

Answer: In parcs paper the ubiquitous computing


means the technology that disappears from our life as a
gadget or a source of information, we consume its
knowledge without thinking about it. A very good
example given in parcs paper is about billboards and
street sign which we see and absorb its content without
thinking about is. Today mobiles, pcs, televisions, light
switches, thermostats are moving ahead for a
ubiquitous computing environment.

13.

In reference to parcs paper, mention three


components that are required to build
technology for ubiquitous computing?

Answer: Tabs, Pads and Boards are the three


components that are required to build technology for
ubiquitous computing.

14.

In reference to parcs paper, State one


design
based
implementation
that
is
reasonable for mainframes and personal
computers but ubiquitous computing?

Answer: The computers hardware and software


configuration will not change substantially while
running, this design based implementation is
reasonable for mainframes and personal computers but
not ubiquitous computing.

Das könnte Ihnen auch gefallen