Android :: Receive An Event Via Broadcast?
Nov 9, 2010Is there any way to receive an event via a broadcast or any other way when new activity starts or any task in android?
View 1 RepliesIs there any way to receive an event via a broadcast or any other way when new activity starts or any task in android?
View 1 RepliesI have an app that I want to start when people receive a text. Is this possible?
View 3 Replies View RelatedI'm trying to receive Android's Broadcast message say MEDIA_SCANNER_FINISHED, but not able to do so. Here is my code snippet:
CODE:..............
I know that the apps receive a ACTION_SHUTDOWN broadcast event when the device is shutting down.
When an application receives the shutdown, is there still an opportunity to send data packets out, or does android block such attempts(or does the platform tear down the network stack before it can go out).
I want to receive a broadcast receiver whenever any app is started.
for example: I have an app which has the broadcast receiver which listens for the app started event .
I installed this app on the device.
Now I have opened the Phone or Contacts app. Now my app which is listening for this kind of event(app opened or started) has to be invoked.
I want to create an app in which I need to send SMS to a predefined number after first boot up of Phone. I want to do this without user intervention. i.e I don't want to create launcher icon.For that i am using a Broadcast receiver which will receive "android.intent.action.BOOT_COMPLETED" event and I can send SMS from this receiver after some duration. This mechanism works fine till Android Version 3.1. I came to know that in later versions A broadcast receiver will not receive an event if Application is not activated at least once. Due to this security measure adopted in Android 3.1+ This mechanism is not working. Any alternate way to meet my requirement.
View 1 Replies View RelatedHow to show a alert dialog(whithout any Activity) when receive a broadcast.
View 3 Replies View RelatedI have a service in an APK which starts a Thread which has the following in it's run method; Code...
But the receiver doesn't receive the broadcast when I run it in the emulator (or at least the log message doesn't get received). Any hints?
The views expressed in this email are those of the author and not necessarily those of Funky Android Limited, it's associates, or it's subsidiaries.
I have an application which is playing audio.I have some customers that use this application while driving and who also use the Google Maps application to get directions to the places where they are driving.They have asked me to change my application to pause my audio while the Google Maps application is giving them audio navigation instructions. I am trying to find out if I can register a Broadcast Receiver to let me know when the Google Maps application is giving audio navigation instructions, or if there is a way to detect when any other application has started or stopped playing audio.It seems that this type of functionality would be beneficial for Google Maps and for any type of application which is playing media, so I am hoping that Google Maps is broadcasting events when it starts and stops giving audio navigation instructions, or that there is a generic way to discover when overlapping audio sources are trying to play.
View 6 Replies View RelatedIt is easy to find on google which is the broadcast receiver to listen for sms messages. Is there also a similar receiver to listen for gtalk messages or new emails?
View 1 Replies View RelatedI was make source to catch and process SD Card mount/unmount broadcast received dynamically in activity.
but the USM_CONNECTED/DISCONNECTED broadcast msg is not catched dynamically in activity like below:.
how the receiver can receive the UMS msg in activity?
below:
CODE:......................
I have a text view and launched soft keypad above it. Now what I want to do is that when the user presses the HARDWARE CLR button, the activity should receive the CLR key event. But my activity can't receive the event. Just soft keypad disappeared. Is it normal behavior? Is there any way to receive the hardware key event?
View 2 Replies View RelatedI have two activities. The first activity display list of the users with short info. And after select some user I go to the second activity for display full info about this user. For send event I used startActivityForResult(); for receive event in socond activity and added public void onActivityResult(int requestCode, int resultCode, Intent data). After start project I send intend from first activity and I do not receive in the second : How I can receive sent event in second activity.
View 1 Replies View RelatedAs known, when using the setContentView() method, a view can be displayed on screen.
My question is whether there is a way to receive an event when the view is actually displayed on screen (since it takes some time for the view actually being displayed after the setContentView() method has been called).
I added broadcast listener "BATTERY_CHANGED" to Android Manifest file so that when the status changed I should get informed. I am adding to Android Manifest file as I want it active through my application life time. But the problem is that I am not getting the broad cast event from the system when battery status changes.
My code is here :-
<receiver android:name=".MyBroadcastReceiver" android:enabled="true"
android:permission="android.permission.BROADCAST_STICKY">
<intent-filter>
<action android:name="android.intent.action.BATTERY_CHANGED" />
</intent-filter> </receiver>
<uses-permission android:name="android.permission.BATTERY_STATS"/>
<uses-permission android:name="android.permission.BROADCAST_STICKY"/>
I'm trying to figure out if a system event broadcast is broadcasted using ordered broadcast or normal.The event is EVENT_REMINDER and in the source for the calendarprovider i noticed it sets up a alarmmanager to sent the broadcast. I can't find how the alarmmanager sends it. My guess would be as a normal broadcast , But while i was trying some things i noticed i could delay the system's notification (tried up to 10 sec) by building a sleep in my broadcastreceiver. This would indicate that they are handled ordered , and the systems receiver is only called when mine has finished. But can i be sure of this behavour?? (in all 1.5> sdk versions) the docs state that in some cases normal broadcasts are also handled ordered..due to spare of resources.
View 1 Replies View Relatedtrying to create a broadcast receiver which responds to system events and change system settings. I don't need any interaction from the user so I don't need an activity and have been trying to do everything through the manifest file. I've put a log event into my onReceive method but it never logs anything so I'm presuming my method is never called. I've tried this with both the 1.5 and 1.6 SDKs. I was hoping somebody could have a look at my code please and let me know if there are any problems.
View 2 Replies View RelatedI use onLongClick and onClick events of a button to get user inputs. Whenever; the user long click and triggers onLongClick event, the onClick event is also triggered. I couldn't find my problem. The code of two methods are shown in below: Code...
View 2 Replies View RelatedI hope there is a way to resolve this or bye bye hero.
View 10 Replies View RelatedIf i turn this off while I am home or in my dorm and connected to wi-fi
can I
1) Receive Texts
2)Send/Receive Pics
3)Make Calls?
I am developing an application which is communicating with the server. Tha application can perform log-in and get different parameters from server.
The application consists of a RESTful client (custom class for making requests), Communication Service (the service which runs in the background) and the main activity.
For now I created multiple broadcast messages and multiple broadcast receivers in the main activity so when the application performs login operation a receiver (loginBroadcastReceiver) in the main activity receives a message and when another parameter is received from the server different message is broadcasted and another receiver handles the message.
This way however the application performance is poor but I am not sure whether it is due to multiple broadcast receivers.
Does anyone know what is the best way to exchange data between service and main activity - is it better to create a single broadcast receiver and retrieve all parameters from message or is it better to initialize multiple broadcast receivers for multiple parameters?
I have an IntentService that broadcasts an Intent each time if finishes some work. Each broadcast Intent is identical except that it contains a Bundle with some result information from the IntentService. Evidently, having different data in the Bundle is not enough for Android to think it's a different Intent. If the IntentService broadcasts two of these Intents back-to-back, the second one is dropped as a duplicate.
I know I've read about this behavior in this forum in the past but I can't find in the documentation where this duplicate elimination logic is described in detail. Mostly, I just want to differentiate the Intents enough that they are not considered duplicates. Any pointers would be appreciated.
I'm pretty sure no one but me is using UDP broadcasts but in the rare chance that someone is - has any experienced this? I use UDP broadcast to do LAN multiplayer games - it's how clients discover hosts of games.The EVO can't ever see the games when all my other phones can.
View 4 Replies View RelatedI had one question: Is it feasible to use a BroadcastReceiver as a glue layer between the user interface and the underlying business logic ? Example use case: Suppose i am maintaining the state of a call, and providing callbacks to the UI by invoking sendBroadcast with the relevant intent. Similarly, my underlying business logic can send broadcasts to the activity that has registered for receiving it on certain events ( like call connected, connecting, timed out etc).
View 4 Replies View RelatedIs it possible to use just a broadcast receiver without any activities? I just want to run some sample code only when the phone receives a call and nothing more. I use Log.d to write out but I don't see anything in the log. Am I missing something here? I also have permissions set in the androidmanifest.xml to allow for these type of intents.
View 3 Replies View Relatedis there any way to be notified (using a broadcast receiver) after a sms is sent? i want to get notified when a sms is sent and carry on with my program.
View 7 Replies View RelatedI have an application that acts as both client and server. I have a scenario that I need to test that involves three devices. One of them needs to broadcast a message (UDP) to the other two. Running on physical devices, this is not a problem, and it works fine. On the emulator however, this is much harder. I have managed to get it work for two devices using the emulator. Here my client thread broadcast the message to 10.0.2.255 port 6002, and server thread listens on port 6006. By using redir add udp:6002:6006 the server receives the message fine. Now, if I add another instance and do the same portforwarding, only one of them receives the message. I also tried to use a different port number on the server, and forward port 6002 to that number, with the same result. It appears as if a port can only be forwarded from one instance. Does anyone of a method to broadcast using the emulator, without sending a separate message to each emulator instance?
View 4 Replies View RelatedI've tried these phones: Motorolla Backflip 1.5, Nexus One 2.1
Basically I register BroadcastReceiver to get ACTION_HEADSET_PLUG broadcast and look on 3 extras that come in intent:
state
name
microphone
Here is the description from API:
* state - 0 for unplugged, 1 for plugged.
* name - Headset type, human readable string
* microphone - 1 if headset has a microphone, 0 otherwise
Issue #1: Broadcast comes when activity is started (not expected), when screen rotation happens (not expected) and when headset/headphones plugged/unplugged (expected).
Issue #2: Backflip phone (1.5) sends null for state + microphone, 'No Device' as name when headset/headphones unplugged, and sends null for state + microphone, 'Stereo HeadSet'/'Stereo HeadPhones' as name when headset/headphones plugged.
UPDATE: T-Mobile G1 with 1.6 behaves the same as Backflip phone.
Nexus even worse, it always sends null for state + microphone, 'Headset' as name when headset/headphones plugged or unplugged.
Question: How it can be explained that API is broken so much on both 1.5 and 2.1 versions and different devices, manufactures?
UPDATE:
Code in onCreate of main Activity:
CODE:.........................
Now the code of BroadcastReceiver:
CODE:................................
I am trying to start TTS from a broadcast receiver and it as document an intent receiver can't bind the service. Is there a work around, I can't figure out how to start the service using startService(Intent, Bundle).
View 4 Replies View RelatedA WAP PUSH (Broadcast)receiver basically doesn't need any UI. It is a silence application which handles the Push messages based on actions/ mimetype without needing any intreaction with user, I've tried to test it in a SMS receiver by removing the Activity from the project and it stopped receiving the SMS messages. My question: Does all android applications "MUST" define a activity? Is there a way to hide it?
View 5 Replies View Related