You are on page 1of 5

What is the purpose of using fragments in Android?

How do they differ from


activities, and when would you choose to use one over the other?

Enlist and explain different type of permissions in Android.

Design the following screen. Write complete XML code.

A customer want to create custom application. In which when user click on the
Login button the function will take the data from email and password field and
compare them with the data stored in database, if match is found it will open web
page (www.w3schools.com) in browser using implicit intent and if match is not
found it will show a Toast saying, “Login Failed”. Write JAVA code for above
scenario.

Draw and explain fragment life cycle in detail

Explain the steps for requesting run time permissions with the help of diagram.

Suppose that there are two activities in an application named Activity One and
Activity Two. You want to invoke Activity Two from Activity One. What intent
type can you use in this scenario also explain types of intent in detail ?
Design the following screen using fragments. Write complete XML code.

A company Manager want to create custom application. In which when user click
on the Register button the function will take the data from username, email,
password field and store them in database, after that the register fragment is
replaced with login fragment. Write JAVA code for above scenario.

In fragment life cycle diagram explain On Create View( ), On Destroy View( ), On


Resume View( ), and On Detach View( ) in detail.

Write code for android camera API and create intent to access this, intent can be
created by using default camera application or using android camera API. This
application will capture an image and will save it to the image directory into the
android device, once on image has been captured this application will preview this
image on screen. Write only JAVA code for this scenario

Suppose that there are two activities in an application named Activity One and
Activity Two. You want to invoke Activity Two from Activity One. What intent
type can you use in this scenario also explain types of intent in detail?

Design the following screen. Write complete XML code.

A School principal want to create custom application. In which when user click on
the ADD button the function will take the data from fields and store them in
database, and when click on VIEWALL a toast will show all the student data in a
toast. Write JAVA code for above scenario.
Q1: Answer the following Short Questions.
(2x5=10)
a) Differentiate between Implicit and explicit intents.
b) Enlist steps taken when returning data from activity.
c) Write XML code to declare camera permission.
d) Write the basic principles for requesting permissions at runtime.
e) Define fragments.
Enlist and explain different type of permissions in Android.

Design the following screen. Write complete XML code.


A customer want to create custom application.in which database will store patient
information when user click on ADD button all the data is stored in database and
when the user click view button the data is sent to Activity2 using Intents and
shown there in Textview. Write JAVA code for above scenario.

You might also like