Android :: IP Broadcast On Emulator
Oct 15, 2009
I 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
Feb 4, 2009
I 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.
View 5 Replies
View Related
Aug 13, 2010
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 Related
Sep 28, 2009
trying 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 Related
Oct 5, 2009
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?
View 1 Replies
View Related
Aug 6, 2010
I created a sqlite database to store playlists for a media player I am developing because of extended feature (rather than using the Content Provider). It works perfectly on the 1.6 emulator but FCs on anything higher than 2.0... what has changed that I need to know about as far as opening databases in SDK 2.0+? Here is the logcat.
CODE:.............
Here is the dbhelper class
CODE:................
why can't stackoverflow just use tags like a normal syntax highlighter.
View 2 Replies
View Related
May 19, 2009
Unable to play youtube videos on SDK 1.5 emulator - but playing well on SDK 1.0 emulator. Can you update the source....
View 7 Replies
View Related
Apr 13, 2010
Finally strace gave me this:
CODE:................
And several other attempts to call "link" that also fail (sshfs does not support hard links).
Is it possible to change the emulator's behavior to create lock files somewhere in /tmp (using some hash of image path as lock file name)? I am OK to try this myself: which repositories from https://android.git.kernel.org/ are necessary to rebuild the emulator alone, and where in the sources is the code responsible for image locks?
View 4 Replies
View Related
Apr 20, 2009
I need to run several emulator instances to test my application. When i try to run instances using emulator -data <path> option, the emulator crashes.
I got a MS Visual Studio window informing that emulator throws a "unhandled win32 exception".
The exception message in the debugger (MS Visual Studio 2008) is: "Unhandled exception at 0x77c4706c in emulator.exe: 0xC0000005: Access violation reading location 0x03216848"
The emulator runs normally without "-data" option.
View 2 Replies
View Related
Nov 1, 2010
I am getting the following error when I try running my program in the emulator:
emulator: ERROR: the user data image is used by another emulator. aborting`
View 1 Replies
View Related
Apr 8, 2009
Is there a way to reload an Android application in the emulator without closing the emulator, saving any code changes, and running the emulator again? If I make even a simple change to the layout, it takes about 30 seconds by time I run it in Eclipse and Android "boots", and I can unlock the emulator to run the application. Is there any way to shorten this time when making changes, or is it something I just have to deal with?
View 3 Replies
View Related
Mar 16, 2010
I downloaded the most recent version of Android for linux (android-sdk_r05-linux_86.tgz). I was trying to use the the Android Ant task(s) for packaging, building, and deploying my code. I should mention that I'm running AMD64, but have the 32-bit libraries installed. The Android Ant tasks are all broken.
First, the start-emulator task never gets the emulator running. It does get past starting adb, but then just sits there.
Second, the SDK is missing the aapt binary in the tools directory. So, the example notepad sample application will not even package correctly.
I have all the dependencies configured for Android. I can run it from the command line just fine.I assume the Ant code is out of sync with the recent SDK updates. Can anyone shed some light on this problem? At this point, I'm considering writing my own Python scripts to interact with the Android SDK. Ugh.
View 1 Replies
View Related
Oct 30, 2010
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.
View 13 Replies
View Related
Jul 19, 2010
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 Related
Sep 9, 2009
I 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 Related
Dec 30, 2009
Is 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 Related
Jul 1, 2010
is 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 Related
Mar 26, 2010
I'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:................................
View 1 Replies
View Related
Jul 9, 2009
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 Related
Feb 12, 2010
A 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
Jul 23, 2010
I am working on one project where i am using broadcast receiver in one of my activity to capture the incomming call and its works fine. when one of my other activity is open and that time if call is come then my broadcast receiver is fail to respond. can any one help me for this ? or its nessesorry to declare broadcast receiver in all my activity to do some comman task.
View 5 Replies
View Related
Dec 2, 2009
I am making a widget that needs a broadcast receiver, like the one in com.example.android.apis.appwidget.ExampleBroadcastReceiver. However, the example defines Intent.ACTION_TIMEZONE_CHANGED in the manifest, but there are some that do not allow this. For example, Intent.ACTION_TIME_TICK says "You can not receive this through components declared in manifests, only by exlicitly registering for it with Context.registerReceiver(). "
So I removed the manifest declarations and tried replacing the AppWidgetProvider.onEnabled function that was in the example with a call like the following: context.registerReceiver(myReceiver, new IntentFilter(Intent.ACTION_TIME_TICK));
(where "myReceiver" is an instance of the receiver I want.) However, when I try to run the code, I get the following error:
Unable to start receiver...android.content.ReceiverCallNotAllowedException: IntentReceiver components are not allowed to register to receive intents.
Any way to get this broadcast receiver working from a widget?
View 3 Replies
View Related
Jul 29, 2009
I am broadcasting an Intent from an activity. Can we make another application as a receiver. So that it will get invoked when that specific intent is broadcasted.
View 2 Replies
View Related
Jan 6, 2010
I wish to listen to android.intent.action.BOOT_COMPLETED. However I am not getting the broadcast intent, if I specify com.test.BootBroadcastReceiver in the manifest. When I change this value to simply BootBroadcastReceiver, then I am getting the broadcast intent.
<receiver android:name="BootBroadcastReceiver" android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
My package in the manifest file is:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test"
And the BootBroadcastReceiver resides in this package. What is the reason behind this?
View 2 Replies
View Related
Aug 17, 2009
I have an application that uses an extended Broadcast Receiver class inside the Activity. I have the extended Broadcast Receiver class as a member variable of the Activity class. But it looks like the receiver references keep changing between its construction and 'on Receive' method call. I would like to understand this better. Here are some details. public class MyEventReceiver extends Broadcast Receiver
View 3 Replies
View Related
Oct 3, 2009
I was wondering if its possible to have a broadcast receiver to listen when the app its in launches.I tried doing by creating a BroadcastReceiver to listen for the android.intent.action.MAIN action but it never gets called?Is there something I need to do or a different action I should be listening for?
View 3 Replies
View Related
May 1, 2010
I have here two applications in two different projects in eclipse. One application
(A) defines an activity
(A1) which is started first. Then i start from this activity the second activity
(B1) in the second project
(B). This works fine.
Unfortunately, the message is never received. Although the method in activity A1 is called, i never receive an intent in B1.
View 1 Replies
View Related
Jun 13, 2009
I created a BroadcastReceiver and configured it with an android.provider.Telephony.SMS_RECEIVED action filter so it is called everytime the phone receives a text.Is there some event/action or other way for my application to be notified whenever the phone sends a text (preferably independent of the application that sends it)?So far the only option I see is to poll the content provider for content://sms/sent which doesn't even give me all sent texts because applications can choose not to put it there.
View 1 Replies
View Related
Mar 16, 2010
something weird just started happening. my app has a broadcast receiver which may access the network when invoked. the code has been solid for ages, but in the last few days it has started getting DNS errors on perfectly fine hosts. these are hosts which can be reached without problems in the main app or from other apps.interestingly i've seen another app get DNS errors too another app with a broadcast receiver.seems to affect all OS versions -- we have 1.5, 1.6, and 2.01 here. i don't have a Nexus to test 2.1, though. are there caveats to doing network inside broadcast receivers? i didn't think so, as ours worked fine until the time change [fx: twilight zone theme]
View 6 Replies
View Related
Oct 24, 2010
The symptom: I have a broadcast receiver that listen to sms, when a sms is received, i call an activity to display. It works all fine if the screen is on and not locked. But when screen is locked, and as soon as i received the sms, the activity popup for a second then disappeared and I use the code to unlock the screen.
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
I think it might be the competitions with phone default sms program (the sms default program shows a notification only). I am wondering is there a way to set priority to broadcast receivers or even the activity that receiver stared, to avoid the conflicts between multiple receivers. or set orders to execute one by one? I have tried to thread.sleep my receiver for a second, still not working.
View 2 Replies
View Related