broadcast

How to send and receive broadcast message

谁说胖子不能爱 提交于 2019-11-26 22:41:00
问题 I am trying to pass data between two activities that are inside of tabs. I am trying to use sendBroadcast() . With breakpoints set I never reach onReceive() . Manifest: <activity android:name=".WebResults" android:label="@string/app_name"> <intent-filter> <action android:name="com.toxy.LOAD_URL" /> </intent-filter> </activity> Activity Sender: Intent intent=new Intent(getApplicationContext(),WebResults.class); intent.setAction("com.toxy.LOAD_URL"); intent.putExtra("url",uri.toString());

UDP Broadcast in Java

天大地大妈咪最大 提交于 2019-11-26 21:23:00
问题 Morning. I'm pretty new in Java and socket connections but I'm trying to send out a UDP packet/broadcast on 255.255.255.255 on port 8001 to a device. I can get the data to send just fine, however when it comes time to receive the data the connection times out. I have a packet sniffer and I can see the packet send and then the device respond. I'm pretty sure it is a rookie mistake that I'm missing in my code but I've been stuck on it for awhile and any help would be appreciated. m_Socket = new

boost::asio UDP broadcasting

萝らか妹 提交于 2019-11-26 20:54:24
问题 I want to broadcast UDP messages to all computers in a local network using boost::asio . Working through the examples I came up with try { socket.open(boost::asio::ip::udp::v4()); boost::asio::socket_base::broadcast option(true); socket.set_option(option); endpoint = boost::asio::ip::udp::endpoint( boost::asio::ip::address::from_string("192.168.1.255"), port); } catch(std::exception &e) { } and want to broadcast messages from my queue with while(!queue.empty()) { std::string message = queue

Broadcast to Icecast / SHOUTcast with Objective-C, C, or C++

北城以北 提交于 2019-11-26 17:33:11
问题 I want to provide audio data into SHOUTcast or Icecast servers without using their own broadcaster, since i will be using this on various platforms including mobile. I need protocol descriptions, open source projects, or samples to be able to send audio data (from mic or file) using Objective-C, C or C++ to SHOUTcast and Icecast servers. Where can I find the information needed to build a proper SHOUTcast/Icecast source client? 回答1: Comment: It's about time someone makes a SHOUTcast source

Android : restart application after update - ACTION_PACKAGE_REPLACED

一个人想着一个人 提交于 2019-11-26 16:49:28
问题 My application that is not on Play Store verify on the web If there are a new version and download and start it. After the installation I would like to restart the application and I would use a BroadcastRecevier with ACTION_PACKAGE_REPLACED . This is the code : Broadcast: public void onReceive(Context context, Intent intent) { if(intent.getAction().equals(Intent.ACTION_PACKAGE_REPLACED)){ ApplicationInfo app = new ApplicationInfo(); if(app.packageName.equals("it.android.downloadapk")){ Intent

AudioSource.VOICE_CALL not working in android 4.0 but working in android 2.3

非 Y 不嫁゛ 提交于 2019-11-26 16:09:21
问题 VOICE_CALL, VOICE_DOWNLINK ,VOICE_UPLINK not working on android 4.0 but working on android 2.3 (Actual Device),I have uploaded a dummy project to record all outgoing call so that you can see it for your self http://www.mediafire.com/?img6dg5y9ri5c7rrtcajwc5ycgpo2nf you just have to change audioSource = MediaRecorder.AudioSource.MIC; to audioSource = MediaRecorder.AudioSource.VOICE_CALL; on line 118 in TService.java If you come across any error, tell me. Any suggestion related to it will be

How can I update a broadcast variable in spark streaming?

喜你入骨 提交于 2019-11-26 15:57:20
I have, I believe, a relatively common use case for spark streaming: I have a stream of objects that I would like to filter based on some reference data Initially, I thought that this would be a very simple thing to achieve using a Broadcast Variable : public void startSparkEngine { Broadcast<ReferenceData> refdataBroadcast = sparkContext.broadcast(getRefData()); final JavaDStream<MyObject> filteredStream = objectStream.filter(obj -> { final ReferenceData refData = refdataBroadcast.getValue(); return obj.getField().equals(refData.getField()); } filteredStream.foreachRDD(rdd -> { rdd.foreach

DownloadManager.ACTION_DOWNLOAD_COMPLETE broadcast receiver receiving same download id more than once with different download statuses in Android

心已入冬 提交于 2019-11-26 15:35:40
问题 I am using Android DownloadManger System Service for downloading some files in following way dwnId = mgr.enqueue(new DownloadManager.Request(serveruri) .setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI | DownloadManager.Request.NETWORK_MOBILE) .setAllowedOverRoaming(false) .setTitle(getAlbumName()) .setDescription(getTrackName()) .setDestinationUri(deviceUri) .setShowRunningNotification(true)); where mgr is Download Manager instance, dwnId is unique ID returned. I am also

WebRTC - scalable live stream broadcasting / multicasting

旧时模样 提交于 2019-11-26 14:59:29
问题 PROBLEM: WebRTC gives us peer-to-peer video/audio connections. It is perfect for p2p calls, hangouts. But what about broadcasting (one-to-many, for example, 1-to-10000)? Lets say we have a broadcaster "B" and two attendees "A1", "A2". Of course it seems to be solvable: we just connect B with A1 and then B with A2. So B sends video/audio stream directly to A1 and another stream to A2. B sends streams twice. Now lets imagine there are 10000 attendees: A1, A2, ..., A10000. It means B must send

Problems with SO_BINDTODEVICE Linux socket option

Deadly 提交于 2019-11-26 13:51:53
问题 I have a PC with two network cards. One ( eth0 ) is for LAN/internet and the other for UDP communication with one microcontroller device. The microcontroller has an IP (192.168.7.2) and a MAC address. The second pc network adapter ( eth1 ) has 192.168.7.1. The microcontroller has a very simple IP stack, so the easiest way for the mc to send UDP packets is to broadcast them. On the PC side I'd like to receive the broadcasts - but only from eth1 . So I try to bind the UDP socket to the eth1