0% found this document useful (0 votes)
23 views21 pages

Mad W-22

The document outlines the examination guidelines and model answers for a Mobile Application Development course under the Maharashtra State Board of Technical Education. It includes instructions for examiners on assessing answers, details about Android concepts such as APK files, UI elements, intents, and permissions, as well as various features of the Android SDK. Additionally, it emphasizes the importance of understanding and correctly applying Android security models and permissions in application development.

Uploaded by

Technical AG
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views21 pages

Mad W-22

The document outlines the examination guidelines and model answers for a Mobile Application Development course under the Maharashtra State Board of Technical Education. It includes instructions for examiners on assessing answers, details about Android concepts such as APK files, UI elements, intents, and permissions, as well as various features of the Android SDK. Additionally, it emphasizes the importance of understanding and correctly applying Android security models and permissions in application development.

Uploaded by

Technical AG
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
WINTER – 2022 EXAMINATION c) State how the APK files are built? 2M
Subject Name Mobile Application Development Model Answer Subject Code: 22617
Ans  The javac compiler compiles the java source file into the class file. (For each
Important Instructions to examiners: XXXXX  The dx tool takes all the class files of your application and generates a single .dex file which step 1/2 M)
1) The answers should be examined by key words and not as word-to-word as given in the model answer is a platform specific tool.
scheme.  Then Android Assets Packaging Tool (aapt) handles the packaging process and finally
2) The model answer and the answer written by candidate may vary but the examiner may try to assess the creates an executable file with extension .apk.
understanding level of the candidate.  An APK file contains all of a program's code (such as .dex files), resources, assets,
3) The language errors such as grammatical, spelling errors should not be given more Importance (Not certificates, and manifest file.
applicable for subject English and Communication Skills.
4) While assessing figures, examiner may give credit for principal components indicated in the figure. The d) Enlist the elements of UI. 2M
figures drawn by candidate and model answer may vary. The examiner may give credit for any equivalent
figure drawn.
Ans Elements of UI. (1/2 mark
5) Credits may be given step wise for numerical problems. In some cases, the assumed constant values may
for each UI
vary and there may be some difference in the candidate’s answers and model answer.
6) In case of some questions credit may be given by judgement on part of examiner of relevant answer based  EditText element,
 any 4 UI
on candidate’s understanding. TextView
elements
7) For programming language papers, credit may be given to any other program based on equivalent concept.  ListView
expected)
8) As per the policy decision of Maharashtra State Government, teaching in English/Marathi and Bilingual  GridView
(English + Marathi) medium is introduced at first year of AICTE diploma Programme from academic year  ScrollView
2021-2022. Hence if the students in first year (first and second semesters) write answers in Marathi or  ImageView
bilingual language (English +Marathi), the Examiner shall consider the same and assess the answer based
 ToggleButton
on matching of concepts with model answer.
 CheckBox
Q. Sub Note: As Android programs contain many of the auto generated code statements from IDE, Marking  RadioButton
No. Q. while assessing such answers correct logical steps taken to obtain the required output can be Scheme
N. considered. OR
Answer Components of UI
 Menu Bar
1 Attempt any FIVE of the following: 10 M
 Toolbar
a) Define OHA and state goal of OHA. 2M  Navigation Bar
 Editor Tabs
Ans The OHA is the group that is in charge of the Android smartphones operating system. It was (Define : 1  Editor
created by Google. The Open Handset Alliance (OHA) is consortium of multiple companies M, Stating  Project Explorer
like Samsung, Sony, Intel and many more to provide services and deploy handsets using goal 1 M)  Status Bar
android platform.
 Tool Buttons
The Open Handset Alliance (OHA) is an association whose goal is to develop open standards e) State the uses of Intent in Android. 2M
for mobile devices, promote innovation in mobile phones and provide a better experience for
consumers at a lower cost. Ans An Intent is a messaging object you can use to request an action from another app component. (1 M for
Intents are used for facilitating communication between components like Activities, Services each use, 2
b) Define Android Virtual Devices (AVD). 2M uses
and Broadcast Receivers.
Ans An Android Virtual Device (AVD) is a configuration that defines the characteristics of an (Define : 2 expected)
Android phone, tablet, Wear OS, Android TV, or Automotive OS device that you want to M ,any valid f) Name any four methods to get location data in android. 2M
simulate in the Android Emulator. The AVD Manager is an interface you can launch from definition
Android Studio that helps you create and manage AVDs. should be
Ans •float distanceTo(Location dest) (1/2 M for
considered)
•float getAccuracy() each
•float getBearing() method,
Page No: 1 | 41 Page No: 2 | 41
for more study material visit www.diplomachakhazana.in
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
•double getAltitude() any 4 Android Software, a corresponding SDK also releases with it. In the updated or new version of feature, any
•double getLatitude() methods SDK, some more features are included which are not present in the previous version. Android 4 features
•float getSpeed() expected) SDK consists of some tools which are very essential for the development of Android expected)
•boolean hasAccuracy() Application. These tools provide a smooth flow of the development process from developing
•boolean hasAltitude() and debugging. Android SDK is compatible with all operating systems such as Windows,
•boolean hasBearing() Linux, macOS, etc.
•boolean hasBearing()
1. Android Tool: This tool helps in managing the Android Virtual Device projects as well as
•boolean hasSpeed()
the installed components of the software development kit.
•void reset()
•void setAccuracy(float accuracy) 2. Emulator Tool: It helps us in testing the applications without the need of using the
•void setAltitude(double altitude) application on an actual device.
g) Explain significance of content provider. 2M
3. Dalvik Debug Monitor Server(DDMS): DDMS is very useful for debugging the Android
Ans Content Providers are used to share data between two applications. This can be implemented (1 M for Application.
in two ways: each
significance 4. Android Debug Bridge (ADB): It is a very versatile command-line tool and is helpful for
1. When you want to implement the existing content provider in another application.
, the communication between the developer and the Emulator or the Android device that is
2. When you want to create a new content provider that can share its data with other
connected.
Applications
c) Explain the Android security model. 4M
2. Attempt any THREE of the following: 12 M Ans The Android security model is primarily based on a sandbox and permission mechanism. Each 2 M for
application is running in a specific Dalvik virtual machine with a unique user ID assigned to it, explanation
a) Describe the different features of Android. 4M , 2 M for
which means the application code runs in isolation from the code of all other applications.
Ans User Interface: The user interface of the Android operating system is straight forward, and (1 M for Therefore, one application has not granted access to other applications’ files. explaining
these features make it very user friendly. each permissions
feature, 4 Android application has been signed with a certificate with a private key Know the owner of , any 2
Multiple Language Support: Android supports multiple languages in its operating system and features the application is unique. This allows the author of the application will be identified if needed. permissions
one can change the language very easily based on one’s requirement, the International expected) When an application is installed in the phone is assigned a user ID, thus avoiding it from expected)
languages supported are English, Germany, Chinese, Dutch, French, German, Japanese, affecting it other applications by creating a sandbox for it. This user ID is permanent on which
Korean, Russian, and many more also some native language of India is also Supported Like devices and applications with the same user ID are allowed to run in a single process. This is a
Hindi, Marathi, Gujarati, Punjabi and many more. way to ensure that a malicious application has Cannot access / compromise the data of the
genuine application. It is mandatory for an application to list all the resources it will Access
Multi-tasking: Android provides support to run apps and services in the background with ease during installation. Terms are required of an application, in the installation process should be
which allows the users to use multiple apps at the same time. user-based or interactive Check with the signature of the application.
Connectivity: Android has extensive support to the connectivity and it supports connectivity Declaring and Using Permissions
such as WiFi, Bluetooth, Hotspot, CDMA, GSM, NFC, VOLTE, UBB, VPN, 3G network
band, and 4G Network Band. The purpose of a permission is to protect the privacy of an Android user. Android apps must
request permission to access sensitive user data (such as contacts and SMS), as well as certain
Extensive Application Support: Android have Play store which is used as the major tool to system features (such as camera and internet). Depending on the feature, the system might grant
download and update applications on the operating system, however, one can download the the permission automatically or might prompt the user to approve the request.
installer(often called as APK file) and install it manually, but it is not much recommended as
third party applications could be prone to some security breach in the smartphones. Permissions are divided into several protection levels. The protection level affects whether
runtime permission requests are required. There are three protection levels that affect third-
b) Explain features of Android SDK. 4M party apps: normal, signature, and dangerous permissions.

Ans Android SDK is a collection of libraries and Software Development tools that are essential for (1 M for Normal permissions: Normal permissions cover areas where your app needs to access data or
Developing Android Applications. Whenever Google releases a new version or update of each resources outside the app’s sandbox, but where there’s very little risk to the user’s privacy or

Page No: 3 | 41 Page No: 4 | 41


www.diplomachakhazana.in
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
the operation of other apps. For example, permission to set the time zone is a normal 1. setSpinnersShown(boolean shown): This method is used to set whether the spinner of the two
permission. If an app declares in its manifest that it needs a normal permission, the system date picker in shown or not. In this method you have to set a Boolean value either true or false. methods) 2
automatically grants the app that permission at install time. The system doesn’t prompt the user True indicates spinner is shown, false value indicates spinner is not shown. Default value for M
to grant normal permissions, and users cannot revoke these permissions. this function is true.
Syntax:
Signature permissions: The system grants these app permissions at install time, but only when DatePicker simpleDatePicker = (DatePicker)findViewById(R.id.simpleDatePicker);
the app that attempts to use permission is signed by the same certificate as the app that defines simpleDatePicker.setSpinnersShown(false);
the permission. 2. getDayOfMonth(): This method is used to get the selected day of the month from a date
Dangerous permissions: Dangerous permissions cover areas where the app wants data or picker.
resources that involve the user’s private information, or could potentially affect the user’s This method returns an integer value.
stored data or the operation of other apps. For example, the ability to read the user’s contacts is DatePicker simpleDatePicker = (DatePicker) findViewById(R.id.simpleDatePicker);
a dangerous permission. If an app declares that it needs a dangerous permission, the user must int day = simpleDatePicker.getDayOfMonth();
explicitly grant the permission to the app. Until the user approves the permission, your app 3. getMonth(): This method is used to get the selected month from a date picker. This method
cannot provide functionality that depends on that permission. To use a dangerous permission, returns an integer value.
your app must prompt the user to grant permission at runtime. For more details about how the DatePicker simpleDatePicker = (DatePicker)findViewById(R.id.simpleDatePicker);
user is prompted, see Request prompt for dangerous permission. int month = simpleDatePicker.getMonth();
4. getYear(): This method is used to get the selected year from a date picker. This method
d) Elaborate the need of permissions in Android. Explain the permissions to set 4M returns an integer value.
system functionalitics like SEND-SMS, bluetooth. DatePicker simpleDatePicker = (DatePicker)findViewById(R.id.simpleDatePicker);
int year = simpleDatePicker.getYear();
Ans The purpose of a permission is to protect the privacy of an Android user. Android apps must(2 M for
5. getFirstDayOfWeek(): This method is used to get the first day of the week. This method
request permission to access sensitive user data (such as contacts and SMS), as well as certain
explanation
returns an integer value.
system features (such as camera and internet). Depending on the feature, the system might grant
of need, 1
DatePicker simpleDatePicker = (DatePicker)findViewById(R.id.simpleDatePicker);
the permission automatically or might prompt the user to approve the request. M each for
explaining int firstDay=simpleDatePicker.getFirstDayOfWeek();
 android. permission. SEND_SMS permissions TimePicker:
Allows the app to send SMS messages. This may result in unexpected charges. of Sms and In Android, TimePicker is a widget used for selecting the time of the day in either AM/PM
Malicious apps may cost you money by sending messages without your confirmation. bluetooth) mode or 24 hours mode. The displayed time consist of hours, minutes and clock format. If we
need to show this view as a Dialog then we have to use a TimePickerDialog class.
Following is the code snippet to set SEND_SMS permissions in manifest file. Methods of TimePicker:
<uses-permission android: name="android.permission.SEND_SMS"/> 1. setCurrentHour(Integer currentHour): This method is used to set the current hours in a
time picker.
 android. permission. BLUETOOTH setHour(Integer hour): setCurrentHour() method was deprecated in API level 23. From api
You need to provide following permissions in AndroidManifest.xml file. level 23 we have to use setHour(Integer hour). In this method there is only one parameter of
<uses-permission android:name="android.permission.BLUETOOTH" /> integer type which is used to set the value for hours.
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> TimePicker simpleTimePicker=(TimePicker)findViewById(R.id.simpleTimePicker);
simpleTimePicker.setCurrentHour(5);
simpleTimePicker.setHour(5);
3. Attempt any THREE of the following: 12 M 2. setCurrentMinute(Integer currentMinute): This method is used to set the current minutes
in a time picker. setMinute(Integer minute): setCurrentMinute() method was deprecated in API
a) Explain data and time picker with its method. 4M level 23. From api level 23 we have to use setMinute(Integer minute). In this method there is
only one parameter of integer type which set the value for minutes.
Ans Date Picker: Date picker TimePicker simpleTimePicker=(TimePicker)findViewById(R.id.simpleTimePicker);
In Android, DatePicker is a widget used to select a date. It allows to select date by day, month (any two simpleTimePicker.setCurrentMinute(35);
and year in our custom UI (user interface). If we need to show this view as a dialog then we methods) 2 simpleTimePicker.setMinute(35);
have to use a DatePickerDialog class. M and time 4. getCurrentMinute(): This method is used to get the current minutes from a time picker.
Methods of DatePicker:
picker (any
Page No: 5 | 41 www.diplomachakhazana.in Page No: 6 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
getMinute(): getCurrentMinute() method was deprecated in API level 23. From api level 23 settings from previous version of studio. In case if you don’t have any previous version,
we have to use getMinute(). This method returns an integer value. select second option and click OK
TimePicker simpleTimePicker = (TimePicker)findViewById(R.id.simpleTimePicker);  Now android studio will open a welcome wizard window in that click Next to validate
int minutes = simpleTimePicker.getCurrentMinute(); our current Android SDK and development environment setup
int minutes = simpleTimePicker.getMinute();  Now select a Standard installation type and click Next to install a common settings and
5. setIs24HourView(Boolean is24HourView): This method is used to set the mode of the options
Time picker either 24 hour mode or AM/PM mode. In this method we set a Boolean value  Now verify settings and click Finish to complete android studio setup process
either true or false. True value indicate 24 hour mode and false value indicate AM/PM mode.  After completion of required components installation click on Finish
TimePicker simpleTimePicker = (TimePicker)findViewById(R.id.simpleTimePicker);
 After completion of all required components installation, we will be able to see Android
simpleTimePicker.setIs24HourView(true); Studio welcome window
6. is24HourView(): This method is used to check the current mode of the time picker. This
method returns true if its 24 hour mode or false if AM/PM mode is set. c) Explain the activity life cycle. 4M
TimePicker simpleTimePicker = (TimePicker)findViewById(R.id.simpleTimePicker);
Boolean mode=simpleTimePicker.is24HourView(); Ans Diagram 2
M
7.setOnTimeChangedListener(TimePicker.OnTimeChangedListener
explanation
onTimeChanged(): This method is used to set the callback that indicates the time has been
2M
adjusted by the user.
onTimeChanged(TimePicker view, int hourOfDay, int minute) is an override function of this
listener in which we have three parameters first is for TimePicker, second for getting hour of
the day and last is for getting the minutes after changing the time of the time picker.
TimePicker simpleTimePicker = (TimePicker)findViewById(R.id.simpleTimePicker);
simpleTimePicker.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener() {
@Override
public void onTimeChanged(TimePicker view, int hourOfDay, int minute) {
}
});
b) Explain the steps to install and configure Android studio and SDK. 4M

Ans  Download the latest version of Android Studio from above URL and launch Android 4 M for
Studio.exe file by double clicking on it. steps
 The initial android studio setup screen will open in that click Next to continue for further
steps of environment setup
 Now we need to select a required components to setup an android environment. Here
we selected all three components (Android Studio, Android SDK and Android Virtual
Device) and click Next.
 Now we need to agree the License agreements to proceed further, click on I Agree
button
 Now we need to specify the local machine drive location to install Android Studio and
Android SDK.
 After selecting the location path to install required components, click Next.
 Now select the start menu folder to create a shortcut for android studio and click Install
 Once we click Install button the installation process will start and click Next after
completion of Installation.
 After that it will show installation completion wizard in that click Finish to launch
android studio While launching Android Studio it will give you an option to import Activities have a predefined life-cycle methods as follows:

Page No: 7 | 41 Page No: 8 | 41


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
onCreate (): Called then the activity is created. Used to initialize the activity, for Graphic Assets where you can add screenshots, images, videos, promotional graphics, and
example create the user interface. icons that showcase your app’s features and functionality.
Languages & Translations, Categorization where in category can be selected to which your
onStart ():called when activity is becoming visible to the user.
app belong to. Contact Details, Privacy Policy for apps that request access to sensitive user
onResume (): Called if the activity get visible again and the user starts interacting data or permissions, you need to enter a comprehensive privacy policy that effectively discloses
with the activity again. Used to initialize fields, register listeners, bind how your app collects, uses, and shares that data.
to services, etc.

onPause (): Called once another activity gets into the foreground. Always called Step 5: Upload APK to an App Release
before the activity is not visible anymore. Used to release resources or Finally upload your app, by uploading APK file. Before you upload APK, you need to create
save application data. For example you unregister listeners, intent an app release. You need to select the type of release you want to upload your first app version
receivers, unbind from services or remove system service listeners. to. You can choose between an internal test, a closed test, an open test, and a production release.
The first three releases allow you to test out your app among a select group of users before you
onStop (): Called once the activity is no longer visible. Time or CPU intensive shutdown make it go live for everyone to access.
operations, such as writing information to a database should be down in the onStop() method. This is a safer option because you can analyze the test results and optimize or fix your app
This method is guaranteed to be called as accordingly if you need to before rolling it out to all users.
of API 11. Once you create a production release, your uploaded app version will become accessible to
everyone in the countries you choose to distribute it in and click on ‘Create release.’
onDestroy (): called before the activity is destroyed.

d) Explain the steps to deploy app on Google Play Store. 4M Step 6: Provide an Appropriate Content Rating
If you don’t assign a rating to your app, it will be listed as ‘Unrated’. Apps that are ‘Unrated’
Ans Step 1: Create a Developer Account 4 M for all may get removed from Google Play.
Before you can publish any app on Google Play, you need to create a Developer Account. You steps To rate your app, you need to fill out a content rating questionnaire An appropriate content
can easily sign up for one using your existing Google Account. You’ll need to pay a one-time rating will also help you get to the right audience, which will eventually improve your
registration fee of $25 using your international credit or debit card. It can take up to 48 hours engagement rates.
for your registration to be fully processed.

Step 7: Set Up Pricing & Distribution


Step 2: Plan to Sell? Link Your Merchant Account Before you can fill out the details required in this step, you need to determine your app’s
If you want to publish a paid app or plan to sell in-app purchases, you need to create a payments monetization strategy. Once you know how your app is going to make money, you can go ahead
center profile, i.e. a merchant account. A merchant account will let you manage your app sales and set up your app as free or paid.
and monthly payouts, as well as analyze your sales reports right in your Play Console. You can always change your app from paid to free later, but you cannot change a free app to
paid. For that, you’ll need to create a new app and set its price.
Step 3: Create an App
After creating application by clicking on ‘Create Application'. Here you have to select your
Step 8: Rollout Release to Publish Your App
app’s default language from the drop-down menu and then type in a title for your app. The title
The final step involves reviewing and rolling out your release after making sure you’ve taken
of your app will show on Google Play after you’ve published. care of everything else.
Before you review and rollout your release, make sure the store listing, content rating, and
Step 4: Prepare Store Listing pricing and distribution sections of your app each have a green check mark next to them.
Before you can publish your app, you need to prepare its store listing. These are all the details Once you’re sure about the correctness of the details, select your app and navigate to ‘Release
that will show up to customers on your app’s listing on Google Play. You not necessarily management’ – ‘App releases.’ You can always opt for reviews by clicking on ‘Review’ to be
complete it at once, you can always save a draft and revisit it later when you’re ready to publish. taken to the ‘Review and rollout release’ screen. Here, you can see if there are any issues or
The information required for your store listing is divided into several categories such as warnings you might have missed out on.
Product Details containing title, short and full description of the app, your app’s title and Finally, select ‘Confirm rollout.’ This will also publish your app to all users in your target
description should be written with a great user experience in mind. Use the right keywords, but countries on Google Play.
don’t overdo it. Make sure your app doesn’t come across as spam-y or promotional, or it will
risk getting suspended on the Play Store.
Page No: 9 | 41 Page No: 10 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________

<ProgressBar
4. Attempt any THREE of the following: 12 M android:id="@+id/progressBar"
style="@android:style/Widget.ProgressBar.Horizontal"
a) Explain the fundamentals of Ul design in detail. 4M
android:layout_width="match_parent"
android:layout_height="wrap_content"
Ans 1. Views: 1 M for
android:layout_alignParentLeft="true"
• The basic building block for user interface in Android is a View, which is created from the each android:layout_alignParentTop="true"
View class and occupies a rectangular area on the screen and is responsible for drawing and android:layout_marginLeft="20dp"
event handling. android:layout_marginRight="20dp"
• Views are the base class for all visual interface elements (commonly known as controls or android:layout_marginTop="20dp"
widgets). All user interface UI controls, including the layout classes, are derived from View. android:indeterminate="false"
• A View is an object/widget that draws something on the sreen by the help of user interact. android:max="100"
android:minHeight="50dp"
• Examples of widgets are buttons, text boxes, labels etc.
android:minWidth="200dp"
2. View Groups: android:progress="1" />
• The ViewGroup is a subclass of View and provides invisible container that hold other Views <TextView
or other ViewGroups and define their layout properties. android:id="@+id/textView"
• View groups are extensions of the View class that can contain multiple child Views. In order android:layout_width="wrap_content"
to Extend the ViewGroup class to create compound controls made up of interconnected child android:layout_height="wrap_content"
android:layout_alignLeft="@+id/progressBar"
views.
android:layout_below="@+id/progressBar"/>
• A ViewGroup provides the layout in which we can order the appearance and sequence of </RelativeLayout>
views. Java file:
Examples of ViewGroup are FrmaeLayout, LineourLayout etc. package in.edu.vpt.progressbar;
3. Fragments: import androidx.appcompat.app.AppCompatActivity;
• Fragments represents a portion of user interface in an Activity. Fragments, introduced in import android.os.Bundle;
Android 3.0 which uses API level 11, are used to encapsulate portions of your UI. This import android.os.Handler;
encapsulation makes fragments particularly useful when optimizing our UI layouts for different import android.os.Looper;
screen sizes and creating reusable user interface (UI) elements. import android.widget.ProgressBar;
• Each Fragment includes its own user interface (UI) layout and receives the related input events import android.widget.TextView;
but is tightly bound to the activity into which each must be embedded. Fragments are similar public class MainActivity extends AppCompatActivity {
to UI view controller in iPhone development. private ProgressBar progressBar;
4. Activities: private int progressStatus = 0;
• Activities dictate the UI and handle the user interaction to the smart phone screen. Activities private TextView textView;
represent a single screen that user interact.
• Activities are the Android equivalent of Forms in traditional windows desktop development. @Override
To display a UI we assign a View (Usually a layout or Fragment) to an Activity protected void onCreate(Bundle savedInstanceState) {
b) Write a program to display a rectangular progress bar. 4M super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Ans Xml File: xml file
2M, progressBar = (ProgressBar) findViewById(R.id.progressBar);
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" textView = (TextView) findViewById(R.id.textView);
xmlns:tools="http://schemas.android.com/tools" java file 2 // Start long running operation in a background thread
android:layout_width="match_parent" M new Thread(new Runnable() {
android:layout_height="match_parent" public void run() {
tools:context=".MainActivity">
Page No: 11 | 41 Page No: 12 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
while (progressStatus < 100) { • The application layer runs within the Android run time using the classes and services made
progressStatus += 1; available from the application framework.
new Handler(Looper.getMainLooper()).post(new Runnable() { 2. Application Framework:
public void run() { • The Application Framework provides the classes used to create an Android application. It also
progressBar.setProgress(progressStatus); provides a generic abstraction for hardware access and manages the user interface and
textView.setText(progressStatus+"/"+progressBar.getMax()); application resources.
} • It basically provides the services through which we can create the particular class and make
}); that class helpful for the Applications creation.
try { • The application framework includes services like telephony service, location services,
// Sleep for 200 milliseconds. notification manager, NFC service, view system, etc. which we can use for application
Thread.sleep(200); development as per our requirements.
} catch (InterruptedException e) { 3. Android Runtime:
e.printStackTrace(); • Android Runtime environment is an important part of Android rather than an internal part and
} it contains a components like core libraries and the Dalvik virtual machine.
} • The Android run time is the engine that powers our applications along with the libraries and
} it forms the basis for the application framework.
}).start(); (i) Dalvik Virtual Machine (DVM) is a register-based virtual machine like Java Virtual
} Machine (JVM).
} It is specially designed and optimized for android to ensure that a device can run multiple
c) Explain Android system architecture in detail. 4M instances efficiently. It relies on the Linux kernel for threading and low-level memory
management.
Ans Diagram
(ii) The core libraries in android runtime will enable us to implement an android applications
2 M, using standard JAVA programming language.
Explanation
4. Platform Libraries:
2M • The Platform Libraries includes various C/C++ core libraries and Java based libraries such as
SSL, libc, Graphics, SQLite, Webkit, Media, Surface Manger, OpenGL etc. to provide a
support for android development.
5. Linux Kernel:
• Linux Kernel is a bottom layer and heart of the android architecture. It is heart of Android
architecture that exists at the root of android architecture and contains all the low-level device
drivers for the various hardware components of an Android device.
• Linux Kernel is responsible for device drivers, power management, memory management,
device management and resource access. It manage all the drivers such as display drivers,
camera drivers, Bluetooth drivers, audio drivers, memory drivers, etc. which are mainly
required for the android device during the runtime.
• The Linux Kernel will provide an abstraction layer between the device hardware and the
remainder of the stack. It is responsible for memory management, power management, device
management, resource access, etc.
d) Explain the procedure of Geo-coding and reverse Geo-coding. 4M
1. Applications:
• The top layer of android architecture is Applications. The native and third party applications Ans Geo-Coding: geocoding 2
like Contacts, Email, Music, Gallery, Clock, Games, etc. whatever we will build those will be • If we know the latitude and longitude of a location, we can find out its address using a process M
installed on this layer only. known as Geocoding. Google Maps in Android supports this via the Geocoder class.

Page No: 13 | 41 Page No: 14 | 41


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
• The following code shows how we can find out the address of a location we have just touched and Reverse-geocoding:
using the getFromLocation() method: reverse If we know the address of a location but want to know its latitude and longitude, we can do so
classMapOverlay extends com.google.android.maps.Overlay geocoding 2 via reverse-Geocoding. Again, we can use the Geocoder class for this purpose.
M
{ • The following code shows how we can find the exact location of the Empire State Building
@Override by using the getFromLocationName() method:
publicboolean draw(Canvas canvas, MapViewmapView, Geocoder geoCoder = new Geocoder(this, Locale.getDefault());
boolean shadow, long when) try {
{ List<Address> addresses = geoCoder.getFromLocationName(
//... "empire state building", 5);
} String add = "";
@Override if (addresses.size() > 0) {
publicbooleanonTouchEvent(MotionEvent event, MapViewmapView) p = new GeoPoint(
{ (int) (addresses.get(0).getLatitude() * 1E6),
//---when user lifts his finger--- (int) (addresses.get(0).getLongitude() * 1E6));
if (event.getAction() == 1) { mc.animateTo(p);
GeoPoint p = mapView.getProjection().fromPixels( mapView.invalidate();
(int) event.getX(), }
(int) event.getY()); } catch (IOException e) {
Geocoder geoCoder = new Geocoder( e.printStackTrace();
getBaseContext(), Locale.getDefault()); }
try { Once. the location is found, the above code navigates the map to the location.
List<Address> addresses = geoCoder.getFromLocation( e) Develop an application to send and receive SMS (Write only Java and 4M
p.getLatitudeE6() / 1E6, permission tag in manifest file).
p.getLongitudeE6() / 1E6, 1); Ans Permissions and <receiver> tag required in AndroidManifest.xml Manifest
String add = ""; <uses-permission android:name="android.permission.RECEIVE_SMS" /> File:1M
if (addresses.size() > 0) <uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.READ_SMS"/> Java Code:
{
<uses-permission android:name="android.permission.WRITE_SMS"/> 3M
for (inti=0; i<addresses.get(0).getMaxAddressLineIndex();
i++)
<receiver
add += addresses.get(0).getAddressLine(i) + "n"; android:name=".SmsReceiver"
} android:enabled="true"
Toast.makeText(getBaseContext(), add, Toast.LENGTH_SHORT).show(); android:exported="true">
} <intent-filter>
catch (IOException e) { <action android:name="android.provider.Telephony.SMS_RECEIVED" />
e.printStackTrace(); </intent-filter>
</receiver>
}
return true; MainActivity.java
} (Cosidering appropriate layout file with 2 edit text boxes namely for phone number,
else message and a button for sending sms)
return false;
} package com.example.testreceivesms;
import androidx.appcompat.app.AppCompatActivity;
}
import androidx.core.app.ActivityCompat;

Page No: 15 | 41 Page No: 16 | 41


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
import androidx.core.content.ContextCompat; protected void onStart() {
import android.Manifest; super.onStart();
import android.content.IntentFilter; IntentFilter filter=new IntentFilter("android.provider.Telephony.SMS_RECEIVED");
import android.content.pm.PackageManager; registerReceiver(sms,filter);
import android.os.Bundle; }
import android.telephony.SmsManager;
import android.view.View; @Override
import android.widget.Button; protected void onStop() {
import android.widget.EditText; super.onStop();
import android.widget.Toast; unregisterReceiver(sms);
}
public class MainActivity extends AppCompatActivity { }
SmsReceiver sms= new SmsReceiver();
EditText et1,et2; SmsReceiver.java
Button b1; package com.example.testreceivesms;
@Override import android.content.BroadcastReceiver;
protected void onCreate (Bundle savedInstanceState) { import android.content.Context;
super.onCreate(savedInstanceState); import android.content.Intent;
setContentView(R.layout.activity_main); import android.os.Bundle;
et1=findViewById(R.id.etPhno); import android.telephony.SmsMessage;
et2=findViewById(R.id.etmsg); import android.widget.Toast;
b1=findViewById(R.id.btnSms);
if(ContextCompat.checkSelfPermission(MainActivity.this,Manifest.permission.SEND_S public class SmsReceiver extends BroadcastReceiver {
MS)!= SmsReceiver(){}
PackageManager.PERMISSION_GRANTED) @Override
{ public void onReceive(Context context, Intent intent) {
ActivityCompat.requestPermissions(MainActivity.this,new Bundle bundle = intent.getExtras();
String[]{Manifest.permission.SEND_SMS},100);
} if (bundle != null) {
b1.setOnClickListener(new View.OnClickListener() { // Retrieve the SMS Messages received
@Override Object[] sms = (Object[]) bundle.get("pdus");
public void onClick(View v) {
try { // For every SMS message received
String phno= et1.getText().toString(); for (int i=0; i < sms.length; i++) {
String msg=et2.getText().toString(); // Convert Object array
SmsManager smsManager= SmsManager.getDefault(); SmsMessage smsMessage = SmsMessage.createFromPdu((byte[]) sms[i]);
smsManager.sendTextMessage(phno,null,msg,null,null);
Toast.makeText(MainActivity.this,"Sms sent successfully", String phone = smsMessage.getOriginatingAddress();
Toast.LENGTH_LONG).show(); String message = smsMessage.getMessageBody().toString();
}
catch(Exception e) Toast.makeText(context, “Received from “+ phone + ": " + message,
{ Toast.LENGTH_SHORT).show();
Toast.makeText(MainActivity.this,"Sms failed to send... try again", }
Toast.LENGTH_LONG).show(); }
} }
} }
});
}
@Override 5. Attempt any TWO of the following: 12 M

Page No: 17 | 41 Page No: 18 | 41


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
a) Develop a program to send and receive an Email. 6M android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/editText2"
Ans Program to send Email Any correct android:layout_alignBottom="@+id/editText2"
activity_main.xml logic android:layout_alignParentLeft="true"
<?xml version="1.0" encoding="utf-8"?> program android:text="Email Subject:"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" should be android:textColor="#0F9D58" />
xmlns:tools="http://schemas.android.com/tools" considered,
android:layout_width="match_parent" 3M for <TextView
android:layout_height="match_parent" send logic, android:id="@+id/textView3"
tools:context=".MainActivity"> 3M for android:layout_width="wrap_content"
receive android:layout_height="wrap_content"
<EditText logic android:layout_alignBaseline="@+id/editText3"
android:id="@+id/editText1" android:layout_alignBottom="@+id/editText3"
android:layout_width="wrap_content" android:text="Email Body:"
android:layout_height="wrap_content" android:textColor="#0F9D58" />
android:layout_alignParentTop="true"
android:layout_alignParentRight="true" <Button
android:layout_marginTop="18dp" android:id="@+id/button"
android:layout_marginRight="22dp" /> android:layout_width="wrap_content"
android:layout_height="wrap_content"
<EditText android:layout_below="@+id/editText3"
android:id="@+id/editText2" android:layout_alignLeft="@+id/editText3"
android:layout_width="wrap_content" android:layout_marginLeft="76dp"
android:layout_height="wrap_content" android:layout_marginTop="20dp"
android:layout_below="@+id/editText1" android:text="Send email!!" />
android:layout_alignLeft="@+id/editText1" </RelativeLayout>
android:layout_marginTop="20dp" />
MainActivity.java
<EditText import android.content.Intent;
android:id="@+id/editText3" import android.os.Bundle;
android:layout_width="wrap_content" import android.widget.Button;
android:layout_height="wrap_content" import android.widget.EditText;
android:layout_below="@+id/editText2" import androidx.appcompat.app.AppCompatActivity;
android:layout_alignLeft="@+id/editText2" public class MainActivity extends AppCompatActivity {
android:layout_marginTop="30dp" /> // define objects for edit text and button
Button button;
<TextView EditText sendto, subject, body;
android:id="@+id/textView1"
android:layout_width="wrap_content" @Override
android:layout_height="wrap_content" protected void onCreate(Bundle savedInstanceState) {
android:layout_alignBaseline="@+id/editText1" super.onCreate(savedInstanceState);
android:layout_alignBottom="@+id/editText1" setContentView(R.layout.activity_main);
android:layout_alignParentLeft="true"
android:text="Send To:" // Getting instance of edittext and button
android:textColor="#0F9D58" /> sendto = findViewById(R.id.editText1);
subject = findViewById(R.id.editText2);
<TextView body = findViewById(R.id.editText3);
android:id="@+id/textView2" button = findViewById(R.id.button);
android:layout_width="wrap_content"
Page No: 19 | 41 Page No: 20 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
// attach setOnClickListener to button with Intent object define in it registerReceiver(gml, intf);
button.setOnClickListener(view -> { }
String emailsend = sendto.getText().toString();
String emailsubject = subject.getText().toString(); @Override
String emailbody = body.getText().toString(); protected void onDestroy() {
super.onDestroy();
// define Intent object with action attribute as ACTION_SEND unregisterReceiver(gml);
Intent intent = new Intent(Intent.ACTION_SEND); }
}
// add three fields to intent using putExtra function Gmailrerciever..java
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{emailsend}); package com.example.myemailprog;
intent.putExtra(Intent.EXTRA_SUBJECT, emailsubject);
intent.putExtra(Intent.EXTRA_TEXT, emailbody); import android.app.Notification;
import android.app.NotificationManager;
// set type of intent import android.app.PendingIntent;
intent.setType("message/rfc822"); import android.content.BroadcastReceiver;
import android.content.Context;
// startActivity with intent with chooser as Email client using import android.content.Intent;
createChooser function import android.content.res.Resources;
startActivity(Intent.createChooser(intent, "Choose an Email client :")); import android.graphics.BitmapFactory;
}); import android.widget.Toast;
}
} public class GmailReceiver extends BroadcastReceiver
{
Program to receive Email @Override
(Note: Receiving email is not the service of Android OS, instead it uses some third party public void onReceive(Context context, Intent intent)
applicaton like Gmail, so instead of receiving email in android app, a code which broadcasts {
Toast.makeText(context, "Email Received", Toast.LENGTH_LONG).show();
message if email comes using broadcast receiver or any relevant logic can be considered.)
MainActivity.java }
package com.example.myemailprog; }
import androidx.appcompat.app.AppCompatActivity;
import android.content.IntentFilter; AndroidManifest.xml
import android.os.Bundle; <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
public class MainActivity extends AppCompatActivity { package="com.example.myemailprog">
GmailReceiver gml; <application
IntentFilter intf; android:allowBackup="true"
@Override android:icon="@mipmap/ic_launcher"
protected void onCreate(Bundle savedInstanceState) { android:label="@string/app_name"
super.onCreate(savedInstanceState); android:roundIcon="@mipmap/ic_launcher_round"
setContentView(R.layout.activity_main); android:supportsRtl="true"
gml = new GmailReceiver(); android:theme="@style/Theme.MyEmailProg">
intf = new IntentFilter("android.intent.action.VIEW"); <activity
} android:name=".MainActivity"
android:exported="true">
@Override <intent-filter>
protected void onResume() { <action android:name="android.intent.action.MAIN" />
super.onResume(); <category android:name="android.intent.category.LAUNCHER" />
Page No: 21 | 41 Page No: 22 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
</intent-filter>
</activity> <Button
<receiver android:name="GmailReceiver" android:id="@+id/button3"
android:exported="false"> android:layout_width="wrap_content"
<intent-filter> android:layout_height="wrap_content"
<action android:name="android.intent.action.PROVIDER_CHANGED" android:layout_alignLeft="@+id/button2"
android:priority="-10"> android:layout_below="@+id/button2"
</action> android:layout_marginTop="28dp"
<action android:name="android.intent.action.VIEW" /> android:text="TURN_OFF" />
<data android:scheme="content" android:host="gmail-ls"
android:pathPattern="/unread/.*"> </RelativeLayout>
</data>
</intent-filter> AndroidManifest.xml
</receiver> <?xml version="1.0" encoding="utf-8"?>
</application> <manifest xmlns:androclass="http://schemas.android.com/apk/res/android"
</manifest> package="com.example.bluetooth"
b) Develop a program for providing bluetooth connectivity. 6M android:versionCode="1"
android:versionName="1.0" >
Ans activity_main.xml Layout file
<RelativeLayout xmlns:androclass="http://schemas.android.com/apk/res/android" : 2M <uses-sdk
xmlns:tools="http://schemas.android.com/tools" android:minSdkVersion="8"
android:layout_width="match_parent" Java File :
android:targetSdkVersion="16" />
android:layout_height="match_parent" 3M
<uses-permission android:name="android.permission.BLUETOOTH" />
tools:context=".MainActivity" > <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
Manifest
file : 1M <application
<TextView android:text="" android:allowBackup="true"
android:id="@+id/out" android:icon="@drawable/ic_launcher"
android:layout_width="wrap_content" android:label="@string/app_name"
android:layout_height="wrap_content"> android:theme="@style/AppTheme" >
</TextView> <activity
<Button android:name="com.example.bluetooth.MainActivity"
android:label="@string/app_name" >
android:id="@+id/button1" <intent-filter>
android:layout_width="wrap_content" <action android:name="android.intent.action.MAIN" />
android:layout_height="wrap_content" <category android:name="android.intent.category.LAUNCHER" />
android:layout_alignParentLeft="true" </intent-filter>
android:layout_alignParentTop="true" </activity>
android:layout_marginLeft="30dp" </application>
android:layout_marginTop="49dp" </manifest>
android:text="TURN_ON" />
MainActivity.java
<Button package com.example.bluetooth;
android:id="@+id/button2" import android.os.Bundle;
android:layout_width="wrap_content" import android.app.Activity;
android:layout_height="wrap_content" import android.view.Menu;
android:layout_alignLeft="@+id/button1" import android.app.Activity;
android:layout_below="@+id/button1" import android.bluetooth.BluetoothAdapter;
android:layout_marginTop="27dp" import android.content.Context;
android:text="DISCOVERABLE" /> import android.content.Intent;
Page No: 23 | 41 Page No: 24 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
import android.os.Bundle; mBluetoothAdapter.disable();
import android.util.Log; //out.append("TURN_OFF BLUETOOTH");
import android.view.View; Toast.makeText(getApplicationContext(), "TURNING_OFF BLUETOOTH", Toast.LENGT
import android.widget.Button; H_LONG);
import android.widget.TextView; }
import android.widget.Toast; });
}
public class MainActivity extends Activity { @Override
private static final int REQUEST_ENABLE_BT = 0; public boolean onCreateOptionsMenu(Menu menu) {
private static final int REQUEST_DISCOVERABLE_BT = 0; // Inflate the menu; this adds items to the action bar if it is present.
@Override getMenuInflater().inflate(R.menu.activity_main, menu);
protected void onCreate(Bundle savedInstanceState) { return true;
super.onCreate(savedInstanceState); }
setContentView(R.layout.activity_main);
final TextView out=(TextView)findViewById(R.id.out); }
final Button button1 = (Button) findViewById(R.id.button1); c) Develop a program to implement 6M
final Button button2 = (Button) findViewById(R.id.button2);
final Button button3 = (Button) findViewById(R.id.button3); i) List view of 5 items
final BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); ii) Grid view of 4 x 4 items
if (mBluetoothAdapter == null) { iii) Image view.
out.append("device not supported");
} Ans <?xml version="1.0" encoding="utf-8"?> Correct
button1.setOnClickListener(new View.OnClickListener() { <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" Logics for
public void onClick(View v) { xmlns:tools="http://schemas.android.com/tools"
if (!mBluetoothAdapter.isEnabled()) { xmlns:app="http://schemas.android.com/apk/res-auto" ListView :
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); android:layout_width="match_parent" 2M
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT); android:layout_height="match_parent"
GridView :
} android:orientation="vertical"
2M
} tools:context=".MainActivity">
}); ImageView
button2.setOnClickListener(new View.OnClickListener() { <ListView : 2M
@Override android:id="@+id/sample_list"
public void onClick(View arg0) { android:layout_width="match_parent"
if (!mBluetoothAdapter.isDiscovering()) { android:layout_height="wrap_content" >
//out.append("MAKING YOUR DEVICE DISCOVERABLE"); </ListView>
Toast.makeText(getApplicationContext(), "MAKING YOUR DEVICE DISCOVERA
BLE", <GridView
Toast.LENGTH_LONG); android:id="@+id/gridview1"
android:layout_width="fill_parent"
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVER android:layout_height="wrap_content"
ABLE); android:columnWidth="50dp"
startActivityForResult(enableBtIntent, REQUEST_DISCOVERABLE_BT); android:gravity="center"
android:numColumns="auto_fit"
} android:stretchMode="columnWidth" >
} </GridView>
});
button3.setOnClickListener(new View.OnClickListener() { <ImageView
@Override android:id="@+id/full_logo"
public void onClick(View arg0) { android:layout_width="match_parent"

Page No: 25 | 41 Page No: 26 | 41


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
android:layout_height="wrap_content" a) Develop an application to store customer's details like, customer-id, customer-name, 6M
app:srcCompat="@drawable/android_logo" /> mobile number, address, pin-code and retrieve customer information using customer-id
in SQLite databases.
</LinearLayout> (Any other relevant logic can be considered)
Placed image that has to be displayed in drawable folder
Ans activity_main.xml Layout File
<?xml version="1.0" encoding="utf-8"?> : 1M
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" Java File :
xmlns:tools="http://schemas.android.com/tools"
package in.msbte.controls_exam_ques;
android:layout_width="match_parent" Correct
import androidx.appcompat.app.AppCompatActivity; Logics for
import android.os.Bundle; android:layout_height="match_parent"
import android.widget.ArrayAdapter; tools:context=".MainActivity">
Create
import android.widget.GridView; table : 1M
import android.widget.ListView; <TextView Insertion of
android:text="Insert Customer Details" record : 2M
public class MainActivity extends AppCompatActivity { Retrival of
android:layout_width="wrap_content"
String[] sampleArray = {"Item 1","Item 2","Item 3","Item 4", "Item 5"}; data : 2M
GridView gridView; android:layout_height="wrap_content"
static final String[] alphabets = new String[]{ android:layout_alignParentTop="true"
"A", "B", "C", "D", "E", android:layout_centerHorizontal="true"
"F", "G", "H", "I", "J", android:id="@+id/textView"
"K", "L", "M", "N", "O", android:gravity="center"
"P", "Q", "R", "S", "T", android:textSize="20dp"
"U", "V", "W", "X", "Y", "Z"
android:textColor="#000000"/>
};
ArrayAdapter adapter, adapter1;
<EditText
@Override android:layout_width="fill_parent"
protected void onCreate(Bundle savedInstanceState) { android:layout_height="wrap_content"
super.onCreate(savedInstanceState); android:hint="ID"
setContentView(R.layout.activity_main); android:id="@+id/editid"
android:layout_below="@+id/textView"/>
//List View
adapter = new ArrayAdapter<String>(this, R.layout.simple_item, sampleArray);
ListView listView = (ListView) findViewById(R.id.sample_list); <EditText
listView.setAdapter(adapter); android:layout_width="fill_parent"
android:layout_height="wrap_content"
//Grid View android:hint="Name"
gridView = (GridView) findViewById(R.id.gridview1);
android:id="@+id/editname"
adapter1 = new ArrayAdapter<String>(this, R.layout.simple_item, alphabets);
gridView.setAdapter(adapter1); android:layout_below="@+id/editid"/>

} <EditText
} android:layout_width="fill_parent"
6. Attempt any TWO of the following: 12 M android:layout_height="wrap_content"
android:hint="Mobile No."
android:id="@+id/editmobile"
android:layout_below="@+id/editname"/>
Page No: 27 | 41 Page No: 28 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
<Button
<EditText android:text="Search Data"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="Address" android:layout_below="@+id/editsearchid"
android:lines="3" android:layout_centerHorizontal="true"
android:id="@+id/editaddress" android:id="@+id/button1" />
android:layout_below="@+id/editmobile"/> </RelativeLayout>

<EditText MainActivity.java
android:layout_width="fill_parent" package in.msbte.database;
android:layout_height="wrap_content" import androidx.appcompat.app.AppCompatActivity;
android:hint="Pin Code" import android.content.Context;
android:id="@+id/editpincode" import android.database.Cursor;
android:layout_below="@+id/editaddress"/> import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
<Button import android.view.View;
android:text="Insert Data" import android.widget.Button;
android:layout_width="fill_parent" import android.widget.EditText;
android:layout_height="wrap_content" import android.widget.Toast;
android:layout_below="@+id/editpincode"
android:layout_centerHorizontal="true" public class MainActivity extends AppCompatActivity {
android:id="@+id/button" /> SQLiteDatabase sqLiteDatabaseObj;
EditText editTextID, editTextName, editMobileNo, editAddress, editPincode,
<TextView editSearchid;
android:text="Search Customer Details" String cid, cname, cmobile, caddress, cpincode, sql_query, sid;
android:layout_width="wrap_content" Button EnterData, SearchData;
android:layout_height="wrap_content"
android:layout_marginTop="30dp" @Override
android:layout_centerHorizontal="true" protected void onCreate(Bundle savedInstanceState) {
android:id="@+id/textView1" super.onCreate(savedInstanceState);
android:gravity="center" setContentView(R.layout.activity_main);
android:textSize="20dp" EnterData = (Button)findViewById(R.id.button);
android:layout_below="@+id/button" SearchData = (Button)findViewById(R.id.button1);
android:textColor="#000000"/> editTextID = (EditText)findViewById(R.id.editid);
editTextName = (EditText)findViewById(R.id.editname);
<EditText editMobileNo = (EditText)findViewById(R.id.editmobile);
android:layout_width="fill_parent" editAddress = (EditText)findViewById(R.id.editaddress);
android:layout_height="wrap_content" editPincode = (EditText)findViewById(R.id.editpincode);
android:hint="Enter ID" editSearchid = (EditText)findViewById(R.id.editsearchid);
android:id="@+id/editsearchid"
android:layout_below="@+id/textView1"/> EnterData.setOnClickListener(new View.OnClickListener() {
@Override
Page No: 29 | 41 Page No: 30 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
public void onClick(View view) { Ans AndroidManifest.xml Manifest
sqLiteDatabaseObj = openOrCreateDatabase("AndroidJSonDataBase", file :2M
<?xml version="1.0" encoding="utf-8"?>
Context.MODE_PRIVATE, null); Java File :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
sqLiteDatabaseObj.execSQL("CREATE TABLE IF NOT EXISTS package="com.example.msbte.google_map_currentlocationroute"> 4M
AndroidJSonTable(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, cid
VARCHAR, name VARCHAR, mobile VARCHAR, address VARCHAR, pincode <uses-permission android:name="android.permission.INTERNET" />
VARCHAR);"); <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
cid = editTextID.getText().toString(); <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"
cname = editTextName.getText().toString() ; />
<application
cmobile = editMobileNo.getText().toString();
android:allowBackup="true"
caddress = editAddress.getText().toString(); android:icon="@mipmap/ic_launcher"
cpincode = editPincode.getText().toString(); android:label="@string/app_name"
sql_query = "INSERT INTO AndroidJSonTable (cid, name, mobile, address, android:roundIcon="@mipmap/ic_launcher_round"
pincode) VALUES('"+cid+"', '"+cname+"', '"+cmobile+"', '"+caddress+"', '"+cpincode+"');"; android:supportsRtl="true"
sqLiteDatabaseObj.execSQL(sql_query); android:theme="@style/AppTheme">
Toast.makeText(getApplicationContext(), "Data Inserted Successfully",
<meta-data
Toast.LENGTH_LONG).show();
android:name="com.google.android.gms.version"
} android:value="@integer/google_play_services_version" />
}); <meta-data
android:name="com.google.android.geo.API_KEY"
SearchData.setOnClickListener(new View.OnClickListener() { android:value="@string/google_maps_key" />
@Override
public void onClick(View view) { <activity android:name=".MainActivity">
<intent-filter>
sid = editSearchid.getText().toString(); <action android:name="android.intent.action.MAIN" />
Cursor cursor = sqLiteDatabaseObj.rawQuery( "select * from AndroidJSonTable
where cid="+sid+"", null ); <category android:name="android.intent.category.LAUNCHER" />
StringBuffer buffer= new StringBuffer(); </intent-filter>
while (cursor.moveToNext()) </activity>
{ </application>
</manifest>
String cid =cursor.getString(1);
String name =cursor.getString(2); MainActivity.java
String mob =cursor.getString(3);
String addr =cursor.getString(4); import android.Manifest;
String pcode =cursor.getString(5); import android.content.DialogInterface;
buffer.append(cid+ " " + name + " " + mob +" " + addr +" " + pcode +" import android.content.Intent;
\n"); import android.content.pm.PackageManager;
import android.location.Location;
Toast.makeText(getApplicationContext(), buffer,
import android.net.Uri;
Toast.LENGTH_LONG).show(); import android.provider.Settings;
} }); } } import android.support.v4.app.ActivityCompat;
b) Write a program to find the direction from user's current location to MSBTE, 6M import android.support.v7.app.AlertDialog;
Bandra. (Write only Java and manitest file). import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
(Note : Any other relevant logic to get the required output can also be considered.) import android.util.Log;

Page No: 31 | 41 Page No: 32 | 41


MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
import android.view.View; private long FASTEST_INTERVAL = 2000; /* 2 sec */
import android.widget.Button;
import android.widget.TextView; @Override
import android.widget.Toast; protected void onCreate(Bundle savedInstanceState) {
import com.google.android.gms.common.ConnectionResult; super.onCreate(savedInstanceState);
import com.google.android.gms.common.api.GoogleApiClient; setContentView(R.layout.activity_main);
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices; //code for getting current location
import com.google.android.gms.maps.CameraUpdateFactory; requestMultiplePermissions();
import com.google.android.gms.maps.GoogleMap; tvLocation = (TextView) findViewById((R.id.tv));
import com.google.android.gms.maps.MapFragment; mGoogleApiClient = new GoogleApiClient.Builder(this)
import com.google.android.gms.maps.OnMapReadyCallback; .addConnectionCallbacks(this)
import com.google.android.gms.maps.model.CameraPosition; .addOnConnectionFailedListener(this)
import com.google.android.gms.maps.model.LatLng; .addApi(LocationServices.API)
import com.google.android.gms.maps.model.MarkerOptions; .build();
import com.google.android.gms.maps.model.Polyline; }
import com.google.android.gms.maps.model.PolylineOptions;
import com.karumi.dexter.Dexter; //code for drawing route
import com.karumi.dexter.MultiplePermissionsReport;
import com.karumi.dexter.PermissionToken; @Override
import com.karumi.dexter.listener.DexterError; public void onMapReady(GoogleMap googleMap) {
import com.karumi.dexter.listener.PermissionRequest; mMap = googleMap;
import com.karumi.dexter.listener.PermissionRequestErrorListener; mMap.clear();
import com.karumi.dexter.listener.multi.MultiplePermissionsListener; Log.d("mylog", "Added Markers");
import java.util.List; mMap.addMarker(place1);
mMap.addMarker(place2);
public class MainActivity extends AppCompatActivity implements
GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, CameraPosition googlePlex = CameraPosition.builder()
com.google.android.gms.location.LocationListener , OnMapReadyCallback, .target(new LatLng(22.7739,71.6673))
TaskLoadedCallback{ .zoom(7)
.bearing(0)
//variables for map and route .tilt(45)
.build();
private GoogleMap mMap;
private MarkerOptions place1, place2; mMap.animateCamera(CameraUpdateFactory.newCameraPosition(googlePlex), 5000,
Button getDirection; null);
private Polyline currentPolyline; }
private MapFragment mapFragment;
private boolean isFirstTime = true; private String getUrl(LatLng origin, LatLng dest, String directionMode) {
// Origin of route
//variables for current location String str_origin = "origin=" + origin.latitude + "," + origin.longitude;
private static final String TAG = "MainActivity"; // Destination of route
String str_dest = "destination=" + dest.latitude + "," + dest.longitude;
private TextView tvLocation; // Mode
private GoogleApiClient mGoogleApiClient; String mode = "mode=" + directionMode;
private Location mLocation; // Building the parameters to the web service
private LocationRequest mLocationRequest; String parameters = str_origin + "&" + str_dest + "&" + mode;
private com.google.android.gms.location.LocationListener listener; // Output format
private long UPDATE_INTERVAL = 2 * 1000; /* 10 secs */ String output = "json";
Page No: 33 | 41 Page No: 34 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
// Building the url to the web service .onSameThread()
String url = "https://maps.googleapis.com/maps/api/directions/" + output + "?" + .check();
parameters + "&key=" + getString(R.string.google_maps_key); }
return url;
} private void openSettingsDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
@Override builder.setTitle("Required Permissions");
public void onTaskDone(Object... values) { builder.setMessage("This app require permission to use awesome feature. Grant them in
if (currentPolyline != null) app settings.");
currentPolyline.remove(); builder.setPositiveButton("Take Me To SETTINGS", new
currentPolyline = mMap.addPolyline((PolylineOptions) values[0]); DialogInterface.OnClickListener() {
} @Override
public void onClick(DialogInterface dialog, int which) {
//runtime permission method dialog.cancel();
Intent intent = new
private void requestMultiplePermissions(){ Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Dexter.withActivity(this) Uri uri = Uri.fromParts("package", getPackageName(), null);
.withPermissions( intent.setData(uri);
Manifest.permission.ACCESS_FINE_LOCATION, startActivityForResult(intent, 101);
Manifest.permission.ACCESS_COARSE_LOCATION ) }
.withListener(new MultiplePermissionsListener() { });
@Override builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onPermissionsChecked(MultiplePermissionsReport report) { @Override
// check if all permissions are granted public void onClick(DialogInterface dialog, int which) {
if (report.areAllPermissionsGranted()) { dialog.cancel();
Toast.makeText(getApplicationContext(), "All permissions are granted by }
user!", Toast.LENGTH_SHORT).show(); });
} builder.show();
}
// check for permanent denial of any permission
if (report.isAnyPermissionPermanentlyDenied()) { //methods for getting current location
// show alert dialog navigating to Settings @Override
openSettingsDialog(); public void onConnected(Bundle bundle) {
} if (ActivityCompat.checkSelfPermission(this,
} Manifest.permission.ACCESS_FINE_LOCATION) !=
PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,
@Override Manifest.permission.ACCESS_COARSE_LOCATION) !=
public void onPermissionRationaleShouldBeShown(List<PermissionRequest> PackageManager.PERMISSION_GRANTED) {
permissions, PermissionToken token) { return;
token.continuePermissionRequest(); }
}
}). startLocationUpdates();
withErrorListener(new PermissionRequestErrorListener() { mLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
@Override if(mLocation == null){
public void onError(DexterError error) { startLocationUpdates();
Toast.makeText(getApplicationContext(), "Some Error! ", }
Toast.LENGTH_SHORT).show(); if (mLocation != null) {
} // mLatitudeTextView.setText(String.valueOf(mLocation.getLatitude()));
}) //mLongitudeTextView.setText(String.valueOf(mLocation.getLongitude()));
Page No: 35 | 41 Page No: 36 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
} else { Double.toString(location.getLongitude());
Toast.makeText(this, "Location not Detected", Toast.LENGTH_SHORT).show();
} } tvLocation.setText(String.valueOf(location.getLatitude() +"
"+String.valueOf(location.getLongitude())));
@Override Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
public void onConnectionSuspended(int i) {
Log.i(TAG, "Connection Suspended"); if(isFirstTime){
mGoogleApiClient.connect(); //code to draw path on map
}
@Override getDirection = findViewById(R.id.btnGetDirection);
public void onConnectionFailed(ConnectionResult connectionResult) { getDirection.setOnClickListener(new View.OnClickListener() {
Log.i(TAG, "Connection failed. Error: " + connectionResult.getErrorCode()); @Override
} public void onClick(View view) {
@Override new FetchURL(MainActivity.this).execute(getUrl(place1.getPosition(),
protected void onStart() { place2.getPosition(), "driving"), "driving");
super.onStart(); }
if (mGoogleApiClient != null) { });
mGoogleApiClient.connect();
} } place1 = new MarkerOptions().position(new LatLng(location.getLatitude(),
location.getLongitude())).title("Location 1");
@Override place2 = new MarkerOptions().position(new
protected void onStop() { LatLng(19.021824,72.8662016)).title("MSBTE");
super.onStop(); mapFragment = (MapFragment)
if (mGoogleApiClient.isConnected()) { getFragmentManager().findFragmentById(R.id.mapNearBy);
mGoogleApiClient.disconnect(); mapFragment.getMapAsync(this);
} } isFirstTime = false;
} }}
protected void startLocationUpdates() { c) Develop a simple calculator using relative layout. 6M
// Create the location request
mLocationRequest = LocationRequest.create() Ans activity_main.xml Use of
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY) <?xml version="1.0" encoding="utf-8"?> Relative
.setInterval(UPDATE_INTERVAL) <RelativeLayout Layout
.setFastestInterval(FASTEST_INTERVAL); with
xmlns:android="http://schemas.android.com/apk/res/android"
if (ActivityCompat.checkSelfPermission(this, appropriate
xmlns:app="http://schemas.android.com/apk/res-auto" attributes :
Manifest.permission.ACCESS_FINE_LOCATION) !=
xmlns:tools="http://schemas.android.com/tools" 3M
PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_COARSE_LOCATION) != android:layout_width="match_parent"
android:layout_height="match_parent" Logic for
PackageManager.PERMISSION_GRANTED) {
simple
return; tools:context=".MainActivity">
calculator
}
with basic
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, <TextView arithmetic
mLocationRequest, this);
android:id="@+id/heading" operations :
}
android:layout_width="wrap_content" 3M
@Override android:layout_height="wrap_content"
public void onLocationChanged(Location location) { android:text=" Calculator"
android:layout_centerHorizontal="true"
String msg = "Updated Location: " + android:textSize="30dp" />
Double.toString(location.getLatitude()) + "," +
Page No: 37 | 41 Page No: 38 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous) (Autonomous)
(ISO/IEC - 27001 - 2013 Certified) (ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________ __________________________________________________________________________________________________
<EditText android:id="@+id/div"
android:id="@+id/num1" android:layout_below="@id/result"
android:layout_below="@+id/heading" android:layout_toRightOf="@id/sub"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="Enter Number 1" android:layout_marginLeft="10dp"
android:inputType="number" /> android:text="/" />

<EditText <Button
android:id="@+id/num2" android:id="@+id/mul"
android:layout_below="@+id/num1" android:layout_below="@id/result"
android:hint="Enter Number 2" android:layout_toRightOf="@id/div"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="number" /> android:layout_marginLeft="10dp"
android:text="x"/>
<TextView </RelativeLayout>
android:id="@+id/result"
android:layout_below="@+id/num2" MainActivity.java
android:layout_width="match_parent" package in.msbte.calculator;
android:layout_height="wrap_content" import androidx.appcompat.app.AppCompatActivity;
android:layout_marginTop="20dp" import android.os.Bundle;
android:layout_marginBottom="20dp" import android.view.View;
android:text="Result" /> import android.widget.Button;
import android.widget.EditText;
<Button import android.widget.TextView;
android:id="@+id/sum" public class MainActivity extends AppCompatActivity {
android:layout_below="@id/result" public EditText e1, e2;
android:layout_width="wrap_content" Button add, sub , mul, div;
android:layout_height="wrap_content" TextView t1;
android:layout_marginLeft="10dp" int num1, num2;
android:text="+" /> @Override
protected void onCreate(Bundle savedInstanceState) {
<Button super.onCreate(savedInstanceState);
android:id="@+id/sub" setContentView(R.layout.activity_main);
android:layout_below="@id/result" e1 = (EditText) findViewById(R.id.num1);
android:layout_toRightOf="@id/sum" e2 = (EditText) findViewById(R.id.num2);
android:layout_width="wrap_content" t1 = (TextView) findViewById(R.id.result);
android:layout_height="wrap_content" add = (Button) findViewById(R.id.sum);
android:layout_marginLeft="10dp" mul = (Button) findViewById(R.id.mul);
android:text="-" /> div = (Button) findViewById(R.id.div);
sub = (Button) findViewById(R.id.sub);
<Button add.setOnClickListener(new View.OnClickListener() {
Page No: 39 | 41 Page No: 40 | 41
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
(Autonomous)
(ISO/IEC - 27001 - 2013 Certified)
__________________________________________________________________________________________________
@Override
public void onClick(View view) {
num1 = Integer.parseInt(e1.getText().toString());
num2 = Integer.parseInt(e2.getText().toString());
int sum = num1 + num2;
t1.setText(Integer.toString(sum));
}
});
sub.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
num1 = Integer.parseInt(e1.getText().toString());
num2 = Integer.parseInt(e2.getText().toString());
int sum = num1 - num2;
t1.setText(Integer.toString(sum));
}
});
mul.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
num1 = Integer.parseInt(e1.getText().toString());
num2 = Integer.parseInt(e2.getText().toString());
int sum = num1 * num2;
t1.setText(Integer.toString(sum));
}
});
div.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
num1 = Integer.parseInt(e1.getText().toString());
num2 = Integer.parseInt(e2.getText().toString());
int sum = num1 / num2;
t1.setText(Integer.toString(sum));
}
});
}
}

Page No: 41 | 41

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy