SlideShare a Scribd company logo
1 of 25
BROADCAST RECEIVER
CONFIDENTIAL INFORMATION
This document is confidential and proprietary information
of Target Soft Systems. Confidential Information includes,
but is not limited to, the following:
Corporate, Employee and Infrastructure Information about
Target Soft Systems.
Target Soft Systems implementation , Training
methodology, cost, project management and quality
processes.
Any disclosure of Confidential Information to, or use of it
by a third party (i.e., a party other than authorised , will be
damaging to Target Soft Systems). Ownership of all
Confidential Information, no matter in what media it
resides, remains with Target Soft Systems( TSS ).
Confidential Information in this document shall not be
disclosed outside the buyer’s proposal evaluators and shall
not be duplicated, used, or disclosed – in whole or in part –
for any purpose other than to evaluate this proposal without
specific written permission of an authorized representative
of Target Soft Systems.
Broadcast Receiver
• Broadcast Receivers simply respond to broadcast messages from
other applications or from the system itself.
• These messages are sometime called events or intents.
• For example, applications can also initiate broadcasts to let other
applications know that some data has been downloaded to the device
and is available for them to use, so this is broadcast receiver who
will intercept this communication and will initiate appropriate
action.
• There are following two important steps to make BroadcastReceiver
works for the system broadcasted intents.
< Creating the Broadcast Receiver.
< Registering Broadcast Receiver
Creating the Broadcast Receiver:
A broadcast receiver is implemented as a subclass of
BroadcastReceiver class and overriding the onReceive() method where
each message is received as a Intent object parameter.
public class MyReceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent
intent)
{
Toast.makeText(context, "Intent Detected.",
Toast.LENGTH_LONG).show();
}
}
Registering Broadcast Receiver:
An application listens for specific broadcast intents by registering a
broadcast receiver inAndroidManifest.xml file.
•Consider we are going to register MyReceiver for system generated
event ACTION_BOOT_COMPLETED which is fired by the system
once the Android system has completed the boot process.
<receiver android:name="MyReceiver">
<intent-filter>
<action
android:name="android.intent.action.BOOT_COMPLETED">
</action>
</intent-filter>
</receiver>
• An Intent-based publish-
subscribe mechanism.
• Great for listening system
events such as SMS
messages.
• An Intent-based publish-
subscribe mechanism.
• Great for listening system
events such as SMS
messages.
Android
System
Android
System
Broadcast
Receiver
Broadcast
Receiver
1.Register
for
Broadcast
Intent
1.Register
for
Broadcast
Intent
2.OnReceive()2.OnReceive()
STORAGE FEATURE
Internal Storage
Internal Storage
• Android provides many kinds of storage for applications to
store their data.
• These storage places are shared preferences , internal and
external storage , SQLite storage , and storage via network
connection.
• Internal storage is the storage of the private data on the device
memory.
• By default these files are private and are accessed by only
your application and get deleted , when user delete your
application.
• Internal Storage are private to your application and other
applications cannot access them(nor can the user). When the
user uninstalls your application, these files are removed.
How to Use Internal Storage?
• To create and write a private file to the internal
storage:
> Call openFileOutput() with the name of the file and the
operating mode. This returns a FileOutputStream object
> Write to the file with write().
> Close the stream with close().
• To read a file from internal storage
> Call openFileInput() and pass it the name of the file to read.
This returns a FileInputStream.
> Read bytes from the file with read().
> Then close the stream with close().
Other Useful Methods
• getFilesDir()
> Gets the absolute path to the filesystem directory
where your internal files are saved.
• getDir()
> Creates (or opens an existing) directory within your
internal storage space.
• deleteFile()
> Deletes a file saved on the internal storage.
• fileList()
> Returns an array of files currently saved by your
application.
External Storage
External Storage
• Store public data on storage media, like SD cards.
• Like Internal storage, we are able to save or read from the device external
storage such as sdcard.
• FileInputStream and FileOutputStream classes are used to read and write
data into the file.
• External storage such as SD card can also store application data, there’s no
security enforced upon files you save to the external storage.
• All applications can read and write files placed on the external storage and
the user can remove them.
• Files saved to the external storage are world- readable and can be
modified by the user when they enable USB mass storage to transfer files
on a computer.
Checking Media Availability
• Before you do any work with the external storage,
you should always call getExternalStorageState() to
check the state of the media
> Mounted
> Missing
> Read-only
> Some other state
Writing file
• In order to use internal storage to write some data in the file,
call the openFileOutput() method with the name of the file
and the mode. The mode could be private , public e.t.c
• FileOutputStream fOut = openFileOutput("file name
here",MODE_WORLD_READABLE);
• The method openFileOutput() returns an instance of
FileOutputStream. So you recieve it in the object of
FileInputStream. After that you can call write method to write
data on the file.
• String str = "data";
fOut.write(str.getBytes());
fOut.close();
Reading file
• In order to read from the file you just created , call the
openFileInput() method with the name of the file. It returns an
instance of FileInputStream.
• FileInputStream fin = openFileInput(file);
• After that, you can callr read method to read one character at a
time from the file and then you can print it.
• int c;
String temp="";
while( (c = fin.read()) != -1) {
temp = temp + Character.toString((char)c);
} //string temp contains all the data of the file.
fin.close();
Internal Vs. External Storage
• Internal storage is the storage of the private data on the device
memory
• External storage is not private and may not always be
available. If for example the android device is connected with a
computer, the computer may mount the external system via
USB and that makes this external storage not available for
android applications.
BLUETOOTH
Bluetooth
Bluetooth is a way to exchange data with other devices
wirelessly. Android provides Bluetooth API to perform
several tasks such as:
•scan bluetooth devices
•connect and transfer data from and to other devices
•manage multiple connections etc.
By the help of BluetoothAdapter class, we can
perform fundamental tasks such as initiate device
discovery, query a list of paired (bonded) devices, create a
BluetoothServerSocket instance to listen for connection
requests etc.
Constants of Bluetooth Adapter class
Bluetooth Adapter class provides many
constants. Some of them are as follows:
String ACTION_REQUEST_ENABLE
String ACTION_REQUEST_DISCOVERABLE
String ACTION_DISCOVERY_STARTED
String ACTION_DISCOVERY_FINISHED
Methods of Bluetooth Adapter class
Commonly used methods of Bluetooth Adapter class
are as follows:
static synchronized BluetoothAdapter
getDefaultAdapter() returns the instance of BluetoothAdapter.
boolean enable() enables the bluetooth adapter if it is disabled.
boolean isEnabled() returns true if the bluetooth adapter is
enabled.
boolean disable() disables the bluetooth adapter if it is enabled.
String getName() returns the name of the bluetooth adapter.
boolean setName(String name) changes the bluetooth name.
int getState() returns the current state of the local bluetooth
adapter.
Set<BluetoothDevice> getBondedDevices() returns a set of
paired (bonded) BluetoothDevice objects.
boolean startDiscovery() starts the discovery process.
• 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.
private BluetoothAdapter BA;
BA = BluetoothAdapter.getDefaultAdapter();
• In order to enable the Bluetooth of your device, call the
intent with the following Bluetooth constant
ACTION_REQUEST_ENABLE. Its syntax is.
Intent turnOn = new
Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(turnOn, 0);
 Now select Turn
On to turn on the
bluetooth
 Now just select the
Get Visible button to
turn on your
visibiltiy
 Select your mobile
device as an option
and then check your
mobile device which
will display following
screen:
 Now just select the List
Devices option. It will list
down the paired devices in
the list view
 Now just select the Turn
off button to switch off
the Bluetooth
THANK YOU

More Related Content

What's hot

Lecture14Slides.ppt
Lecture14Slides.pptLecture14Slides.ppt
Lecture14Slides.pptVideoguy
 
Android contentprovider
Android contentproviderAndroid contentprovider
Android contentproviderKrazy Koder
 
Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)Pinaki Poddar
 
Techniques for Cross Platform .NET Development
Techniques for Cross Platform .NET DevelopmentTechniques for Cross Platform .NET Development
Techniques for Cross Platform .NET DevelopmentJeremy Hutchinson
 

What's hot (8)

Lecture14Slides.ppt
Lecture14Slides.pptLecture14Slides.ppt
Lecture14Slides.ppt
 
Android contentprovider
Android contentproviderAndroid contentprovider
Android contentprovider
 
Java
JavaJava
Java
 
Android Insights - 3 [Content Providers]
Android Insights - 3 [Content Providers]Android Insights - 3 [Content Providers]
Android Insights - 3 [Content Providers]
 
Android - Saving data
Android - Saving dataAndroid - Saving data
Android - Saving data
 
Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)
 
Backendless apps
Backendless appsBackendless apps
Backendless apps
 
Techniques for Cross Platform .NET Development
Techniques for Cross Platform .NET DevelopmentTechniques for Cross Platform .NET Development
Techniques for Cross Platform .NET Development
 

Viewers also liked (12)

Prava15
Prava15Prava15
Prava15
 
Diagrama de dotacion de pnal
Diagrama de dotacion de pnalDiagrama de dotacion de pnal
Diagrama de dotacion de pnal
 
A specially designed training course for ISO 14001
A specially designed training course for ISO 14001A specially designed training course for ISO 14001
A specially designed training course for ISO 14001
 
Night light: Coadyuvante en el tratamiento de adelgazamiento
Night light: Coadyuvante en el tratamiento de adelgazamientoNight light: Coadyuvante en el tratamiento de adelgazamiento
Night light: Coadyuvante en el tratamiento de adelgazamiento
 
Drama titas
Drama titasDrama titas
Drama titas
 
Lps y mw
Lps y mwLps y mw
Lps y mw
 
Governo geral da congregação
Governo geral da congregaçãoGoverno geral da congregação
Governo geral da congregação
 
IADC HSE Amsterdam 2008 Live Auditing System
IADC HSE Amsterdam 2008 Live Auditing SystemIADC HSE Amsterdam 2008 Live Auditing System
IADC HSE Amsterdam 2008 Live Auditing System
 
Clase 26 de enero de 2016 CCI UNU
Clase 26 de enero de 2016 CCI UNUClase 26 de enero de 2016 CCI UNU
Clase 26 de enero de 2016 CCI UNU
 
Redes
RedesRedes
Redes
 
Ways to maintain sound and high standards of pilotage organizations in our re...
Ways to maintain sound and high standards of pilotage organizations in our re...Ways to maintain sound and high standards of pilotage organizations in our re...
Ways to maintain sound and high standards of pilotage organizations in our re...
 
Presentation on Management review by Mr. Bruno Dockx
Presentation on Management review by Mr. Bruno DockxPresentation on Management review by Mr. Bruno Dockx
Presentation on Management review by Mr. Bruno Dockx
 

Similar to Level 4

Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debuggingUtkarsh Mankad
 
Android datastorage
Android datastorageAndroid datastorage
Android datastorageKrazy Koder
 
Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Khaled Anaqwa
 
Android session 4-behestee
Android session 4-behesteeAndroid session 4-behestee
Android session 4-behesteeHussain Behestee
 
Data Storage In Android
Data Storage In Android Data Storage In Android
Data Storage In Android Aakash Ugale
 
Android Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptxAndroid Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptxKNANTHINIMCA
 
Android Trainning Session 2
Android Trainning  Session 2Android Trainning  Session 2
Android Trainning Session 2Shanmugapriya D
 
C# and Borland StarTeam Connectivity
C# and Borland StarTeam ConnectivityC# and Borland StarTeam Connectivity
C# and Borland StarTeam ConnectivityShreesha Rao
 
Working with the IFS on System i
Working with the IFS on System iWorking with the IFS on System i
Working with the IFS on System iChuck Walker
 
Setting Up Sumo Logic - Apr 2017
Setting Up Sumo Logic - Apr 2017Setting Up Sumo Logic - Apr 2017
Setting Up Sumo Logic - Apr 2017Sumo Logic
 
Jsr75 sup
Jsr75 supJsr75 sup
Jsr75 supSMIJava
 
Data Transfer between Activities & Databases
Data Transfer between Activities & DatabasesData Transfer between Activities & Databases
Data Transfer between Activities & DatabasesMuhammad Sajid
 
File System Implementation & Linux Security
File System Implementation & Linux SecurityFile System Implementation & Linux Security
File System Implementation & Linux SecurityGeo Marian
 
Sumo Logic Cert Jam - Fundamentals
Sumo Logic Cert Jam - FundamentalsSumo Logic Cert Jam - Fundamentals
Sumo Logic Cert Jam - FundamentalsSumo Logic
 
Data Transfer between activities and Database
Data Transfer between activities and Database Data Transfer between activities and Database
Data Transfer between activities and Database faiz324545
 

Similar to Level 4 (20)

Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
 
Android datastorage
Android datastorageAndroid datastorage
Android datastorage
 
Android-data storage in android-chapter21
Android-data storage in android-chapter21Android-data storage in android-chapter21
Android-data storage in android-chapter21
 
Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)
 
Android session 4-behestee
Android session 4-behesteeAndroid session 4-behestee
Android session 4-behestee
 
Data Storage In Android
Data Storage In Android Data Storage In Android
Data Storage In Android
 
Android Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptxAndroid Application Components-BroadcastReceiver_Content Provider.pptx
Android Application Components-BroadcastReceiver_Content Provider.pptx
 
Android Trainning Session 2
Android Trainning  Session 2Android Trainning  Session 2
Android Trainning Session 2
 
C# and Borland StarTeam Connectivity
C# and Borland StarTeam ConnectivityC# and Borland StarTeam Connectivity
C# and Borland StarTeam Connectivity
 
Android Data Storagefinal
Android Data StoragefinalAndroid Data Storagefinal
Android Data Storagefinal
 
Storage 8
Storage   8Storage   8
Storage 8
 
Working with the IFS on System i
Working with the IFS on System iWorking with the IFS on System i
Working with the IFS on System i
 
Setting Up Sumo Logic - Apr 2017
Setting Up Sumo Logic - Apr 2017Setting Up Sumo Logic - Apr 2017
Setting Up Sumo Logic - Apr 2017
 
Jsr75 sup
Jsr75 supJsr75 sup
Jsr75 sup
 
Data Transfer between Activities & Databases
Data Transfer between Activities & DatabasesData Transfer between Activities & Databases
Data Transfer between Activities & Databases
 
File System Implementation & Linux Security
File System Implementation & Linux SecurityFile System Implementation & Linux Security
File System Implementation & Linux Security
 
6.C#
6.C# 6.C#
6.C#
 
Sumo Logic Cert Jam - Fundamentals
Sumo Logic Cert Jam - FundamentalsSumo Logic Cert Jam - Fundamentals
Sumo Logic Cert Jam - Fundamentals
 
Application Hosting
Application HostingApplication Hosting
Application Hosting
 
Data Transfer between activities and Database
Data Transfer between activities and Database Data Transfer between activities and Database
Data Transfer between activities and Database
 

More from skumartarget

SENSORS AND ITS DETAILS
SENSORS AND ITS DETAILSSENSORS AND ITS DETAILS
SENSORS AND ITS DETAILSskumartarget
 
INTRODUCTION TO RASPI
INTRODUCTION TO RASPIINTRODUCTION TO RASPI
INTRODUCTION TO RASPIskumartarget
 
Wsn in iot updated
Wsn in iot updatedWsn in iot updated
Wsn in iot updatedskumartarget
 
Ravi i ot-security
Ravi i ot-securityRavi i ot-security
Ravi i ot-securityskumartarget
 
Ravi i ot-enablingtechnologies
Ravi i ot-enablingtechnologiesRavi i ot-enablingtechnologies
Ravi i ot-enablingtechnologiesskumartarget
 
Ap plication &amp; research technologies.pptx
Ap plication &amp; research technologies.pptxAp plication &amp; research technologies.pptx
Ap plication &amp; research technologies.pptxskumartarget
 
Dr mgr chennai april 20th april
Dr mgr  chennai april 20th aprilDr mgr  chennai april 20th april
Dr mgr chennai april 20th aprilskumartarget
 

More from skumartarget (16)

SENSORS AND ITS DETAILS
SENSORS AND ITS DETAILSSENSORS AND ITS DETAILS
SENSORS AND ITS DETAILS
 
INTRODUCTION TO RASPI
INTRODUCTION TO RASPIINTRODUCTION TO RASPI
INTRODUCTION TO RASPI
 
Iot intro
Iot introIot intro
Iot intro
 
Wsn in iot updated
Wsn in iot updatedWsn in iot updated
Wsn in iot updated
 
Ravi i ot-security
Ravi i ot-securityRavi i ot-security
Ravi i ot-security
 
Ravi i ot-impact
Ravi i ot-impactRavi i ot-impact
Ravi i ot-impact
 
Ravi i ot-enablingtechnologies
Ravi i ot-enablingtechnologiesRavi i ot-enablingtechnologies
Ravi i ot-enablingtechnologies
 
Bigdata.pptx
Bigdata.pptxBigdata.pptx
Bigdata.pptx
 
Ap plication &amp; research technologies.pptx
Ap plication &amp; research technologies.pptxAp plication &amp; research technologies.pptx
Ap plication &amp; research technologies.pptx
 
Dr mgr chennai april 20th april
Dr mgr  chennai april 20th aprilDr mgr  chennai april 20th april
Dr mgr chennai april 20th april
 
WSN IN IOT
WSN IN IOTWSN IN IOT
WSN IN IOT
 
Cloudcomputing
CloudcomputingCloudcomputing
Cloudcomputing
 
Level 1
Level 1Level 1
Level 1
 
School updated
School updatedSchool updated
School updated
 
ABOUT TSS PPT
ABOUT TSS PPTABOUT TSS PPT
ABOUT TSS PPT
 
ANDROID FDP PPT
ANDROID FDP PPTANDROID FDP PPT
ANDROID FDP PPT
 

Recently uploaded

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 

Recently uploaded (20)

OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 

Level 4

  • 2. CONFIDENTIAL INFORMATION This document is confidential and proprietary information of Target Soft Systems. Confidential Information includes, but is not limited to, the following: Corporate, Employee and Infrastructure Information about Target Soft Systems. Target Soft Systems implementation , Training methodology, cost, project management and quality processes. Any disclosure of Confidential Information to, or use of it by a third party (i.e., a party other than authorised , will be damaging to Target Soft Systems). Ownership of all Confidential Information, no matter in what media it resides, remains with Target Soft Systems( TSS ). Confidential Information in this document shall not be disclosed outside the buyer’s proposal evaluators and shall not be duplicated, used, or disclosed – in whole or in part – for any purpose other than to evaluate this proposal without specific written permission of an authorized representative of Target Soft Systems.
  • 3. Broadcast Receiver • Broadcast Receivers simply respond to broadcast messages from other applications or from the system itself. • These messages are sometime called events or intents. • For example, applications can also initiate broadcasts to let other applications know that some data has been downloaded to the device and is available for them to use, so this is broadcast receiver who will intercept this communication and will initiate appropriate action. • There are following two important steps to make BroadcastReceiver works for the system broadcasted intents. < Creating the Broadcast Receiver. < Registering Broadcast Receiver
  • 4. Creating the Broadcast Receiver: A broadcast receiver is implemented as a subclass of BroadcastReceiver class and overriding the onReceive() method where each message is received as a Intent object parameter. public class MyReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Toast.makeText(context, "Intent Detected.", Toast.LENGTH_LONG).show(); } }
  • 5. Registering Broadcast Receiver: An application listens for specific broadcast intents by registering a broadcast receiver inAndroidManifest.xml file. •Consider we are going to register MyReceiver for system generated event ACTION_BOOT_COMPLETED which is fired by the system once the Android system has completed the boot process. <receiver android:name="MyReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"> </action> </intent-filter> </receiver>
  • 6. • An Intent-based publish- subscribe mechanism. • Great for listening system events such as SMS messages. • An Intent-based publish- subscribe mechanism. • Great for listening system events such as SMS messages. Android System Android System Broadcast Receiver Broadcast Receiver 1.Register for Broadcast Intent 1.Register for Broadcast Intent 2.OnReceive()2.OnReceive()
  • 9. Internal Storage • Android provides many kinds of storage for applications to store their data. • These storage places are shared preferences , internal and external storage , SQLite storage , and storage via network connection. • Internal storage is the storage of the private data on the device memory. • By default these files are private and are accessed by only your application and get deleted , when user delete your application. • Internal Storage are private to your application and other applications cannot access them(nor can the user). When the user uninstalls your application, these files are removed.
  • 10. How to Use Internal Storage? • To create and write a private file to the internal storage: > Call openFileOutput() with the name of the file and the operating mode. This returns a FileOutputStream object > Write to the file with write(). > Close the stream with close(). • To read a file from internal storage > Call openFileInput() and pass it the name of the file to read. This returns a FileInputStream. > Read bytes from the file with read(). > Then close the stream with close().
  • 11. Other Useful Methods • getFilesDir() > Gets the absolute path to the filesystem directory where your internal files are saved. • getDir() > Creates (or opens an existing) directory within your internal storage space. • deleteFile() > Deletes a file saved on the internal storage. • fileList() > Returns an array of files currently saved by your application.
  • 13. External Storage • Store public data on storage media, like SD cards. • Like Internal storage, we are able to save or read from the device external storage such as sdcard. • FileInputStream and FileOutputStream classes are used to read and write data into the file. • External storage such as SD card can also store application data, there’s no security enforced upon files you save to the external storage. • All applications can read and write files placed on the external storage and the user can remove them. • Files saved to the external storage are world- readable and can be modified by the user when they enable USB mass storage to transfer files on a computer.
  • 14. Checking Media Availability • Before you do any work with the external storage, you should always call getExternalStorageState() to check the state of the media > Mounted > Missing > Read-only > Some other state
  • 15. Writing file • In order to use internal storage to write some data in the file, call the openFileOutput() method with the name of the file and the mode. The mode could be private , public e.t.c • FileOutputStream fOut = openFileOutput("file name here",MODE_WORLD_READABLE); • The method openFileOutput() returns an instance of FileOutputStream. So you recieve it in the object of FileInputStream. After that you can call write method to write data on the file. • String str = "data"; fOut.write(str.getBytes()); fOut.close();
  • 16. Reading file • In order to read from the file you just created , call the openFileInput() method with the name of the file. It returns an instance of FileInputStream. • FileInputStream fin = openFileInput(file); • After that, you can callr read method to read one character at a time from the file and then you can print it. • int c; String temp=""; while( (c = fin.read()) != -1) { temp = temp + Character.toString((char)c); } //string temp contains all the data of the file. fin.close();
  • 17. Internal Vs. External Storage • Internal storage is the storage of the private data on the device memory • External storage is not private and may not always be available. If for example the android device is connected with a computer, the computer may mount the external system via USB and that makes this external storage not available for android applications.
  • 19. Bluetooth Bluetooth is a way to exchange data with other devices wirelessly. Android provides Bluetooth API to perform several tasks such as: •scan bluetooth devices •connect and transfer data from and to other devices •manage multiple connections etc. By the help of BluetoothAdapter class, we can perform fundamental tasks such as initiate device discovery, query a list of paired (bonded) devices, create a BluetoothServerSocket instance to listen for connection requests etc.
  • 20. Constants of Bluetooth Adapter class Bluetooth Adapter class provides many constants. Some of them are as follows: String ACTION_REQUEST_ENABLE String ACTION_REQUEST_DISCOVERABLE String ACTION_DISCOVERY_STARTED String ACTION_DISCOVERY_FINISHED Methods of Bluetooth Adapter class Commonly used methods of Bluetooth Adapter class are as follows:
  • 21. static synchronized BluetoothAdapter getDefaultAdapter() returns the instance of BluetoothAdapter. boolean enable() enables the bluetooth adapter if it is disabled. boolean isEnabled() returns true if the bluetooth adapter is enabled. boolean disable() disables the bluetooth adapter if it is enabled. String getName() returns the name of the bluetooth adapter. boolean setName(String name) changes the bluetooth name. int getState() returns the current state of the local bluetooth adapter. Set<BluetoothDevice> getBondedDevices() returns a set of paired (bonded) BluetoothDevice objects. boolean startDiscovery() starts the discovery process.
  • 22. • 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. private BluetoothAdapter BA; BA = BluetoothAdapter.getDefaultAdapter(); • In order to enable the Bluetooth of your device, call the intent with the following Bluetooth constant ACTION_REQUEST_ENABLE. Its syntax is. Intent turnOn = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivityForResult(turnOn, 0);
  • 23.  Now select Turn On to turn on the bluetooth  Now just select the Get Visible button to turn on your visibiltiy  Select your mobile device as an option and then check your mobile device which will display following screen:
  • 24.  Now just select the List Devices option. It will list down the paired devices in the list view  Now just select the Turn off button to switch off the Bluetooth