Sumago VT
Sumago VT
Sumago VT
Upon completing this aspect of the course, students should demonstrate proficiency in developing basic
Android applications. This includes understanding the fundamentals of Android development such as
user interface design, activity lifecycle management, handling user input, and integrating various
features like sensors, cameras, and location services into their applications. They should be able to
utilize common development tools and frameworks like Android Studio and Java/Kotlin programming
languages to build functional and user-friendly mobile applications for the Android platform.
Additionally, students should be capable of debugging and testing their applications to ensure proper
functionality and usability.
This segment of the course aims to equip students with a foundational understanding of machine
learning concepts and techniques. By the end of this part, students should be familiar with the principles
of supervised and unsupervised learning, regression, classification, clustering, and feature engineering.
They should be able to implement basic machine learning algorithms and models using libraries such as
scikit-learn or TensorFlow. Furthermore, students should grasp the importance of data preprocessing,
model evaluation, and tuning parameters for optimal performance. Through practical exercises and
projects, they should develop the skills necessary to apply machine learning methods to real-world
problems effectively.
In this component, students will gain a solid grounding in statistical and mathematical concepts essential
for data analysis and machine learning. Upon completion, students should demonstrate proficiency in
topics such as probability theory, linear algebra, calculus, and statistics. They should understand how
these mathematical principles underpin various machine learning algorithms and techniques, enabling
them to interpret and analyze data effectively. Moreover, students should be able to apply statistical
methods for hypothesis testing, inference, and data visualization. This knowledge forms the basis for
making informed decisions and deriving meaningful insights from data in both academic and
professional settings.
3
3. ANDROID
Android is a software package and linux based operating system for mobile devices such as tablet
computers and smartphones.
It is developed by Google and later the OHA (Open Handset Alliance). Java language is mainly used to
write the android code even though other languages can be used.
The goal of android project is to create a successful real-world product that improves the mobile
experience for end users.
Application Layer –
Applications is the top layer of android architecture. The pre-installed applications like home,
contacts, camera, gallery etc and third party applications downloaded from the play store like chat
applications, games etc. will be installed on this layer only. It runs within the Android run time with
the help of the classes and services provided by the application framework.
a)Application Runtime –
Android Runtime environment is one of the most important part of Android. It contains components
like core libraries and the Dalvik virtual machine(DVM). Mainly, it provides the base for the
application framework and powers our application with the help of the core libraries. Like Java
Virtual Machine (JVM), Dalvik Virtual Machine (DVM) is a register-based virtual machine and
specially designed and optimized for android to ensure that a device can run multiple instances
efficiently. It depends on the layer Linux kernel for threading and low-level memory management.
The core libraries enable us to implement android applications using the standard JAVA or Kotlin
programming languages.
b) Platform libraries –
The Platform Libraries includes various C/C++ core libraries and Java based libraries such as Media,
Graphics, Surface Manager, OpenGL etc. to provide a support for android development.
Media library provides support to play and record an audio and video formats.
Surface manager responsible for managing access to the display subsystem.
SGL and OpenGL both cross-language, cross-platform application program interface
(API) are used for 2D and 3D computer graphics.
SQLite provides database support and FreeType provides font support.
Web-Kit This open source web browser engine provides all the functionality to display
web content and to simplify page loading.
5
SSL (Secure Sockets Layer) is security technology to establish an encrypted link between
a web server and a web browser.
Security: The Linux kernel handles the security between the application and the system.
Memory Management: It efficiently handles the memory management thereby providing
the freedom to develop our apps.
Process Management: It manages the process well, allocates resources to processes
whenever they need them.
Network Stack: It effectively handles the network communication.
Driver Model: It ensures that the application works properly on the device and hardware
manufacturers responsible for building their drivers into the Linux build.
It is open-source.
There are a lot of mobile applications that can be chosen by the consumer.
It provides many interesting features like weather details, opening screen, live RSS (Really
Simple Syndication) feeds etc.
It provides support for messaging services (SMS and MMS), web browser, storage (SQLite),
connectivity (GSM, CDMA, Blue Tooth, Wi-Fi etc.), media, handset layout etc.
Layouts basically refers to the arrangement of widgets on the screen of an android application or
activity screen.
6
A layout defines the structure for a user interface in your app, such as in an activity. All elements
in the layout are built using a hierarchy of View and ViewGroup objects. A View usually draws
something the user can see and interact with. A ViewGroup is an invisible container that defines
the layout structure for View and other ViewGroup objects, as shown in figure.
View objects are often called widgets and can be one of many subclasses, such as Button or TextView.
The ViewGroup objects are usually called layouts and can be one of many types that provide a different
layout structure, such as LinearLayout or ConstraintLayout.
View – The basic building block for UI is a view object which is created from the View class and
occupies rectangular area on screen. A view is defined as UI which is used to create interactive UI
components such as TextView, ImageView, EditText, or even a Button. View is super class of all
graphical UI components.
1. Constraint Layout : It is the default layout in Android that gives adaptable and flexible ways to
create views of your app. ConstraintLayout is a ViewGroup subclass, used to specify the position of
layout constraints for every child View relative to other views present. A ConstraintLayout is similar
to a RelativeLayout, but having more power.
2. Linear Layout : It is used to provide child View elements one by one in a particular direction either
horizontally or vertically based on the orientation property. Organizes its children into a single
horizontal or vertical row and creates a scrollbar if the length of the window exceeds the length of the
screen.
7
3. Absolute Layout : It allows you to specify the exact location i.e. x and y coordinates of elements
w.r.t. origin at top left corner of layout.
4. Grid Layout : It is used to display elements and views in the form of rectangular grid, so we can
specify numbers of rows and columns that grid will have. GridView is a ViewGroup that displays items
in a two-dimensional, scrollable grid.
5. Table Layout : TableLayout is a ViewGroup subclass. It is used to display child view elements in
rows and columns. TableLayout containers do not display row, column, and cell border lines. The table
will have the same number of columns as the row with the most cells. A table can leave cells vacant.
6. Relative Layout : It is used to specify the position of child view elements relative to each other like
(A to the right of B) or relative to the parent (fix to the top of the parent). RelativeLayout is a view
group that places its child views relative to one another.
3.4.1Layout Attributes
Each layout has a set of attributes which define the visual properties of that layout. There are few
common attributes among all the layouts and their are other attributes which are specific to that layout.
Following are common attributes and will be applied to all the layouts:
You can specify width and height with exact measurements but more often, you will use one of these
constants to set the width or height −
3.5Event Listeners
Event Listeners − An event listener is an interface in the View class that contains a single
callback method. These methods will be called by the Android framework when the View to
which the listener has been registered is triggered by user interaction with the item in the UI.
Event Listeners Registration − Event Registration is the process by which an Event Handler
gets registered with an Event Listener so that the handler is called when the Event Listener fires
the event.
Event Handlers − When an event happens and we have registered an event listener for the
event, the event listener calls the Event Handlers, which is the method that actually handles the
event.
Any View (Button, TextView, etc) has many event listeners that can be attached using
the setOnEvent pattern which involves passing a class that implements a particular event interface. The
listeners available to any View include:
3.6View:
View Class are the basic building block for user interface components. View occupies a 2-dimensional
area (say: rectangle) on the screen, which is responsible for framing and handling different type of
events.
3.6.1Types of View:
Text View:
This class is used to display text on the android application screen. It also allows user to optionally edit
it. Although it contains text editing operations, the basic class does not allow editing, So Edit Text class
is included to do so.
Edit Text:
This class makes text to be editable in Android application. It helps in building the data interface taken
from any user, also contains certain features through which we can hide the data which are confidential.
EditText is a widget of User Interface used to retrieve and modify text data from user in Android app.
You can use various input types like text, number, and password, and set various properties to control
the text, like limiting the number of characters or allowing only numbers.
Image view:
Image view helps to display images in an android application. Any image can be selected, we just have
to paste our image in a drawable folder from where we can access it. You can manipulate images in
ImageView, such as resizing them or changing their aspect ratio.
Check Box:
Checkbox is used in that applications where we have to select one option from multiple provided.
Checkbox is mainly used when 2 or more options are present. All check boxes have
the checked property set to false initially.
10
Radio Button:
Radio button is like checkbox, but there is slight difference between them. Radio button is a two-states
button that can be either checked or unchecked. In this type of Button we can only select the one option
at a time. This makes them perfect for choices like selecting a payment method or choosing a shipping
option.
Button View:
This class is used to create a button on an application screen. Buttons are very helpful in getting into a
content. Android button represents a clickable push-button widget, that can be clicked or pressed by the
user to perform an action.
Image button is a button but it carries an image on it. We can put an image or a certain text on it and
when we click it provides the operations assigned to it. ImageButton is used to use an image as a button
in your android application.
Android Toast can be used to display information for the short period of time. A toast contains message
to be displayed quickly and disappears after sometime.
Toast class is used to show notification for a particular interval of time. After sometime it disappears. It
doesn't block the user interaction.
There are only 2 constants of Toast class which are given below.
1. public static final int LENGTH_LONG : displays view for the long duration of time.
2. public static final int LENGTH_SHORT : displays view for the short duration of time.
1. public static Toast makeText(Context context, CharSequence text, int duration) : makes the
toast containing text and duration.
3.7.2Android ProgressBar:
We can display the android progress bar dialog box to display the status of work being done e.g.
downloading file, analyzing status of work etc.
Android ProgressBar is a graphical view indicator that shows some progress. Android progress bar
displays a bar representing the completing of the task. Progress bar in android is useful since it gives the
user an idea of time to finish its task.
The ProgressDialog class provides methods to work on progress bar like setProgress(), setMessage(),
setProgressStyle(), setMax(), show() etc. The progress range of Progress Dialog is 0 to 10000.
13
3.7.3DatePicker in Android
DatePicker dialog is seen used in many android applications where we have to select the date. This
widget is mostly seen in the hotel reservation applications for travel booking applications. With
the help of this widget, we can simply pick the date from the DatePicker dialog.
Android Date Picker allows you to select the date consisting of day, month and year in your
custom user interface. For this functionality android provides DatePicker and DatePickerDialog
components.
You can use the following methods of the DatePicker to perform further operation :
Fig 3.5Callender
An activity in android is a specific combination of XML files and Java files. Activity serves as the
entry point for an app’s interaction with the user.
Generally, one activity implements one screen in an app. By the help of activity, you can place all
(User Interface) UI components or widgets in a single screen.
1. If an activity is in the foreground of the screen i.e at the top of the stack, then it is said to
be active or running. This is usually the activity that the user is currently interacting with.
2. If an activity has lost focus and a non-full-sized or transparent activity has focused on top
of your activity. In such a case either another activity has a higher position in multi-
window mode or the activity itself is not focusable in the current window mode. Such
activity is completely alive.
15
For each stage, android provides us with a set of 7 methods that have their own significance for each
stage in the life cycle. The image shows a path of migration whenever an app switches from one state
to another.
1. onCreate()
It is called when the activity is first created. This is where all the static work is done like creating
views, binding data to lists, etc. This method also provides a Bundle containing its previous frozen
state, if there was one.
16
2. onStart()
It is invoked when the activity is visible to the user. It is followed by onResume() if the activity is
invoked from the background. It is also invoked after onCreate() when the activity is first started.
3. onResume()
It is invoked when the activity starts interacting with the user. At this point, the activity is at the top of
the activity stack, with a user interacting with it. Always followed by onPause() when the activity
goes into the background or is closed by the user.
4. onPause()
It is invoked when an activity is going into the background but has not yet been killed. It is a
counterpart to onResume(). When an activity is launched in front of another activity, this callback will
be invoked on the top activity (currently on screen). The activity, under the active activity, will not be
created until the active activity’s onPause() returns, so it is recommended that heavy processing
should not be done in this part.
5. onStop()
It is invoked when the activity is not visible to the user. It is followed by onRestart() when the activity
is revoked from the background, followed by onDestroy() when the activity is closed or finished, and
nothing when the activity remains on the background only.
6. onDestroy()
The final call received before the activity is destroyed. This can happen either because the activity is
finishing (when finish() is invoked) or because the system is temporarily destroying this instance of
the activity to save space. To distinguish between these scenarios, check it with isFinishing() method.
3.8.1AutoCompleteTextView in Android
The AutoCompleteTextView is a type of edit text in android which gives suggestions to the user if
the user types something in the AutoCompleteTextView. This type of edit text we can see while
we register on some websites. If we type “In” it will suggest India, Indonesia, West Indies …..etc.
Like this, the AutoCompleteTextView works.
Android Time Picker allows you to select the time of day in either 24 hour or AM/PM mode. The time
consists of hours, minutes and clock format. Android provides this functionality through TimePicker
class.
TimePicker Dialog is used in many applications where we have to book appointments based on a
specific time. This widget is seen in the applications where we have to select specific time slots. In
this article, we will take a look at How to use TimePicker Dialog on Android.
Methods of TimePicker:
1. is24HourView() - This method returns true if this is in 24 hour view else false
2. isEnabled() - This method returns the enabled status for this view
3. setCurrentHour(Integer currentHour) - This method sets the current hour
4. setCurrentMinute(Integer currentMinute) - This method sets the current minute
5. setEnabled(boolean enabled) - This method set the enabled state of this view
6. setIs24HourView(Boolean is24HourView) - This method set whether in 24 hour or AM/PM mode
7. setOnTimeChangedListener(TimePicker.OnTimeChangedListener onTimeChangedListener) - This
method Set the callback that indicates the time has been adjusted by the user
18
Fig 3.8clock
3.9Intent in Android
In Android, it is quite usual for users to witness a jump from one application to another as a part of the
whole process, for example, searching for a location on the browser and witnessing a direct jump into
Google Maps or receiving payment links in Messages Application (SMS) and on clicking jumping to
PayPal or GPay (Google Pay). This process of taking users from one application to another is
achieved by passing the Intent to the system. Intents, in general, are used for navigating among
various activities within the same application, but note, is not limited to one single application, i.e.,
they can be utilized from moving from one application to another as well.
Intents could be Implicit, for instance, calling intended actions, and explicit as well, such as opening
another activity after some operations like onClick or anything else.
1. Implicit Intent
Implicit Intent doesn’t specify the component. In such a case, intent provides information on available
components provided by the system that is to be invoked.
Syntax:
Intent intent=new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://www.geeksforgeeks.org/"));
startActivity(intent);
2. Explicit Intent
Explicit Intent specifies the component. In such a case, intent provides the external class to be
invoked.
Syntax:
Intent i = new Intent(getApplicationContext(), ActivityTwo.class);
startActivity(i);
Steps of Intent:
1. Define an Intent :
Create an instance of intent class, specifying source and destination components involved. You
can set the destination activity either by using class name or by using an action string in the
destination activity’s manifest.
3.10Android Bluetooth :
Among many ways, Bluetooth is a way to send or receive data between two different devices. Android
platform includes support for the Bluetooth framework that allows a device to wirelessly exchange data
with other Bluetooth devices.
By using android Bluetooth API’s in android applications, we can perform the following functionalities.
In android, we can perform Bluetooth related activities by using BluetoothAdapter class in our
applications.
21
Android provides BluetoothAdapter class to communicate with Bluetooth. Create an object of this
calling by calling the static method getDefaultAdapter(). Its syntax is given below.
o String ACTION_REQUEST_ENABLE
o String ACTION_REQUEST_DISCOVERABLE
o String ACTION_DISCOVERY_STARTED
o String ACTION_DISCOVERY_FINISHED
o int getState() returns the current state of the local bluetooth adapter.
3,10.2Camera in Android :
Camera is mainly used to capture picture and video. We can control the camera by using methods of
camera api. In android, Camera is useful to capture the photos and videos in our applications. By using
camera API we can control the functionalities of camera based on our requirements.
22
The android framework provides a two ways such as android.hardware.camera2 API and
camera intent to capture the images and videos in our application.
1. By Camera Intent
2. By Camera API
1. Intent
By the help of 2 constants of MediaStore class, we can capture picture and video without using the
instance of Camera class.
1. ACTION_IMAGE_CAPTURE
2. ACTION_VIDEO_CAPTURE
2. Camera
It is main class of camera api, that can be used to take picture and video.
3. SurfaceView
4. MediaRecorder
It is used to record video using camera. It can also be used to record audio files as we have seen in the
previous example of media framework.
SMSManager class manages operations like sending a text message, data message, and multimedia
messages (MMS). For sending a text message method sendTextMessage() is used likewise for
23
4.Machine learning
import pandas as pd
df=pd.read_csv('/content/drive/MyDrive/Kaggle/GlobalYouTubeStatistics.csv' ,encoding='latin1')
df
4.2.3Data Cleaning
df = df.drop_duplicates()
df
26
From this we can say that there is no duplicate record in this dataset.
df.dropna()
df
This head() function will give the 1st 5 records of the dataset.
df.info()
27
Using describe() function we can calculate the summary statistics for numerical columns.
df.describe()
28
4.5 Visualization:
plt.figure(figsize=(12, 6))
sns.countplot(data=df,x='category',order=df['category'].value_counts().index,palete ='viridis')
plt.title('Distribution of Channel Categories')
plt.xlabel('Category')
plt.ylabel('Count')
plt.xticks(rotation=90)
plt.show()
29
plt.figure(figsize=(10, 6))
sns.scatterplot(data=df, x='subscribers', y='video views', hue='category', palette='Set1', alpha=0.6)
plt.title('Subscribers vs. Video Views')
plt.xlabel('Subscribers')
plt.ylabel('Video Views')
plt.show()
plt.figure(figsize=(10, 6))
sns.boxplot(data=df, x='channel_type', y='lowest_monthly_earnings', palette='Set2')
plt.title('Earnings Distribution by Channel Type')
plt.xlabel('Channel Type')
plt.ylabel('Lowest Monthly Earnings')
plt.xticks(rotation=45)
plt.show()
30
plt.figure(figsize=(12, 8))
sns.scatterplot(data=df, x='Longitude', y='Latitude', hue='subscribers', size='video views', sizes=(20,
200), palette='viridis')
plt.title('Geospatial Distribution of YouTubers')
plt.xlabel('Longitude')
plt.ylabel('Latitude')
plt.show()
4.6 Questionnaires
18
By identifying the top 10 YouTubers with the highest subscriber counts, you gain insight into the
most influential and followed channels on the platform. These channels likely have a significant impact
on trends and content consumption habits. Content creators can learn from their strategies, while
advertisers can target their large, engaged audiences.
Q.2 Is there a correlation between the number of subscribers and video views?
Code:
A positive correlation between subscribers and video views implies that as a channel's
subscriber count increases, so does its video view count. This suggests that subscribers are more likely
to watch content regularly, contributing to higher views. Content creators can focus on building a loyal
subscriber base to boost their video views and engagement.
Q.3 What is the average monthly earnings for different channel types?
Code:
32
The average monthly earnings for different channel types help content creators set realistic
income expectations. For example, gaming channels may generate different revenue compared to
educational channels. Understanding these disparities can guide creators in choosing channel types that
align with their financial goals.
Q.4 Where are the most successful YouTubers located (by latitude and longitude)?
Code:
33
Q.5 What is the relationship between the number of subscribers and the population of a country?
Code:
The correlation analysis between subscribers and a country's population size reveals whether
larger populations tend to produce more YouTubers. A positive correlation suggests that densely
populated countries have a higher number of content creators. This insight can guide content creators
and advertisers in understanding the size and potential of target audiences in different regions.
34
---------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
--------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
---------------------------------------------------------------------------------------------
Architecture of Android
Features of android
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
---------------------------------------------------------------------------------------------
Installation of Android
---------------------------------------------------------------------------------------------
Layer of android
Layout in android
Type of layout
---------------------------------------------------------------------------------------------
First application
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
---------------------------------------------------------------------------------------------
Event Listener
Edit text
Views
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
---------------------------------------------------------------------------------------------
Buttons
Check box
Radio button
Image button
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
---------------------------------------------------------------------------------------------
Method
Date picker
----------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
---------------------------------------------------------------------------------------------
Timepicker
Activities in Android
---------------------------------------------------------------------------------------------
Text view
Autocompplete text view
-------------------------------------------------------------------------------------------------
Progress Message
Toast Messages
-------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
------------------------------------------------------------------------------------------------
Implicit intent
Explicit intent
-------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
------------------------------------------------------------------------------------------------
Android Bluetooth
-------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
------------------------------------------------------------------------------------------------
Messages manager
-------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
------------------------------------------------------------------------------------------------
Python Basics
-------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
------------------------------------------------------------------------------------------------
Statistics
Task for statistics
-------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
------------------------------------------------------------------------------------------------
NumPy libraries
Pandas Libraries
-------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
------------------------------------------------------------------------------------------------
Matplotlib
-------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
------------------------------------------------------------------------------------------------
Dataset
Importing Dataset
-------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
------------------------------------------------------------------------------------------------
K means
KNN
-------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
------------------------------------------------------------------------------------------------
Logistic Regression
Titanic survey
-------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
OBSERVATIONS OF THE DAY
------------------------------------------------------------------------------------------------
Project work of Android
Project work of Machine Learning.
-------------------------------------------------------------------------------------------------
6. Conclusion
58
7. References