0% found this document useful (0 votes)
47 views

Value Added Course

The field of networking and communication includes analyzing, designing, implementing, and using local, wide-area, and mobile networks to connect computers together. Communication networks allow for the transmission of valuable information between users through various methods. Android provides APIs for performing networking tasks like making HTTP requests and accessing telephony functionality, while also including features like notifications, alarms, and memory management.

Uploaded by

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

Value Added Course

The field of networking and communication includes analyzing, designing, implementing, and using local, wide-area, and mobile networks to connect computers together. Communication networks allow for the transmission of valuable information between users through various methods. Android provides APIs for performing networking tasks like making HTTP requests and accessing telephony functionality, while also including features like notifications, alarms, and memory management.

Uploaded by

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

The field of networking and communication includes the analysis, design,

implementation, and use of local, wide-area, and mobile networks that link computers
together. The Internet itself is a network that makes it feasible for nearly all computers
in the world to communicate.
A communication Network is a collection of methods that users employ to pass
on valuable information. The communication network is the sum of all the means and
methods that an organization employs to communicate.

Communication via Network

Communication via web

To begin, synchronous and asynchronous are two types of online


communication. Synchronous communication occurs at the same time.
State Machine

A state machine reads a set of inputs and changes to a different state based on
those inputs. A state is a description of the status of a system waiting to execute a
transition. A transition function reads an input and determine the next state. A program
cannot be in two states at any given time.

Let’s start with an example: fetching data from an endpoint. The program can have 3
states: loading, success, and error.

A state machine also has a starting state, which coincidentally here is named “not
started” but you can name it anything you want. Here, the starting state indicates that
the API is not called yet.

State machine for network API call

When a user opens a screen, the screen begins fetching the data, so the state moves to
“loading”.
If the API call returns success/error, the state moves
to SUCCESS/ERROR respectively.

After that, if the user refreshes the screen, the state goes back to LOADING.

We could call the annotation “fetch”, “error”, “success”, “refresh” an event or input.
The transition function receives the current state and an input and determines the next
state.

Any meaningful program always has side-effects. These side-effects are the result of
transition from state A to B. For example, when the state changes
from NOT_STARTED to LOADING via the event fetch, the program shows progress
bar to the screen and fetches some data from the server.

Android Networking and web

Android lets your application connect to the internet or any other local network and
allows you to perform network operations. A device can have various types of network
connections.

Before you perform any network operations, you must first check that are you
connected to that network or internet etc. For this android
provides ConnectivityManager class. You need to instantiate an object of this class by
calling getSystemService() method.

Once you instantiate the object of ConnectivityManager class, you can


use getAllNetworkInfo method to get the information of all the networks.
After checking that you are connected to the internet, you can perform any network
operation. Here we are fetching the html of a website from a url.

Android provides HttpURLConnection and URL class to handle these operations. You
need to instantiate an object of URL class by providing the link of website. Its syntax is
as follows −

String link = "http://www.google.com"; URL url = new URL(link);

Telephony

The telephony system is a software framework to provide mobile phones with


telephony functionalities, such as voice call, Video call, SMS, MMS, data service,
network management and so on.

Architecture: Telephony framework for Android has four layered Architecture.

Communication processor (Wireless module drivers in Linux kernel)

RIL (Radio Interface Layer)

Android Telephony Services

High level telephony applications

Telephony Applications:
Dialer
Contacts
Messaging — SMS/MMS(BasicSmsReceiver)
Settings app — a) Airplane mode b) APN settings C)Network selection (auto/manual)
d) Call settings, such as, call waiting, call forwarding/diverting e) CLIR f)FDN
SIM Application Toolkit (SAT)
Browser
CellBroadcastReceiver
CarrierConfig
PhoneCommon

Scope of Mobile Application Development

Mobile application development continues to be a rapidly evolving field with a wide


range of opportunities. The scope for mobile application development can be
summarized as follows:

Platform Diversity: The two dominant mobile platforms are Android and iOS, each
with a significant user base. Developers can choose to specialize in one platform or
develop cross-platform applications using frameworks like React Native, Flutter, or
Xamarin.

Mobile apps span various categories such as social networking, e-commerce, gaming,
productivity, health and fitness, entertainment, education, travel, and more. Developers
can focus on a specific category or diversity their skill set across multiple types of
apps.
Wireless Connectivity

Wireless communications is the transmission of voice and data without cable or wires.
In place of a physical connection, data travels through electromagnetic signals
broadcast from sending facilities to intermediate and end-user devices. A wireless
network is a grouping, or network, of multiple devices where data is sent and received
over radio frequencies.

Mobile Application Development

Mobile application development is the process of creating software applications that


run on a mobile device, and a typical mobile application utilizes a network connection
to work with remote computing resources.
Android Telephony

Android Telephony framework provides us the functionalities of the mobile. It gives


us information about functionalities like calls, SMS, MMS, network, data services,
IMEI number, and so on.

Four Layers

Communication Processor

It is an input/output processor to distribute and collect data from a number of remote


terminals. It is a specialized processor designed to communicate with the data
communication network.

Radio Interface Layer

It is a bridge between the hardware and Android phone framework services. Rather we
say, it is a protocol stack for Telephone. It has two main components that are:
RIL Daemon– It starts when the android system starts. It reads the system properties
to find a library that is to be used for Vendor RIL.

Vendor RIL– It is also known as RIL Driver. It can be understood as a library that is
specific to each modem

Framework Services

The telephony Framework starts and initializes along with the system. All the queries
by Application API are directed to RIL using these services.

Application

These are the Application UI related to telephony such as Dialler, SMS, MMS, Call
tracker, etc. These applications start with the android system boot up. These are tied
with framework services of telephony.

Notification

A notification is a message that Android displays outside your app's UI to provide the
user with reminders, communication from other people, or other timely information
from your app. Users can tap the notification to open your app or take an action
directly from the notification.
Wear OS devices

If the user has a paired Wear OS device, all your notifications appear there
automatically, including expandable detail and action buttons.

You can enhance the experience by customizing the appearance of your notifications
on wearables and by providing different actions, including suggested replies and voice
input replies. For more information, see how to add wearable-specific features to your
notification.
Alarms
Alarms (based on the Alarm Manager class) give you a way to perform time-based
operations outside the lifetime of your application. alarm to initiate a long-running
operation, such as starting a service once a day to download a weather forecast.

Alarms have these characteristics:

They let you fire Intents at set times and/or intervals.

You can use them in conjunction with broadcast receivers to schedule jobs or Work
Requests to perform other operations.

They operate outside of your application, so you can use them to trigger events or
actions even when your app is not running, and even if the device itself is asleep.

They help you minimize your app's resource requirements. You can schedule
operations without relying on timers or continuously running services.

Memory Management
Android memory management is a process that ensures that an Android device runs
smoothly and efficiently by managing the allocation and release of memory resources.

Memory Allocation: Android uses a heap-based memory allocation model, where


each app is allocated its own heap space. The Android runtime (ART) manages the
allocation of memory and ensures that each app has access to the memory it needs.

Garbage Collection: Garbage Collection is an automatic process that frees up memory


that is no longer being used by an app. When an object is no longer needed, the
garbage collector identifies and removes it from the memory space.

Memory Leaks: Memory leaks occur when an app retains memory even when it is no
longer needed. This can cause performance issues and eventually lead to an app crash.
To prevent memory leaks, developers should ensure that all objects and resources are
properly released when they are no longer needed. This can lead to an increase in
memory usage and potentially cause your application to crash. Here are a few ways to
prevent memory leaks in your Android application.

Android Notification

Android Notification provides short, timely information about the action happened in
the application, even it is not running. The notification displays the icon, title and
some amount of the content text.
The properties of Android notification are set
using NotificationCompat.Builder object. Some of the notification properties are
mention below:

etSmallIcon(): It sets the icon of notification.


setContentTitle(): It is used to set the title of notification.
setContentText(): It is used to set the text message.
setAutoCancel(): It sets the cancelable property of notification.
setPriority(): It sets the priority of notification.

Android Alarm

Alarms in Android have the following characteristics: Alarms let you send intents at
set times or intervals. You can use alarms with broadcast receivers to start services
and perform other operations.

Scheduling an alarm

The AlarmManager class gives you access to the Android system alarm
services. AlarmManager lets you broadcast an Intent at a scheduled time, or after a
specific interval.

To schedule an alarm:
Call getSystemService(ALARM_SERVICE) to get an instance of
the AlarmManager class.

Use one of the set...() methods available in AlarmManager (as described below).
Which method you use depends on whether the alarm is elapsed real time, or RTC.

Canceling of Alarm

To cancel an alarm, use cancel() and pass in the PendingIntent. For example:
alarmManager.cancel(alarmIntent);

You might also like