You are on page 1of 9

Name Sufyan Ramzan

Roll No F17-038-BCMS
Class BSCS – 8(B)
Subject MAD
Assignment Class Task (Mids)
Received By Irfan Khalid

SUPERIOR UNIVERSITY, LAHORE.


Question No 1 (A):
What is android activity with example?
An activity represents a single screen with a user interface just
like window or frame of JAVA.
The ANDROID activity is the subclass of Context Theme
Wrapper class. The Activity class defines the following call
backs i.e., Events. There is no need to implement all the
callbacks methods.
There are four states of an Activity (App) in Android namely,
Active, Paused, Stopped and Destroyed. From the user's
perspective, the activity is visible, partially visible or invisible
at a given point of time.

Question No 1 (B):
Write down some specific advantages and disadvantages of
both Android and IOS?

ANDROID
Advantages:

 Millions of apps: Users have a vast choice to choose which apps


they need. Apps are categorized into topics and every topic has
large amount of apps to download.
 Sharing of internet among devices: With a mobile hotspot, you
can share your device internet with other devices or with PC. This
can help saving money also. If you living in a house then you can
share your internet with your family members and they don’t need
to buy separate internet packages.

Disadvantages:
 Apps run in the background: In the older version of Android,
most apps always run in the background and come to foreground
as they wish. But in new version of android apps cannot
automatically come to foreground. As some apps run in the
background then it consumes mobile battery and your device
battery vanishes quickly.
 Developers have a tough time: Learning and developing android
apps is hard because there are a variety of screen sizes and to make
app adaptive to all screen sizes is challenging for the developers.
Developers have to write more code and are difficult to
troubleshoot the app for final delivery. It is also difficult to make
complex apps and doing advanced animation is hard.

IOS
Advantages:
 Excellent UI and fluid responsive
 Developers can design apps because less number of models
 Metal and shiny coating are ultimate for Apple devices
 Jail breaking for customization

Disadvantages:

 It has a review process, when developers want to publish an app


they need to send it to Apple for review that takes around 7 days
and it takes even more in some cases.
 Applications are very large when compared to other mobile
platforms
 Using iOS are costly Apps and no widget support
 Battery performance is very poor on 3G

Question No 2 (A):
What is intent? Briefly explain the how to create
intent in more than one activities?
INTENT
Intent is an abstract description of an operation to be performed.
It can be used with start Activity to launch
an Activity, broadcast Intent to send it to any
interested Broadcast Receiver components, and Context. Start
Service (Intent) or Context. Bind Service (Intent, Service
Connection) to communicate with a background Service.
Intent provides a facility for performing late runtime binding
between the codes in different applications. Its most significant
use is in the launching of activities, where it can be thought of as
the glue between activities. It is basically a passive data
structure holding an abstract description of an action to be
performed.
Intent is a messaging object you can use to request an action
from another app component. Although intents facilitate
communication between components in several ways, there are
three fundamental use cases:
 Starting an activity
 Starting a service
 Delivering a broadcast

Question No 2 (B):
How many file are required for one activity in android?
Briefly explain.

It should be define one as default by CATEGORY_DEFAULT.


Without default main activity if you have two activities, Android
Market do not know what activity to start.
<activity
android:name=".FirstMainActivity"
android:label="First Activity"
android:icon="@drawable/first_icon">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
Question No 2 (C):
Write down difference between onCreate() and onStart().

onCreate()
onCreate() is called when the activity is first created.
onStart()
onStart() is called when the activity is becoming visible to the
user.

Question No 3 (A):
Briefly explain the any four name of database that using in
android application?

Name Android / iOS Type of data stored

ObjectBox DB Object Database, NoSQL,


Android / iOS Edge DB for Mobile and IoT

Oracle Berkeley DB Android / iOS Relational and Key-Value-Store

Snappy DB Android Key-value pairs / NoSQL db

SQLite embedded on Android & iOS Relational


Question No 3 (B):
Briefly explain the life cycle of Android Activity?
To navigate transitions between stages of the activity lifecycle,
the Activity class provides a core set of six callbacks:
onCreate() , onStart() , onResume() , onPause() , onStop() , and
onDestroy() . The system invokes each of these callbacks as
an activity enters a new state.
Question No 4:

What is SQLite Open Helper? And explain the Architecture


of SQLite?

SQLite Open Helper

SQLiteOpenHelper(Context, String,
SQLiteDatabase+ICursorFactory, Int32, IDatabaseErrorHandler)
Create a helper object to create, open, and/or manage a
database. SQLiteOpenHelper(IntPtr, JniHandleOwnership) A
constructor used when creating managed representations of JNI
objects; called by the runtime.

Architecture Of SQLite:

SQLite works by compiling SQL text into byte code, then


running that byte code using a virtual machine. The
sqlite3_prepare_v2() and related interfaces act as a compiler for
converting SQL text into byte code. The sqlite3_stmt object is a
container for a single byte code program that implements a
single SQL statement.
Question No 5:

Write down code of mathematically operations in JAVA


with comments and how to add logo According to given case
mention below.

You might also like