¡@

Home 

2014/10/16 ¤W¤È 08:10:45

android Programming Glossary: broadcast

Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4)

http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4

if contactId 1 showNotification contactId str send a broadcast intent to update the SMS received in the activity Intent broadcastIntent.. intent to update the SMS received in the activity Intent broadcastIntent new Intent broadcastIntent.setAction SMS_RECEIVED_ACTION.. in the activity Intent broadcastIntent new Intent broadcastIntent.setAction SMS_RECEIVED_ACTION broadcastIntent.putExtra..

Can we delete an SMS in Android before it reaches the inbox?

http://stackoverflow.com/questions/1741628/can-we-delete-an-sms-in-android-before-it-reaches-the-inbox

specific UI. As of Android 1.6 incoming SMS message broadcasts android.provider.Telephony.SMS_RECEIVED are delivered as an.. are delivered as an ordered broadcast &mdash meaning that you can tell the system which components.. can tell the system which components should receive the broadcast first. If you define an android priority attribute on your SMS..

Intent action for network events in android sdk

http://stackoverflow.com/questions/2294971/intent-action-for-network-events-in-android-sdk

for network events in android sdk I need to receive broadcasts for network actions like network connected disconnected etc... like network connected disconnected etc. I am using a broadcast receiver for this purpose. Can anyone please tell me which intent.. . Here is my broadcast receiver class import android.content.BroadcastReceiver import..

Open another application from your own (intent)

http://stackoverflow.com/questions/2780102/open-another-application-from-your-own-intent

have multiple activities services content providers and or broadcast listeners. If at least one of them is running the application..

How to Read MMS Data in Android?

http://stackoverflow.com/questions/3012287/how-to-read-mms-data-in-android

a SMS and click on the notification bar it will send a broadcast intent like this content mms sms conversations XXX where XXX..

Background task, progress dialog, orientation change - is there any 100% working solution?

http://stackoverflow.com/questions/3821423/background-task-progress-dialog-orientation-change-is-there-any-100-working

e.g. downloading a large file . You can use an ordered broadcast Intent to either have the activity respond to the work being..

Android: How can I get the current foreground activity (from a service)?

http://stackoverflow.com/questions/3873659/android-how-can-i-get-the-current-foreground-activity-from-a-service

easy way to do that like the one I suggested above Send a broadcast Intent to the activity here is a sample project demonstrating.. method on that callback listener object Send an ordered broadcast Intent to the activity with a low priority BroadcastReceiver..

How to delete an SMS from the inbox in Android programmatically?

http://stackoverflow.com/questions/419184/how-to-delete-an-sms-from-the-inbox-in-android-programmatically

this question As of Android 1.6 incoming SMS message broadcasts android.provider.Telephony.SMS_RECEIVED are delivered as an.. are delivered as an ordered broadcast meaning that you can tell the system which components should.. can tell the system which components should receive the broadcast first. This means that you can intercept incoming message and..

Programmatically register a broadcast receiver

http://stackoverflow.com/questions/4805269/programmatically-register-a-broadcast-receiver

register a broadcast receiver I'd like to know what is the best practice way of.. is the best practice way of programmatically register a broadcast receiver. I want to register specific receivers according to.. to achieve this in code. Thank you Kr Miloud B. android broadcastreceiver share improve this question It sounds like you want..

how to use LocalBroadcastManager?

http://stackoverflow.com/questions/8802157/how-to-use-localbroadcastmanager

as described in google docs and Service broadcast doc i tried to google it but theres no code available to start.. the documents say that i should use it if i want to do broadcast internally with in my app's process but i dont know where to.. LocalBroadcastManager available in my project. android broadcastreceiver share improve this question I'll answer this anyway...

Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4)

http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4

file. Then I had to override the onReceive method of the BroadcastReceiver . I have included examples below. MainActivity.java.. String message PendingIntent piSent PendingIntent.getBroadcast mContext 0 new Intent SENT 0 PendingIntent piDelivered PendingIntent.getBroadcast.. Intent SENT 0 PendingIntent piDelivered PendingIntent.getBroadcast mContext 0 new Intent DELIVERED 0 SmsManager smsManager SmsManager.getDefault..

Using the Android RecognizerIntent with a bluetooth headset

http://stackoverflow.com/questions/14991158/using-the-android-recognizerintent-with-a-bluetooth-headset

android.bluetooth.BluetoothProfile import android.content.BroadcastReceiver import android.content.Context import android.content.Intent.. Thus if a call to startBluetoothSco is successful i.e mBroadcastReceiver will receive an ACTION_SCO_AUDIO_STATE_CHANGED with.. mContext.registerReceiver mBroadcastReceiver new IntentFilter BluetoothDevice.ACTION_ACL_CONNECTED..

Is there any way to receive a notification of when a user powers off his/her Android phone?

http://stackoverflow.com/questions/2190126/is-there-any-way-to-receive-a-notification-of-when-a-user-powers-off-his-her-and

on phones running Android 1.6 or later . You'll trap the Broadcast with a BroadcastReceiver . It will look something like this.. Android 1.6 or later . You'll trap the Broadcast with a BroadcastReceiver . It will look something like this public class ShutdownReceiver.. something like this public class ShutdownReceiver extends BroadcastReceiver @Override public void onReceive Context context Intent..

Restful API service

http://stackoverflow.com/questions/3197335/restful-api-service

mHandler new Handler public void handleMessage Message msg Broadcast to all clients the new value. final int N mCallbacks.beginBroadcast.. to all clients the new value. final int N mCallbacks.beginBroadcast for int i 0 i N i try switch msg.what case Config.ACTION_LOGIN.. switch msg.what case Config.ACTION_LOGIN mCallbacks.getBroadcastItem i .userLogIn msg.getData .getString response break default..

Android, Detect when other apps are launched

http://stackoverflow.com/questions/3290936/android-detect-when-other-apps-are-launched

part 2 is puzzling me and after many days reading up on Broadcast Intents etc and trying to listen for android.intent.action.MAIN..

Get referrer after installing app from Android Market

http://stackoverflow.com/questions/4093150/get-referrer-after-installing-app-from-android-market

app from Android Market I am trying to register a Broadcast Receiver that catches com.android.vending.INSTALL_REFERRER intents.. intent filter receiver and created a basic BroadcastReceiver class public class Receiver extends BroadcastReceiver.. BroadcastReceiver class public class Receiver extends BroadcastReceiver @Override public void onReceive Context context Intent..

Android - SMS Broadcast receiver

http://stackoverflow.com/questions/4117701/android-sms-broadcast-receiver

SMS Broadcast receiver I have been trying to get this program to work but.. SMS arrives. Here is my program package Technicaljar.SMSBroadcastReceiver import android.content.BroadcastReceiver import android.content.Context.. Technicaljar.SMSBroadcastReceiver import android.content.BroadcastReceiver import android.content.Context import android.content.Intent..

Enable and disable a Broadcast Receiver

http://stackoverflow.com/questions/5624470/enable-and-disable-a-broadcast-receiver

and disable a Broadcast Receiver I try to enable and disable a broadcast receiver by.. The Receiver public class OnNetworkChangedReceiver extends BroadcastReceiver private static final String TAG OnNetworkChangedReceiver..

Android - Share on Facebook, Twitter, Mail, ecc

http://stackoverflow.com/questions/6814268/android-share-on-facebook-twitter-mail-ecc

Paresh Mayani's answer is mostly correct. Simply use an Broadcast Intent to let the system and all the other apps choose in what..

Get GPS Location in a Broadcast Receiver/or Service to Broadcast Receiver data transfer

http://stackoverflow.com/questions/7709030/get-gps-location-in-a-broadcast-receiver-or-service-to-broadcast-receiver-data-t

GPS Location in a Broadcast Receiver or Service to Broadcast Receiver data transfer I am.. GPS Location in a Broadcast Receiver or Service to Broadcast Receiver data transfer I am new to android. I want to get GPS.. Questions Is it possible to get GPS Location data in Broadcast receiver Another alternative way I tried so far was to use a..

How to run a service every day at noon, and on every boot

http://stackoverflow.com/questions/7845660/how-to-run-a-service-every-day-at-noon-and-on-every-boot

PendingIntent pendingIntent PendingIntent.getBroadcast context 0 intent PendingIntent.FLAG_CANCEL_CURRENT Calendar.. for your interval public class AlarmReceiver extends BroadcastReceiver private final String SOMEACTION packagename.ACTION packagename.. phone has been shut down. public class AlarmSetter extends BroadcastReceiver @Override public void onReceive Context context Intent..

android app with service only

http://stackoverflow.com/questions/990217/android-app-with-service-only

any UI or user interaction so I am not using Activity. Broadcast receiver can listen to BOOT broadcast but how do I start service.. com.snctln.util.WeatherStatus import android.content.BroadcastReceiver import android.content.Context import android.content.Intent.. public class WeatherStatusServiceReceiver extends BroadcastReceiver @Override public void onReceive Context context Intent..

Android Broadcast Receiver for Sent SMS messages?

http://stackoverflow.com/questions/990558/android-broadcast-receiver-for-sent-sms-messages

Broadcast Receiver for Sent SMS messages I created a BroadcastReceiver.. Broadcast Receiver for Sent SMS messages I created a BroadcastReceiver and configured it with an android.provider.Telephony.SMS_RECEIVED.. Unfortunately there is currently no way to implement a BroadcastReceiver because the standard sms application uses a SmsManger..

Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4)

http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4

address str msgs i .getMessageBody .toString str n if contactId 1 showNotification contactId str send a broadcast intent to update the SMS received in the activity Intent broadcastIntent new Intent broadcastIntent.setAction SMS_RECEIVED_ACTION.. 1 showNotification contactId str send a broadcast intent to update the SMS received in the activity Intent broadcastIntent new Intent broadcastIntent.setAction SMS_RECEIVED_ACTION broadcastIntent.putExtra sms str context.sendBroadcast.. str send a broadcast intent to update the SMS received in the activity Intent broadcastIntent new Intent broadcastIntent.setAction SMS_RECEIVED_ACTION broadcastIntent.putExtra sms str context.sendBroadcast broadcastIntent public static..

Can we delete an SMS in Android before it reaches the inbox?

http://stackoverflow.com/questions/1741628/can-we-delete-an-sms-in-android-before-it-reaches-the-inbox

formatted messages in order to show them in a nice Android specific UI. As of Android 1.6 incoming SMS message broadcasts android.provider.Telephony.SMS_RECEIVED are delivered as an ordered broadcast &mdash meaning that you can tell the system.. As of Android 1.6 incoming SMS message broadcasts android.provider.Telephony.SMS_RECEIVED are delivered as an ordered broadcast &mdash meaning that you can tell the system which components should receive the broadcast first. If you define an android.. are delivered as an ordered broadcast &mdash meaning that you can tell the system which components should receive the broadcast first. If you define an android priority attribute on your SMS listening intent filter you will then receive the notification..

Intent action for network events in android sdk

http://stackoverflow.com/questions/2294971/intent-action-for-network-events-in-android-sdk

action for network events in android sdk I need to receive broadcasts for network actions like network connected disconnected etc. I am using a broadcast receiver for this purpose. Can anyone.. in android sdk I need to receive broadcasts for network actions like network connected disconnected etc. I am using a broadcast receiver for this purpose. Can anyone please tell me which intent action I need to capture for network events right now.. right now as per my search on internet I am using android.net.ConnectivityManager.CONNECTIVITY_ACTION . Here is my broadcast receiver class import android.content.BroadcastReceiver import android.content.Context import android.content.Intent public..

Open another application from your own (intent)

http://stackoverflow.com/questions/2780102/open-another-application-from-your-own-intent

an extended one. An application technically a process can have multiple activities services content providers and or broadcast listeners. If at least one of them is running the application is up and running the process . So what you have to identify..

How to Read MMS Data in Android?

http://stackoverflow.com/questions/3012287/how-to-read-mms-data-in-android

of getting MMS and SMS messages for instance when you receive a SMS and click on the notification bar it will send a broadcast intent like this content mms sms conversations XXX where XXX is the id of the conversation. Get a list of all conversations..

Background task, progress dialog, orientation change - is there any 100% working solution?

http://stackoverflow.com/questions/3821423/background-task-progress-dialog-orientation-change-is-there-any-100-working

go on regardless of what the user does in terms of activities e.g. downloading a large file . You can use an ordered broadcast Intent to either have the activity respond to the work being done if it is still in the foreground or raise a Notification..

Android: How can I get the current foreground activity (from a service)?

http://stackoverflow.com/questions/3873659/android-how-can-i-get-the-current-foreground-activity-from-a-service

Activity when an event occurs in the service . Is there a easy way to do that like the one I suggested above Send a broadcast Intent to the activity here is a sample project demonstrating this pattern Have the activity supply a PendingIntent e.g... the service via bindService and have the service call an event method on that callback listener object Send an ordered broadcast Intent to the activity with a low priority BroadcastReceiver as backup to raise a Notification if the activity is not on..

How to delete an SMS from the inbox in Android programmatically?

http://stackoverflow.com/questions/419184/how-to-delete-an-sms-from-the-inbox-in-android-programmatically

Has it been done Can it be done android sms share improve this question As of Android 1.6 incoming SMS message broadcasts android.provider.Telephony.SMS_RECEIVED are delivered as an ordered broadcast meaning that you can tell the system which.. As of Android 1.6 incoming SMS message broadcasts android.provider.Telephony.SMS_RECEIVED are delivered as an ordered broadcast meaning that you can tell the system which components should receive the broadcast first. This means that you can intercept.. are delivered as an ordered broadcast meaning that you can tell the system which components should receive the broadcast first. This means that you can intercept incoming message and abort broadcasting of it further on. In your AndroidManifest.xml..

Programmatically register a broadcast receiver

http://stackoverflow.com/questions/4805269/programmatically-register-a-broadcast-receiver

register a broadcast receiver I'd like to know what is the best practice way of programmatically register a broadcast receiver. I want to register.. register a broadcast receiver I'd like to know what is the best practice way of programmatically register a broadcast receiver. I want to register specific receivers according to user choice. As the registration is done through the manifest.. the manifest file I'm wondering if there's a proper way to achieve this in code. Thank you Kr Miloud B. android broadcastreceiver share improve this question It sounds like you want to control whether components published in your manifest..

how to use LocalBroadcastManager?

http://stackoverflow.com/questions/8802157/how-to-use-localbroadcastmanager

can any one tell me how to use locate LocalBroadcastManager as described in google docs and Service broadcast doc i tried to google it but theres no code available to start with the documents say that i should use it if i want to.. i tried to google it but theres no code available to start with the documents say that i should use it if i want to do broadcast internally with in my app's process but i dont know where to look for this any help comment Update I know how to use Broadcasts.. Update I know how to use Broadcasts but dont know how to get LocalBroadcastManager available in my project. android broadcastreceiver share improve this question I'll answer this anyway. Just in case someone needs it. ReceiverActivity.java An..

Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4)

http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4

I had to register a receiver in the AndroidMainfest.xml file. Then I had to override the onReceive method of the BroadcastReceiver . I have included examples below. MainActivity.java public class MainActivity extends Activity private static String.. to another device public static void sendSMS String phoneNumber String message PendingIntent piSent PendingIntent.getBroadcast mContext 0 new Intent SENT 0 PendingIntent piDelivered PendingIntent.getBroadcast mContext 0 new Intent DELIVERED 0 SmsManager.. piSent PendingIntent.getBroadcast mContext 0 new Intent SENT 0 PendingIntent piDelivered PendingIntent.getBroadcast mContext 0 new Intent DELIVERED 0 SmsManager smsManager SmsManager.getDefault int length message.length if length MAX_SMS_MESSAGE_LENGTH..

Using the Android RecognizerIntent with a bluetooth headset

http://stackoverflow.com/questions/14991158/using-the-android-recognizerintent-with-a-bluetooth-headset

import android.bluetooth.BluetoothHeadset import android.bluetooth.BluetoothProfile import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.content.IntentFilter import android.media.AudioManager.. would fail if the connected bluetooth device is not a headset Thus if a call to startBluetoothSco is successful i.e mBroadcastReceiver will receive an ACTION_SCO_AUDIO_STATE_CHANGED with intent extra SCO_AUDIO_STATE_CONNECTED then we assume that a.. bluetooth if mBluetoothAdapter null if mAudioManager.isBluetoothScoAvailableOffCall mContext.registerReceiver mBroadcastReceiver new IntentFilter BluetoothDevice.ACTION_ACL_CONNECTED mContext.registerReceiver mBroadcastReceiver new IntentFilter..

Is there any way to receive a notification of when a user powers off his/her Android phone?

http://stackoverflow.com/questions/2190126/is-there-any-way-to-receive-a-notification-of-when-a-user-powers-off-his-her-and

introduced in API Level 4 in other words it'll only be sent on phones running Android 1.6 or later . You'll trap the Broadcast with a BroadcastReceiver . It will look something like this public class ShutdownReceiver extends BroadcastReceiver @Override.. Level 4 in other words it'll only be sent on phones running Android 1.6 or later . You'll trap the Broadcast with a BroadcastReceiver . It will look something like this public class ShutdownReceiver extends BroadcastReceiver @Override public void.. trap the Broadcast with a BroadcastReceiver . It will look something like this public class ShutdownReceiver extends BroadcastReceiver @Override public void onReceive Context context Intent intent Insert code here You'll also need an entry in your..

Restful API service

http://stackoverflow.com/questions/3197335/restful-api-service

cb if cb null mCallbacks.register cb private final Handler mHandler new Handler public void handleMessage Message msg Broadcast to all clients the new value. final int N mCallbacks.beginBroadcast for int i 0 i N i try switch msg.what case Config.ACTION_LOGIN.. new Handler public void handleMessage Message msg Broadcast to all clients the new value. final int N mCallbacks.beginBroadcast for int i 0 i N i try switch msg.what case Config.ACTION_LOGIN mCallbacks.getBroadcastItem i .userLogIn msg.getData.. final int N mCallbacks.beginBroadcast for int i 0 i N i try switch msg.what case Config.ACTION_LOGIN mCallbacks.getBroadcastItem i .userLogIn msg.getData .getString response break default super.handleMessage msg return catch RemoteException..

Android, Detect when other apps are launched

http://stackoverflow.com/questions/3290936/android-detect-when-other-apps-are-launched

leaving the Email app on top I'm ok doing the rest of it just part 2 is puzzling me and after many days reading up on Broadcast Intents etc and trying to listen for android.intent.action.MAIN etc in my trial projects I can't seem to detect when an..

Get referrer after installing app from Android Market

http://stackoverflow.com/questions/4093150/get-referrer-after-installing-app-from-android-market

referrer after installing app from Android Market I am trying to register a Broadcast Receiver that catches com.android.vending.INSTALL_REFERRER intents launched by Android after an app is installed from the.. true intent filter action android name com.android.vending.INSTALL_REFERRER intent filter receiver and created a basic BroadcastReceiver class public class Receiver extends BroadcastReceiver @Override public void onReceive Context context Intent intent.. intent filter receiver and created a basic BroadcastReceiver class public class Receiver extends BroadcastReceiver @Override public void onReceive Context context Intent intent Bundle extras intent.getExtras String referrerString..

Android - SMS Broadcast receiver

http://stackoverflow.com/questions/4117701/android-sms-broadcast-receiver

SMS Broadcast receiver I have been trying to get this program to work but so far having no luck. I cannot find where I am doing wrong... with the code or debugging. I'm trying to be notified if a new SMS arrives. Here is my program package Technicaljar.SMSBroadcastReceiver import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.os.Bundle.. be notified if a new SMS arrives. Here is my program package Technicaljar.SMSBroadcastReceiver import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.os.Bundle import android.telephony.SmsMessage..

Enable and disable a Broadcast Receiver

http://stackoverflow.com/questions/5624470/enable-and-disable-a-broadcast-receiver

and disable a Broadcast Receiver I try to enable and disable a broadcast receiver by using this PackageManager method setComponentEnabledSetting.. intent filter receiver The Receiver public class OnNetworkChangedReceiver extends BroadcastReceiver private static final String TAG OnNetworkChangedReceiver @Override public void onReceive Context context Intent..

Android - Share on Facebook, Twitter, Mail, ecc

http://stackoverflow.com/questions/6814268/android-share-on-facebook-twitter-mail-ecc

android facebook twitter share share improve this question Paresh Mayani's answer is mostly correct. Simply use an Broadcast Intent to let the system and all the other apps choose in what way the content is shared. To share text use the following..

Get GPS Location in a Broadcast Receiver/or Service to Broadcast Receiver data transfer

http://stackoverflow.com/questions/7709030/get-gps-location-in-a-broadcast-receiver-or-service-to-broadcast-receiver-data-t

GPS Location in a Broadcast Receiver or Service to Broadcast Receiver data transfer I am new to android. I want to get GPS Location in a broadcast.. GPS Location in a Broadcast Receiver or Service to Broadcast Receiver data transfer I am new to android. I want to get GPS Location in a broadcast receiver but it shows an error. My.. Log.d location location loc.getLatitude Questions Is it possible to get GPS Location data in Broadcast receiver Another alternative way I tried so far was to use a service which is invoked by the Broadcast receiver. The service..

How to run a service every day at noon, and on every boot

http://stackoverflow.com/questions/7845660/how-to-run-a-service-every-day-at-noon-and-on-every-boot

Intent context AlarmReceiver.class intent.setAction packagename.ACTION PendingIntent pendingIntent PendingIntent.getBroadcast context 0 intent PendingIntent.FLAG_CANCEL_CURRENT Calendar calendar Calendar.getInstance calendar.setTimeInMillis System.currentTimeMillis.. AlarmManager.INTERVAL_DAY pendingIntent Receiver for your interval public class AlarmReceiver extends BroadcastReceiver private final String SOMEACTION packagename.ACTION packagename is com.whatever.www @Override public void onReceive.. call a service etc. Receiver for resetting alarms whenever phone has been shut down. public class AlarmSetter extends BroadcastReceiver @Override public void onReceive Context context Intent intent get preferences SharedPreferences preferences context.getSharedPreferences..

android app with service only

http://stackoverflow.com/questions/990217/android-app-with-service-only

find a way how to start that service. Application can not have any UI or user interaction so I am not using Activity. Broadcast receiver can listen to BOOT broadcast but how do I start service first time when it is installed and how can I keep it running.. that you can use as a broadcast receiver for the events. package com.snctln.util.WeatherStatus import android.content.BroadcastReceiver import android.content.Context import android.content.Intent public class WeatherStatusServiceReceiver extends BroadcastReceiver.. import android.content.Context import android.content.Intent public class WeatherStatusServiceReceiver extends BroadcastReceiver @Override public void onReceive Context context Intent intent if intent.getAction null if intent.getAction .equals..

Android Broadcast Receiver for Sent SMS messages?

http://stackoverflow.com/questions/990558/android-broadcast-receiver-for-sent-sms-messages

Broadcast Receiver for Sent SMS messages I created a BroadcastReceiver and configured it with an android.provider.Telephony.SMS_RECEIVED.. Broadcast Receiver for Sent SMS messages I created a BroadcastReceiver and configured it with an android.provider.Telephony.SMS_RECEIVED action filter so it is called everytime the phone.. android sms broadcastreceiver share improve this question Unfortunately there is currently no way to implement a BroadcastReceiver because the standard sms application uses a SmsManger to send the messages but specifies concrete internal classes..