how to read sms from specific number and delete from inbox programmatically - coderjunk

Upload: vairamoorthy-arunachalam

Post on 06-Jul-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/18/2019 How to Read SMS From Specific Number and Delete From Inbox Programmatically - Coderjunk

    1/3

    Recent Posts

    How to read SQL database specific row text from

    another row value

    How to add build number and date from github in ruby

    code?

    How to hide specific lines of css from IE 7 and IE 8

    How do I transfer effe ctively huge number of files from

    my python clients to server a nd back?

    I need to send sms to a specific number and check its

    reply -AndroidHow do I get the line number and path of a method from

    pdb using .Net?

    Searching from a s ite for a specific number and openin

    it in an iFrame

    How to join a number of fields from one table and

    compare the result with another field from another tabl

    How to get records in a database where field (sms_tex

    is equal to a specific number a nd display it into the

    datagrid

    How to read filenames in a folder and access them in a

    alphabetical and increasing number order?

    How to read SMS from a GSM phone ,That is alrea dy

    connected to the system Using Serial port in VB.NET

    How to randomly play a specific number of audio files

    from a directory?

    HOME

    how to read SMS from specific number and delete frominbox programmatically

    I used this code which gets SMS messages from a specific phone number and then opens my application.

    It works fine but it does not delete SMS from the inbox after getting the SMS from the specific phone number.

    I'm using a simulator for testing please help tell me what is the error in the code? How can i delete SMS from

    specific number???

    public class SmsReceiver extends BroadcastReceiver {

      String specificPhoneNumber = "15555215554";

      public void onReceive(Context context, Intent intent)

    {

      //---get the SMS message passed in---

      Bundle bundle = intent.getExtras();

    SmsMessage[] msgs = null;

      String str = "";

    if (bundle != null)

      {

    //---retrieve the SMS message received---  Object[] pdus = (Object[]) bundle.get("pdus");

      msgs = new SmsMessage[pdus.length];

    for (int i=0; i

  • 8/18/2019 How to Read SMS From Specific Number and Delete From Inbox Programmatically - Coderjunk

    2/3

     

     

     

    . Use abortBroadcast()  to prevent specific message from passing to the inbox.

    You can try the fo llowing changes -

    Uri uri = Uri.parse("content://sms/inbox");

    For querying -

    String where = "address="+phNum;

    Cursor cursor = contentResolver.query(uri, new String[] { "_id", "thread_id"}, where, null,

      null);

    Thread id will be the second element -

    long thread_id = cursor.getLong(1);

    where = "thread_id="+thread_id;

    Uri thread = Uri.parse("content://sms/inbox");

    context.getContentResolver().delete(thread, where, null);

    Similar Questions

    how to add object at specific index and also remove another object from NSMutableArray?

    hello friends im new in ios development i want to add obje ct at specified index for that i code here arrnotificationtime

    nsmutablearray arraywithcapacityarrnotificationviewcount for int i0 iltarrnotificationviewcount i arrnotificationtim...

    How to read sms of some specific numbers in android

    how can i read sms of some s pecific number more than 1 number from inbox please help give something idea ab out itor any

    reference i have tried a code but not work ...

    How to strip specific characters and words from String [closed]

    im trying to strip a list of specified characters and words from various s tring variants here are the pos sible s trings integer from 0

    100 quantitycsizecon quantitycsizeconc quantitycsizeconb quantitysize quantitysizechain depending on...

    How to read data in each row and each column from sql table in asp.net using C#?

    sql database is studentinfo and table name is registration idnameemailphoneno 1munasunghe amilamunasingheyahoocom

    0717069425 2 liyanarachchihareshliya6gmailcom0756706 352 protected void pageload object sender ev...

    search array for specific number and count how many times it appears

    i have an array of ages from 0100 you keep entering the ages until s entinel data99 is entered i ne ed to then count how many

    times each age appears example o utput the numbe r of people 5 years old is 3 the num ber of people 8 years old is 1 th...

    How to read in a specific line from an input file in C?

    if i want to read in a specific line without knowing what exactly is in that line how would i do that using fscanf one n two n three n i

    want this line n umber four n five n six n how wo uld i read in the 5th line in that input text file do ...

    How to get specific number of posts from a particular post-type with pagination in wordpressi have created a pos ttype grammer and taxonomy named subje ct there are almos t 220 posts in gram mer now i wis h to retrieve

    only 25 posts from posttype grammer where taxonomy gt subject and its sl ug value is level1beginner these res ults shou...

    How to push job in specific queue and limit number workers with sidekiq?

    i know we can do s idekiqoptions queu e foo but in this case its the worker which is as signed to only one queue foo i need to

    ass ign a job and not a worker in specific queue with resque its ea sy resqueenqueuetoqueuen ame m yjob further fo...

    How do I take an unknown number of elements from a session array in php and use them as separate variables

    in JavaScript?

    i a webpage written in phphtml that adds the contents of a text box to a sess ion array each time a s ubmit button is press ed what i

    need to be able to do is take the unknown number of elemen ts in the sess ion array and have access to each of th...

    How to get a date from day number and year?

    im trying to convert a day number for a given year back into its date ie the in verse of the method yday for example given the 200th

    day of the year 2012 i want to get the d ate 20120718 ...

    http://www.coderjunk.com/7xmSeUkegV/how-do-i-take-an-unknown-number-of-elements-from-a-session-array-in-php-and-use-them-as-separate-variables-in-javascript.htmlhttp://www.aliexpress.com/buyerprotection/index.htmlhttp://us.ae.aliexpress.com/wishlist/wish_list_product_list.htmhttp://www.aliexpress.com/item/New-Portable-D-arsonval-Darsonval-High-Frequency-Spot-Remover-Facial-Skin-Care-Beauty-Device-Professional-Kit/2014047980.htmlhttp://www.coderjunk.com/7ymJqVeXkU/how-to-add-object-at-specific-index-and-also-remove-another-object-from-nsmutablearray.htmlhttp://activities.aliexpress.com/appdownload.php?tracelog=pc_homepagehttp://www.aliexpress.com/http://www.aliexpress.com/item/Hot-Sale-Mini-Tripod-Stand-Holder-for-Mobile-Cell-Phone-Camera-Phone-4-4g-5-5G/1287869208.htmlhttp://www.coderjunk.com/7iiNqUWeWX/how-to-read-data-in-each-row-and-each-column-from-sql-table-in-aspnet-using-c.htmlhttp://www.aliexpress.com/item/New-Portable-D-arsonval-Darsonval-High-Frequency-Spot-Remover-Facial-Skin-Care-Beauty-Device-Professional-Kit/2014047980.htmlhttp://www.aliexpress.com/item/Newest-1pcs-Ultra-thin-5600mah-perfume-polymer-mobile-power-bank-general-charger-external-backup-battery-pack/1771855547.htmlhttp://www.aliexpress.com/item/2pcs-Feminine-hygiene-products-vagina-care-lady-menstrual-cup-alternative-tampons-medical-silicone-cup-Free-shipping/32279237620.htmlhttp://www.coderjunk.com/7JmmqeUUqq/how-to-strip-specific-characters-and-words-from-string-closed.htmlhttp://www.aliexpress.com/item/Newest-1pcs-Ultra-thin-5600mah-perfume-polymer-mobile-power-bank-general-charger-external-backup-battery-pack/1771855547.htmlhttp://www.aliexpress.com/item/Extendable-Self-Selfie-stick-Phone-Camera-Handheld-Monopod-Tripod-Remote-Shutter-Release-Wired-Holder-bluetooth-Taking/32281993196.htmlhttp://www.coderjunk.com/7QiJgeXWjV/how-to-get-specific-number-of-posts-from-a-particular-posttype-with-pagination-in-wordpress.htmlhttp://www.coderjunk.com/7JxSqgUXXV/how-to-read-sms-of-some-specific-numbers-in-android.htmlhttp://www.coderjunk.com/7zNyUVqjWW/how-to-get-a-date-from-day-number-and-year.htmlhttp://www.aliexpress.com/item/Scolour-New-Fashion-Men-Stylish-Business-Leather-Wallet-Card-Holder-Coin-Wallet-Purse-Free-shipping-Wholesale/32229302391.htmlhttp://www.coderjunk.com/7yHNqPqeeX/search-array-for-specific-number-and-count-how-many-times-it-appears.htmlhttp://us.ae.aliexpress.com/wsuser/buyerJoin/expressJoinIndex.htm?return=http%3A%2F%2Factivities.aliexpress.com%2Faf%2Fbestselling.php%3Faff_platform%3Daaf%26sk%3DbiIYJiaU7%253A%26cpt%3D1436894695220%26aff_trace_key%3D43427012441164624http://www.aliexpress.com/item/Rechargeable-Battery-Pack-Charger-For-AA-AAA-Battery-PLFL/1947508836.htmlhttp://www.aliexpress.com/item/Blue-y711-7-5cm-x-5m-Kinesiology-Kinesio-Roll-Cotton-Elastic-Adhesive-Muscle-Sports-Tape-Bandage/32237874602.htmlhttp://activities.aliexpress.com/bestselling-products.phphttp://www.aliexpress.com/item/Hot-Sale-Mini-Tripod-Stand-Holder-for-Mobile-Cell-Phone-Camera-Phone-4-4g-5-5G/1287869208.htmlhttps://login.aliexpress.com/express/mulSiteLogin.htm?return=http%3A%2F%2Factivities.aliexpress.com%2Faf%2Fbestselling.php%3Faff_platform%3Daaf%26sk%3DbiIYJiaU7%253A%26cpt%3D1436894695220%26aff_trace_key%3D43427012441164624http://www.aliexpress.com/item/2pcs-Feminine-hygiene-products-vagina-care-lady-menstrual-cup-alternative-tampons-medical-silicone-cup-Free-shipping/32279237620.htmlhttp://www.coderjunk.com/7QJJgeVXPW/how-to-read-in-a-specific-line-from-an-input-file-in-c.htmlhttp://www.coderjunk.com/7zmzgUgjkP/how-to-push-job-in-specific-queue-and-limit-number-workers-with-sidekiq.htmlhttp://void%280%29/http://best.aliexpress.com/http://shoppingcart.aliexpress.com/shopcart/shopcartDetail.htmhttp://www.aliexpress.com/item/Extendable-Self-Selfie-stick-Phone-Camera-Handheld-Monopod-Tripod-Remote-Shutter-Release-Wired-Holder-bluetooth-Taking/32281993196.htmlhttp://www.aliexpress.com/item/Scolour-New-Fashion-Men-Stylish-Business-Leather-Wallet-Card-Holder-Coin-Wallet-Purse-Free-shipping-Wholesale/32229302391.htmlhttp://www.aliexpress.com/item/Rechargeable-Battery-Pack-Charger-For-AA-AAA-Battery-PLFL/1947508836.htmlhttp://www.aliexpress.com/item/Blue-y711-7-5cm-x-5m-Kinesiology-Kinesio-Roll-Cotton-Elastic-Adhesive-Muscle-Sports-Tape-Bandage/32237874602.html

  • 8/18/2019 How to Read SMS From Specific Number and Delete From Inbox Programmatically - Coderjunk

    3/3

    No spam, no self-promotion, and no offensive language.

    © 2014 coderjunk.com, All rights reserved user contributions licensed under cc by-sa 3.0 with attribution required. Any advice please contact us

    How to fetch specific number of lines f rom webpage using cURL (C/C++)

    i am a n ewbie in curl and trying to implement som e application which could allow u ser to fetch specific data from an html page

    dynamic and save it to txt application is cc bas ed and s o far i am able to fetch the whole contant of html page t...

    How to replace specific number of character from given string by sql query?

    like s1 ldoeddldkeofkfokdkf output like ldoed kdldkeofkfokkdkf replace first and third from s tring with character k ...

    How would I read in the city name and coordinates from this text file?

    im trying to make a program that calculates the distance between two points on the earth as we ll as the azimuth then once i get

    the distance and a zimuth ill have to create a graph data structure that will use dijkstras algorithm to find the s...

    how can i get a specific number(for example an stock price) from a web page [closed]

    i want to get stock price from this s ite httpentsetmccom there is a page that tell us all price in this stocks

    httpentsetmccomload eraspxpartree121c1111 i tried to get this page content by this code address

    httpentsetmccomloaderaspxpartree12...

    How to get data from last number and still before space in javascript using regular expression

    this is m y problem below var id 10101building an d construction 21 basically i have got ids data from other calculation i want to

    separate to 21 here resul t will be 21 how can i rem ove ids value without 21 please any help ...

    How to evenly delete a specific number of rows from a list?

    i want to write the logic to delete a s pecific number of rows from a lis t and i want to sel ect the rows for deletion as evenly as

    poss ible this i s eas y when i want to delete 25 or 50 from a lis t i sim ply write the logic to delete every 4th or...

    How to Get date from week number and year 

    i want to get date from week num ber and year i got week num ber and year from server i am trying following code but it wont work

    nsdateformatter dateformatter2 nsdateformatter alloc init this is im porant we set our i nput date format to ma...

    How to make sequence from specific number?

    how to make seq uence from the beginning of sq uare numbe r and then adding it to the previous res ult 7 gt 49 56 63 def makesequencenumber lambda numbernumber end num makesequence7 numcall gt 49 numcall gt 56 ...

    C: how to read in a variable amount of info from files and store it in array

    i am not us ed to programmi ng in c so i a m wondering how to have an array and then read a variable amount of variables in a file

    and those these files in the array how do i declare an array whose sizes varies do char b uffer1000 fscanf...

    Submit Answer!

     

    http://www.aliexpress.com/item/Wired-Selfie-Stick-Handheld-Monopod-Built-in-Shutter-Extendable-Mount-Holder-For-iPhone-Samsung-Smartphone-Any/32262461386.htmlhttp://www.aliexpress.com/item/Plastic-IR-Module-Body-Sensor-Intelligent-Light-Motion-Sensing-Switch-220V-K5BO/1901416466.htmlhttp://www.coderjunk.com/7JHxXgjWgk/how-to-get-data-from-last-number-and-still-before-space-in-javascript-using-regular-expression.htmlhttp://www.aliexpress.com/item/Scolour-New-Fashion-Men-Stylish-Business-Leather-Wallet-Card-Holder-Coin-Wallet-Purse-Free-shipping-Wholesale/32229302391.htmlhttp://www.aliexpress.com/item/HOTSALE-LARGE-1-SET-11-DESIGNS-IN-1-B56-66-WATER-DECAL-France-Round-Series-NAIL/1948835960.htmlhttp://www.aliexpress.com/item/Blue-AC-Power-USB-Wall-Charger-For-iPhone-5-4-4S-3GS-iPod-EU-Plug-free/1581575609.htmlhttp://www.aliexpress.com/item/Rechargeable-Battery-Pack-Charger-For-AA-AAA-Battery-PLFL/1947508836.htmlhttp://www.aliexpress.com/item/Car-Stick-Windshield-Mount-Stand-Holder-for-Cellphone-Mobile-Phone-GPS-Universal-09OO/2015760335.htmlhttp://www.coderjunk.com/cdn-cgi/l/email-protection#3c505552494458535f447c455d545353125f5351http://www.aliexpress.com/item/Pro-Makeup-Tool-Accessories-Foundation-Blender-Blending-Puff-Flawless-Powder-Smooth-Beauty-Cosmetic-make-up-Shaped/1894719750.htmlhttp://www.coderjunk.com/7zimPXWPqP/how-can-i-get-a-specific-numberfor-example-an-stock-price-from-a-web-page-closed.htmlhttp://www.aliexpress.com/item/Car-Steering-Wheel-Mount-Holder-Rubber-Band-For-iPhone-iPod-MP4-GPS-Mobile-Phone-Holders/1889957775.htmlhttp://www.aliexpress.com/item/cacac-hot-DIY-Metal-tattoo-stickers-glitter-gold-temporary-flash-tattoo-Disposable-The-indians-tattoo-environmental/32215290948.htmlhttp://www.aliexpress.com/item/Luxury-Glitter-Diamond-Phone-Case-For-iphone-5-5S-5G-With-LOGO-iphone-5S-cases-wholesale/32314176959.htmlhttp://www.aliexpress.com/item/Men-Women-UV400-Cycling-Glasses-Outdoor-Sport-Mountain-Bike-MTB-Bicycle-Glasses-Motorcycle-Sunglasses-Eyewear-Oculos/32284285856.htmlhttp://www.aliexpress.com/item/Extendable-Self-Selfie-stick-Phone-Camera-Handheld-Monopod-Tripod-Remote-Shutter-Release-Wired-Holder-bluetooth-Taking/32281993196.htmlhttp://www.aliexpress.com/item/New-Original-Carter-s-Baby-Girls-baby-boys-Hooded-Microfleece-Jumpsuit-Carters-Baby-Girls-and-boys/32290422892.htmlhttp://www.aliexpress.com/item/Extendable-Self-Selfie-stick-Phone-Camera-Handheld-Monopod-Tripod-Remote-Shutter-Release-Wired-Holder-bluetooth-Taking/32281993196.htmlhttp://www.aliexpress.com/item/Pro-Makeup-Tool-Accessories-Foundation-Blender-Blending-Puff-Flawless-Powder-Smooth-Beauty-Cosmetic-make-up-Shaped/1894719750.htmlhttp://www.aliexpress.com/item/Free-Shipping-1x-Hot-Sale-3-5mm-Jack-M-M-Stereo-Audio-AUX-Cable-Cord-For/1802976263.htmlhttp://www.aliexpress.com/item/Foundation-Cream-Highlighter-For-Face-1pcs-Professional-15-Concealer-Camouflage-Foundation-Makeup-Palatte/2029161370.htmlhttp://www.coderjunk.com/7yxSPVePUg/how-to-replace-specific-number-of-character-from-given-string-by-sql-query.htmlhttp://www.aliexpress.com/item/New-Explosion-Proof-Premium-Real-Tempered-Glass-Film-Screen-Protector-Guard-For-Samsung-Galaxy-A3-A5/32320147397.htmlhttp://www.aliexpress.com/item/Scolour-New-Fashion-Men-Stylish-Business-Leather-Wallet-Card-Holder-Coin-Wallet-Purse-Free-shipping-Wholesale/32229302391.htmlhttp://www.aliexpress.com/item/Car-Steering-Wheel-Mount-Holder-Rubber-Band-For-iPhone-iPod-MP4-GPS-Mobile-Phone-Holders/1889957775.htmlhttp://www.aliexpress.com/item/New-Explosion-Proof-Premium-Real-Tempered-Glass-Film-Screen-Protector-Guard-For-Samsung-Galaxy-A3-A5/32320147397.htmlhttp://www.aliexpress.com/item/HOTSALE-LARGE-1-SET-11-DESIGNS-IN-1-B56-66-WATER-DECAL-France-Round-Series-NAIL/1948835960.htmlhttp://www.aliexpress.com/item/Car-Stick-Windshield-Mount-Stand-Holder-for-Cellphone-Mobile-Phone-GPS-Universal-09OO/2015760335.htmlhttp://www.aliexpress.com/item/2-Pcs-Feet-Care-Pedicure-Soft-Gel-Valgus-Pro-Hallux-Valgus-Sosu-Valgus-Pro-Health-Monitors/32251104248.htmlhttp://www.aliexpress.com/item/High-quality-30-pin-usb-cable-charger-cables-adapter-cabo-kable-for-apple-iPhone-4-4s/32227048486.htmlhttp://www.aliexpress.com/item/2-Pcs-Feet-Care-Pedicure-Soft-Gel-Valgus-Pro-Hallux-Valgus-Sosu-Valgus-Pro-Health-Monitors/32251104248.htmlhttp://www.aliexpress.com/item/Multi-Function-E27-3W-Colorful-Auto-Rotating-RGB-LED-Bulb-Stage-Light-Party-Lamp-Disco/32233128158.htmlhttp://www.aliexpress.com/item/High-quality-30-pin-usb-cable-charger-cables-adapter-cabo-kable-for-apple-iPhone-4-4s/32227048486.htmlhttp://www.aliexpress.com/item/Men-Women-UV400-Cycling-Glasses-Outdoor-Sport-Mountain-Bike-MTB-Bicycle-Glasses-Motorcycle-Sunglasses-Eyewear-Oculos/32284285856.htmlhttp://www.coderjunk.com/0HxVkjPUXX/how-to-make-sequence-from-specific-number.htmlhttp://www.aliexpress.com/item/3X-USB-travel-moblie-charger-EU-AC-Power-Adapter-Wall-Charger-Plug-SYNC-Cable-for-iPhone/1685734963.htmlhttp://www.coderjunk.com/7zSmPqgPWj/how-would-i-read-in-the-city-name-and-coordinates-from-this-text-file.htmlhttp://www.coderjunk.com/7JNzUgPggq/how-to-fetch-specific-number-of-lines-from-webpage-using-curl-cc.htmlhttp://www.aliexpress.com/item/Rechargeable-Battery-Pack-Charger-For-AA-AAA-Battery-PLFL/1947508836.htmlhttp://www.aliexpress.com/item/Blue-y711-7-5cm-x-5m-Kinesiology-Kinesio-Roll-Cotton-Elastic-Adhesive-Muscle-Sports-Tape-Bandage/32237874602.htmlhttp://www.aliexpress.com/item/New-Original-Carter-s-Baby-Girls-baby-boys-Hooded-Microfleece-Jumpsuit-Carters-Baby-Girls-and-boys/32290422892.htmlhttp://www.aliexpress.com/item/Top-Quality-Long-Lasting-UV-Nail-Gel-Polish-Varnish-Long-Lasting-Up-to-30-days-Nial/32229091643.htmlhttp://www.aliexpress.com/item/Multi-Function-E27-3W-Colorful-Auto-Rotating-RGB-LED-Bulb-Stage-Light-Party-Lamp-Disco/32233128158.htmlhttp://www.aliexpress.com/item/Wired-Selfie-Stick-Handheld-Monopod-Built-in-Shutter-Extendable-Mount-Holder-For-iPhone-Samsung-Smartphone-Any/32262461386.htmlhttp://www.aliexpress.com/item/2015-New-Sport-Shorts-Men-Casual-Harem-Shorts-Male-Loose-Trousers-8-Colors-S-XXXL-Drop/32324381314.htmlhttp://www.aliexpress.com/item/Foundation-Cream-Highlighter-For-Face-1pcs-Professional-15-Concealer-Camouflage-Foundation-Makeup-Palatte/2029161370.htmlhttp://www.coderjunk.com/0QyVkjkXXW/how-to-get-date-from-week-number-and-year.htmlhttp://www.aliexpress.com/item/Blue-AC-Power-USB-Wall-Charger-For-iPhone-5-4-4S-3GS-iPod-EU-Plug-free/1581575609.htmlhttp://www.aliexpress.com/item/cacac-hot-DIY-Metal-tattoo-stickers-glitter-gold-temporary-flash-tattoo-Disposable-The-indians-tattoo-environmental/32215290948.htmlhttps://creativecommons.org/licenses/by-sa/3.0/http://www.coderjunk.com/7HHyXUgkjU/how-to-evenly-delete-a-specific-number-of-rows-from-a-list.htmlhttp://www.aliexpress.com/item/Blue-y711-7-5cm-x-5m-Kinesiology-Kinesio-Roll-Cotton-Elastic-Adhesive-Muscle-Sports-Tape-Bandage/32237874602.htmlhttp://www.aliexpress.com/item/Plastic-IR-Module-Body-Sensor-Intelligent-Light-Motion-Sensing-Switch-220V-K5BO/1901416466.htmlhttp://www.coderjunk.com/0yyVqkXkVk/c-how-to-read-in-a-variable-amount-of-info-from-files-and-store-it-in-array.htmlhttp://www.aliexpress.com/item/Top-Quality-Long-Lasting-UV-Nail-Gel-Polish-Varnish-Long-Lasting-Up-to-30-days-Nial/32229091643.html