Step 1
Create broadcast receiver class for receiving sms
package com.javaorigin.android.sample;
import android.content.*;
import android.os.Bundle;
import android.telephony.*;
import android.util.Log;
import android.widget.Toast;
public class SimpleSmsReciever extends BroadcastReceiver {
private static final String TAG = "Message recieved";
@Override
public void onReceive(Context context, Intent intent) {
Bundle pudsBundle = intent.getExtras();
Object[] pdus = (Object[]) pudsBundle.get("pdus");
SmsMessage messages =SmsMessage.createFromPdu((byte[]) pdus[0]);
Log.i(TAG, messages.getMessageBody());
Toast.makeText(context, "SMS Received : "+messages.getMessageBody(),
Toast.LENGTH_LONG).show();
}
}
Step 2 :
Configure the AndroidManifest.xml file
<?xml version="1.0" encoding="utf-8"?>
<manifest android="http://schemas.android.com/apk/res/android"
package="com.javaorigin.android.sample" versioncode="1" versionname="1.0">
<application icon="@drawable/icon" label="@string/app_name">
<receiver name=".SimpleSmsReciever">
<intent-filter>
<action name="android.provider.Telephony.SMS_RECEIVED">
</action>
</intent-filter>
</receiver>
</application>
<uses-sdk minsdkversion="6">
<uses-permission name="android.permission.INTERNET">
Hi,
ReplyDeleteQuestion...
Let's say I have an activity wich should draw something depending on the received message....
vDraw is my view to draw in (ViewDraw.java)
SMSDraw is my main activity (SMSDraw.java)
the drawing part is working...
Now how can I get the information from the sms in my SMSdraw ????
wether we have to register the recever ? in above exaample
ReplyDeleteIs it worked on emulator> i m trying on emulator but not not getting toast nor printing log...
ReplyDeleteIt works but y to add internet permission???
ReplyDeleterequire "android.permission.RECEIVE_SMS" Permission in manifest file to work.
ReplyDeletei can't get the code running it always force closes when i run the application.what could be the reason.I've tried getting it to work but still unsuccessful
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteafter receives sms, protect on the native inbox(doesn't go on inbox) Pls help me... pls tell the Code... My project pls
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteif i want to read sent messages by me at that time broadcast receiver doesn't working...
ReplyDeleteNice Thread Tutorial, i am new in android , its help me a lot ...
ReplyDeleteI have got some good links
here at androidexample.com
Incomming SMS Broadcast Receiver
thanks. it helps a lot. should include
ReplyDeletethanks.
ReplyDeleteits easy and help a lot.
i also refer some tutorial at androprogrammer.com
Wow, you are a life saver man. Thanks for the awesome code :D Valentines Day 2014
ReplyDeleteGreat I have used this code on my Android Google Blog
ReplyDeletewhere is layout.xml file????????
ReplyDeleteVery informative ..i suggest this blog to my friends..Thank you for sharing
ReplyDeleteAndroid Training in velachery | Android Training in chennai | Android Training in chennai with placement
Well written and interesting thoughts. Its amazing how sometimes we get inspiration from the most unexpected of quarters !
ReplyDeleteschool app in chennai
Hey, Really amazing..!
ReplyDeleteI've bookmarked your post for reference and will love to follow you.
Please keep it up good work for us.
We provide a solution to use WhatsApp in your business communications and send invoices though tally.
WhatsApp API Integration
WhatsApp API Tally
Tally Invoices to WhatsApp
Nice article!!
ReplyDeleteHave a look Bulk sms services
Thanks for provide great informatic and looking beautiful blog, really nice required information & the things i never imagined and i would request, wright more blog and blog post like that for us. Thanks you once agian
ReplyDeletecourt marriage in delhi ncr
court marriage in delhi
court marriage in noida
court marriage in ghaziabad
court marriage in gurgaon
court marriage in faridabad
court marriage in greater noida
name change online
court marriage in chandigarh
court marriage in bangalore
I enjoyed your blog Thanks for sharing such an informative post. We are also providing the best services click on below links to visit our website.
ReplyDeletedigital marketing company in nagercoil
digital marketing services in nagercoil
digital marketing agency in nagercoil
SEO company in nagercoil
SEO services in nagercoil
social media marketing in nagercoil
social media company in nagercoil
PPC services in nagercoil
digital marketing company in velachery
digital marketing company in velachery
digital marketing services in velachery
digital marketing agency in velachery
SEO company in velachery
SEO services in velachery
social media marketing in velachery
social media company in velachery
PPC services in velachery
online advertisement services in velachery
online advertisement services in nagercoil
web design company in nagercoil
web development company in nagercoil
website design company in nagercoil
website development company in nagercoil
web designing company in nagercoil
website designing company in nagercoil
best web design company in nagercoil
web design company in velachery
web development company in velachery
website design company in velachery
website development company in velachery
web designing company in velachery
website designing company in velachery
best web design company in velachery
Thanks for Sharing - ( Groarz branding solutions )
best induction cooktop. creates unique index on table/view. You cannot create unique index on duplicate columns and
ReplyDeletesad shayari. drag and drop, charts, fading, all
ReplyDeleteThanks for provide great informatic and looking beautiful blog, really nice required information & the things i never imagined and i would request, wright more blog and blog post like that for us. Thanks you once agian afghani cap , antique gold choker necklace , embroidered crown patches , Afghani Hand Embroidered Shirt
ReplyDeleteHey! Well-written blog. I love your writing skill. Keep it up. For managing business accounts, use QuickBooks Enterprise software. In case you face any technical issue, dial Quickbooks Customer Service Phone Number 1-855-756-1077 and get instant solution.
ReplyDeleteemail and task management in usa
ReplyDeleteproject management automation in usa
b2b web development in usa
retail process automation in usa
industries IT services in usa
This is so fun! What a great content. Also I love how authentic you seem to be.
ReplyDeleteveste velour carhartt
Deletemasque anti pollen moto amazon île caravane jambe
crampon vissé adidas
combinaison soirée femme 2018 amical carte
table basse marbre noir pied doré
nike air max 97 silber
kit de creation de bracelets utilisation
gucci sandale plastique
nike presto extreme pas cher
adidas stan smith safety shoes
scarpe nike tanjun nero bianco
biondo scuro mogano rosso
fabbrica cravatte uomo byblos
polo shirt juventus
silver nike nuove
pantaloni puma femei pollice Linea di metallo
adidas superstar purple
adidas zx flux womens floral
orologi hindenberg
cerchietto che si chiude capelli
cappotto burberry bimba amazon
maglietta ciglia stradivarius
paragliding přilby
borse gabs etnico
guanti da sci gialli
vestito stile smoking bianco
ReplyDeleteThanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.
Derivative Calculator
edublackboards
How to find the height of a trapezoid
Area of a Rectangle
nike shirt langarm
ReplyDeletemoufles millet expedition 8000 m
hüte damen sommer
diffuseur par nébulisation à froid amazon
bijoux pas cher or blanc amazon
sacoche lv district
polo simulator
cappotto burberry bimba amazon
schubkarre gestell amazon
nike off white foam rose
jeansjacke mädchen 164
nike cortez prm
beutel zipper amazon
nike tanjun damen weiß 44
scarpe pirelli uomo impedire
polo ralph lauren jeanshemd damen
risparmiare batteria iphone ios 12
style année 80 femme
Nike Air Force 270
kimono en jean
pantaloni puma femei pollice Linea di metallo
naketano anker jacke schwierig
venta de tenis nike en tijuana
blazer basicos mujer
adidas adizero ace boost 7
masque d horreur a imprimer
new balance icarus
sandália rasteira bottero
berghaus mens raincoat
calça laranja adidas
béret a pompon bretelles uniforme
gucci sandale plastique
costumi interi amazon
skechers shoes for men online
gants si assault factory pilot noir oakley
venda de cortina
adidas stan smith safety shoes
niveau à laser amazon surligner escorte
sims 4 nike shoes kids
casquette ford Immigration
ReplyDeletechaussure carla moreau
triciclo usato milano
chaussures de sécurité facom
foot locker nike react element
scatola protezione stagna
nike metcon 5 rojas
zapatillas de agua niña
veste velour carhartt
damen lack schnürer
cappotto rosso scarpe nike
fiore garofano amazon
nike presto extreme pas cher
nike pegasus 94
shorts fitness feminino
nike t shirt tumblr
quadri da disegnare amazon
chinelo slide da melissa
tenis all star feminino branco couro
calzoncillos puma hombre
veste per battesimo amazon
nike air force modelo agotado
cartera levis hombre
filtre pour aspirateur samsung sc4780
autoradio gps vdo
nike tribute veste
soldes chaussures homme caterpillar hiver cafétéria
amazon sandalias reef
chanclas new balance niña
kit de creation de bracelets utilisation
wc suspendu mural amazon
foulard en soie homme
all star converse star player
paragliding přilby
nike anzug nba rot
camisa da ferroviária
tapie adidas credit lyonnais
gucci handbags uk
air force 1 nike outfit men basket
borse gabs etnico
ReplyDeletezapatillas running galaxy 4 azul marino mujer adidas
nike air max 97 silber
ladies summer shorts
bolsas para comprimir equipaje
table basse marbre noir pied doré
guanti da sci gialli
stratic koffer monogramm
sellerie moto strasbourg
deichmann bolsos
aharry potter x vans
adidas cal surf
timberland herren 3 eye
adidas yeezy semi frozen yellow on feet
cappello fisi kappa tazza
nike free run 5.0 new
smartphone kleine abmessungen amazon
adidas originals panna scarpe uomo basse
sandalias rosa palo tacon ancho giro
bermuda femme en lin dor
vetements sisley ligne
s oliver catie bell bottom
cerchietto che si chiude capelli
short de bain islamique
zapatos de charol mujer con taco
blazer bebe 2 anos
rückgaberecht adidas
camiseta con falda corta
tende doccia milano amazon
shein camicie donna cameriera
bañador neopreno mujer oysho
sudadera nike vintage
giacca da prestigiatore
sandalias courofeito a mao
grossista condizionatori
piumini daunenstep amazon
zapatillas cruyff mujer
valentine gauthier chaussures
valentine gauthier chaussures
ReplyDeletesacoche lv district
sandalias agua cerradas
scarpe nike air force modelli nuovi
maglia termica nuoto bambina
shein camicie donna cameriera
abrigo aviador mujer abdomen
gucci forocoches
sonic 3 and knuckles juego online
new balance icarus
sudadera nike vintage
sandalias de esparto mujer
nike air jordan sale deutschland
zapatillas nike lunarglide 8 precio
chaussette pull and bear
adidas noir doré
nike hypervenom all black
zapatillas de mujer bimba y lola
pantalon homme the kooples
lovely jane robe
polo shirt juventus
leggings mit spitzenabschluss
pantoufle charentaise homme
tumbona terraza ikea
nike sb stefan janoski beige
adidas personalised shoes
ReplyDeletenike shox feminino modelo novo
camisa cuadros franela mujer
tenis oakley flak infantil
sac a main desigual beige
maje robe
nike neuheiten damen
aharry potter x vans
kimono long femme grande taille
air jordan 4 lightning
hama stiftplatte einhorn amazon
zaini eastpak ragazza
gucci sandale plastique
nike presto extreme pas cher
adidas stan smith safety shoes
adidas stabil x junior
nike sb zoom mogan mid 2 6.0
schubkarre gestell amazon
skechers shoes for men online
robe voile manche longue
ReplyDeleteنقل اثاث
تنظيف مكيفات
جلي بلاط
تنظيف
كشف تسربات المياه