<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Broadcast Receiver Archives - Truiton</title>
	<atom:link href="https://www.truiton.com/tag/broadcast-receiver/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Technology Reaching Us In Time - Online</description>
	<lastBuildDate>Thu, 21 Nov 2019 13:45:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/www.truiton.com/wp-content/uploads/2022/11/cropped-truiton_new_logo_half_white.png?fit=32%2C32&#038;ssl=1</url>
	<title>Broadcast Receiver Archives - Truiton</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">54534495</site>	<item>
		<title>Android Service and BroadcastReceiver Example</title>
		<link>https://www.truiton.com/2014/09/android-service-broadcastreceiver-example/</link>
					<comments>https://www.truiton.com/2014/09/android-service-broadcastreceiver-example/#comments</comments>
		
		<dc:creator><![CDATA[Mohit Gupt]]></dc:creator>
		<pubDate>Sat, 27 Sep 2014 15:29:23 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Android Service with Broadcasts]]></category>
		<category><![CDATA[Broadcast Receiver]]></category>
		<category><![CDATA[Service]]></category>
		<category><![CDATA[Service Activity Communication]]></category>
		<guid isPermaLink="false">http://www.truiton.com/?p=699</guid>

					<description><![CDATA[<p>A very useful and important concept of Android is services, I was going through Truiton, and saw I have nothing on Android Services. So I decided, to write some interesting stuff that one can do with Android services. First off lets start with some basic intro to services. Android Services Introduction There are times when&#8230;&#160;<a href="https://www.truiton.com/2014/09/android-service-broadcastreceiver-example/" rel="bookmark">Read More &#187;<span class="screen-reader-text">Android Service and BroadcastReceiver Example</span></a></p>
<p>The post <a href="https://www.truiton.com/2014/09/android-service-broadcastreceiver-example/">Android Service and BroadcastReceiver Example</a> appeared first on <a href="https://www.truiton.com">Truiton</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-image"><figure class="aligncenter"><img data-recalc-dims="1" fetchpriority="high" decoding="async" width="640" height="427" data-attachment-id="705" data-permalink="https://www.truiton.com/2014/09/android-service-broadcastreceiver-example/android-broadcast-service/" data-orig-file="https://i0.wp.com/www.truiton.com/wp-content/uploads/2014/09/Android-Broadcast-Service.jpg?fit=640%2C427&amp;ssl=1" data-orig-size="640,427" data-comments-opened="1" data-image-title="Android Broadcast Service" data-image-description="&lt;p&gt;Photo Credit: &lt;a href=&quot;https://www.flickr.com/photos/64576282@N00/373673511/&quot;&gt;FrogMiller&lt;/a&gt; via &lt;a href=&quot;http://compfight.com&quot;&gt;Compfight&lt;/a&gt; &lt;a href=&quot;https://www.flickr.com/help/general/#147&quot;&gt;cc&lt;/a&gt;&lt;/p&gt;
" data-image-caption="" data-large-file="https://i0.wp.com/www.truiton.com/wp-content/uploads/2014/09/Android-Broadcast-Service.jpg?fit=640%2C427&amp;ssl=1" src="https://i0.wp.com/www.truiton.com/wp-content/uploads/2014/09/Android-Broadcast-Service.jpg?resize=640%2C427" alt="Android Service with BroadcastReceiver" class="wp-image-705" srcset="https://i0.wp.com/www.truiton.com/wp-content/uploads/2014/09/Android-Broadcast-Service.jpg?w=640&amp;ssl=1 640w, https://i0.wp.com/www.truiton.com/wp-content/uploads/2014/09/Android-Broadcast-Service.jpg?resize=300%2C200&amp;ssl=1 300w" sizes="(max-width: 640px) 100vw, 640px" /></figure></div>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">A very useful and important concept of Android is services, I was going through <a title="Truiton" href="http://www.truiton.com" target="_blank" rel="noopener noreferrer">Truiton</a>, and saw I have nothing on Android Services. So I decided, to write some interesting stuff that one can do with <a title="Android Services" href="http://developer.android.com/guide/components/services.html" target="_blank" rel="noopener noreferrer">Android services</a>. First off lets start with some basic intro to services.</p>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading">Android Services Introduction</h2>



<p class="wp-block-paragraph">There are times when one wants to perform some long running operation on a device. Like processing of some data, establishing a two way connection over a network; to download a file from the internet, or maybe just play some music on a device. In all these situations one would require an Android component which can do processing in the background, i.e. should not have an UI. That component is called Android Service.</p>



<p class="wp-block-paragraph"><span style="text-decoration: underline;">Please Note:</span> <em>Do not get confused by the word background here, Android Service runs on main thread, unless a new thread is spawned for it.</em></p>



<p class="wp-block-paragraph">Although in this <a title="Android Service and BroadcastReceiver Example" href="http://www.truiton.com/2014/09/android-service-broadcastreceiver-example/">Android Service and BroadcastReceiver Example</a>, I have taken care of this situation by doing all the processing in a separate thread. By taking this approach I averted the situation where app could be laggy, or go in an ANR state. Also its a good programming practice in Android to do heavy operations in a thread other than main thread.</p>



<p class="wp-block-paragraph">Broadly speaking Android Services are of two types, <span style="text-decoration: underline;">started</span> and <span style="text-decoration: underline;">bound</span>, although a single service could act as started and bound both. I will show how this could be done in a separate tutorial. Here in this Android Service and BroadcastReceiver Example, I would mainly concentrate on started services. Lets start off by declaring the service in app manifest:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="xml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">&lt;?xml version="1.0" encoding="utf-8"?>
&lt;manifest package="com.truiton.servicebroadcasts"
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:versionCode="1"
          android:versionName="1.0">

    &lt;application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">
        &lt;activity
            android:name=".MainActivity"
            android:label="@string/app_name">
            &lt;intent-filter>
                &lt;action android:name="android.intent.action.MAIN"/>

                &lt;category android:name="android.intent.category.LAUNCHER"/>
            &lt;/intent-filter>
        &lt;/activity>

        &lt;service android:name=".BroadcastService">
        &lt;/service>
    &lt;/application>

&lt;/manifest></pre>



<h2 class="wp-block-heading">Android Service : Started</h2>



<p class="wp-block-paragraph">When a service is not bound to any app component, and is started by a call to <a rel="noopener noreferrer" href="http://developer.android.com/reference/android/content/Context.html#startService%28android.content.Intent%29" target="_blank"><code>startService()</code></a> method, its called a started service. A started service once started has the capability of running indefinitely based on the flags, that were used to start it. Now you might be wondering when will it stop. The answer is; it will only stop if an app component stops it by calling <a rel="noopener noreferrer" href="http://developer.android.com/reference/android/content/Context.html#stopService%28android.content.Intent%29" target="_blank"><code>stopService()</code></a>. Or the service itself has a logic to stop by calling the <a rel="noopener noreferrer" href="http://developer.android.com/reference/android/app/Service.html#stopSelf%28%29" target="_blank"><code>stopSelf()</code></a> method.</p>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading">Android Service : Send Broadcast to Activity</h2>



<p class="wp-block-paragraph">Although communication between a service and an activity should be done through an <a title="IBinder" href="http://developer.android.com/reference/android/os/IBinder.html" target="_blank" rel="noopener noreferrer">IBinder</a> interface by binding a service to a component. But for instance if there is a situation when you need to broadcast an intent to entire system, then one can also send a broadcast. This <a title="Android Service and BroadcastReceiver Example" href="http://www.truiton.com/2014/09/android-service-broadcastreceiver-example/">Android Service and BroadcastReceiver Example</a> shows how to this. Although official android documentation mentions nothing regarding this procedure, so why am I doing it? because I can do it and I am not violating any guidelines. Have a look at the service code below:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">package com.truiton.servicebroadcasts;

import android.annotation.TargetApi;
import android.app.Service;
import android.content.Intent;
import android.os.Build;
import android.os.IBinder;
import android.util.Log;

import java.util.ArrayList;

public class BroadcastService extends Service {
    private String LOG_TAG = null;
    private ArrayList&lt;String> mList;

    @Override
    public void onCreate() {
        super.onCreate();
        LOG_TAG = this.getClass().getSimpleName();
        Log.i(LOG_TAG, "In onCreate");
        mList = new ArrayList&lt;String>();
        mList.add("Object 1");
        mList.add("Object 2");
        mList.add("Object 3");
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.i(LOG_TAG, "In onStartCommand");
        new Thread(new Runnable() {
            public void run() {
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                Intent broadcastIntent = new Intent();
                broadcastIntent.setAction(MainActivity.mBroadcastStringAction);
                broadcastIntent.putExtra("Data", "Broadcast Data");
                sendBroadcast(broadcastIntent);

                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                broadcastIntent.setAction(MainActivity.mBroadcastIntegerAction);
                broadcastIntent.putExtra("Data", 10);
                sendBroadcast(broadcastIntent);

                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                broadcastIntent
                        .setAction(MainActivity.mBroadcastArrayListAction);
                broadcastIntent.putExtra("Data", mList);
                sendBroadcast(broadcastIntent);
            }
        }).start();
        return START_REDELIVER_INTENT;
    }

    @Override
    public IBinder onBind(Intent intent) {
        // Wont be called as service is not bound
        Log.i(LOG_TAG, "In onBind");
        return null;
    }

    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
    @Override
    public void onTaskRemoved(Intent rootIntent) {
        super.onTaskRemoved(rootIntent);
        Log.i(LOG_TAG, "In onTaskRemoved");
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.i(LOG_TAG, "In onDestroy");
    }
}
</pre>



<p class="wp-block-paragraph">The class above shows how to create a service in Android, which can broadcast the results to the system. As per the specifications to start a service at-least an <a rel="noopener noreferrer" href="http://developer.android.com/reference/android/app/Service.html#onBind%28android.content.Intent%29" target="_blank"><code>onBind()</code></a> method is required. Although the main logic in a started service should be written in <a rel="noopener noreferrer" href="http://developer.android.com/reference/android/app/Service.html#onStartCommand%28android.content.Intent,%20int,%20int%29" target="_blank"><code>onStartCommand()</code></a> method. Another important method here is onCreate, where you can initialize the service, as what all things need to be taken care of when service is created.</p>



<p class="wp-block-paragraph">A service can be started in three modes:</p>



<ul class="wp-block-list"><li>START_NOT_STICKY</li><li>START_STICKY</li><li>START_REDELIVER_INTENT</li></ul>



<p class="wp-block-paragraph">In this example we are performing a service activity communication through START_REDELIVER_INTENT flag. By using this flag in <a rel="noopener noreferrer" href="http://developer.android.com/reference/android/app/Service.html#onStartCommand%28android.content.Intent,%20int,%20int%29" target="_blank"><code>onStartCommand()</code></a> method, we are specifying that, if Android system kills this service due to low memory. Then it should start this service again and re-deliver the last intent it received. Also it would receive all the intents, that are pending.</p>



<p class="wp-block-paragraph">As you can see that in the above Android service, all work is done in <a rel="noopener noreferrer" href="http://developer.android.com/reference/android/app/Service.html#onStartCommand%28android.content.Intent,%20int,%20int%29" target="_blank"><code>onStartCommand()</code></a> method. In this method I am sending broadcasts with different types of data in it. This demonstrates that we can send any type of data we want to send through broadcasts.</p>



<p class="wp-block-paragraph"><span style="text-decoration: underline;">Please Note:</span> <em>In the above example all the broadcasts are system wide broadcasts, if you want to make broadcasts accessible only to your app, then please use the <a title="Android LocalBroadcastManager" href="http://developer.android.com/reference/android/support/v4/content/LocalBroadcastManager.html" target="_blank" rel="noopener noreferrer">LocalBroadcastManager</a>.</em></p>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading">Android Broadcast Receiver: Receiving Broadcasts From Service</h2>



<p class="wp-block-paragraph">Now I will create an activity, where I would listen to the broadcasts of the service created above. To do that I would create a layout first, with a single TextView:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="xml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                tools:context="com.truiton.servicebroadcasts.MainActivity">

    &lt;TextView
        android:id="@+id/textview1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

&lt;/RelativeLayout></pre>



<p class="wp-block-paragraph">Moving on I would define an activity with BroadcastReceiver where this layout would be used:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="java" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">package com.truiton.servicebroadcasts;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {
    public static final String mBroadcastStringAction = "com.truiton.broadcast.string";
    public static final String mBroadcastIntegerAction = "com.truiton.broadcast.integer";
    public static final String mBroadcastArrayListAction = "com.truiton.broadcast.arraylist";
    private TextView mTextView;
    private IntentFilter mIntentFilter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mTextView = (TextView) findViewById(R.id.textview1);
        mIntentFilter = new IntentFilter();
        mIntentFilter.addAction(mBroadcastStringAction);
        mIntentFilter.addAction(mBroadcastIntegerAction);
        mIntentFilter.addAction(mBroadcastArrayListAction);

        Intent serviceIntent = new Intent(this, BroadcastService.class);
        startService(serviceIntent);
    }

    @Override
    public void onResume() {
        super.onResume();
        registerReceiver(mReceiver, mIntentFilter);
    }

    private BroadcastReceiver mReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            mTextView.setText(mTextView.getText()
                    + "Broadcast From Service: \n");
            if (intent.getAction().equals(mBroadcastStringAction)) {
                mTextView.setText(mTextView.getText()
                        + intent.getStringExtra("Data") + "\n\n");
            } else if (intent.getAction().equals(mBroadcastIntegerAction)) {
                mTextView.setText(mTextView.getText().toString()
                        + intent.getIntExtra("Data", 0) + "\n\n");
            } else if (intent.getAction().equals(mBroadcastArrayListAction)) {
                mTextView.setText(mTextView.getText()
                        + intent.getStringArrayListExtra("Data").toString()
                        + "\n\n");
                Intent stopIntent = new Intent(MainActivity.this,
                        BroadcastService.class);
                stopService(stopIntent);
            }
        }
    };

    @Override
    protected void onPause() {
        unregisterReceiver(mReceiver);
        super.onPause();
    }
}
</pre>



<p class="wp-block-paragraph">The above class demonstrates how to receive broadcasts in android dynamically. That is by declaring a BroadcastReceiver like this we don&#8217;t need to specify the receiver in manifest. It may be an advantage or disadvantage, but by doing this the activity would listen to broadcasts only when its in foreground, i.e. when its visible.</p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Now since we are using a started service, it will keep on running until its <a rel="noopener noreferrer" href="http://developer.android.com/reference/android/app/Service.html#stopSelf%28%29" target="_blank"><code>stopSelf()</code></a> method is called. Or one can call its <a rel="noopener noreferrer" href="http://developer.android.com/reference/android/content/Context.html#stopService%28android.content.Intent%29" target="_blank"><code>stopService()</code></a> method from any other class. In this example I called <a rel="noopener noreferrer" href="http://developer.android.com/reference/android/content/Context.html#stopService%28android.content.Intent%29" target="_blank"><code>stopService()</code></a> method after receiving the final broadcast, and stopped the service. Have a look at the final screenshot:</p>



<div class="wp-block-image"><figure class="aligncenter"><img data-recalc-dims="1" decoding="async" width="346" height="577" data-attachment-id="703" data-permalink="https://www.truiton.com/2014/09/android-service-broadcastreceiver-example/android-service/" data-orig-file="https://i0.wp.com/www.truiton.com/wp-content/uploads/2014/09/Android-Service.png?fit=346%2C577&amp;ssl=1" data-orig-size="346,577" data-comments-opened="1" data-image-title="Android Service" data-image-description="" data-image-caption="" data-large-file="https://i0.wp.com/www.truiton.com/wp-content/uploads/2014/09/Android-Service.png?fit=346%2C577&amp;ssl=1" src="https://i0.wp.com/www.truiton.com/wp-content/uploads/2014/09/Android-Service.png?resize=346%2C577" alt="Android Service" class="wp-image-703" srcset="https://i0.wp.com/www.truiton.com/wp-content/uploads/2014/09/Android-Service.png?w=346&amp;ssl=1 346w, https://i0.wp.com/www.truiton.com/wp-content/uploads/2014/09/Android-Service.png?resize=179%2C300&amp;ssl=1 179w" sizes="(max-width: 346px) 100vw, 346px" /></figure></div>



<p class="wp-block-paragraph" style="text-align:center"><a class="fasc-button fasc-size-large fasc-type-flat fasc-rounded-medium ico-fa fasc-ico-before fa-github" style="background-color: #0364af; color: #ffffff;" target="_blank" rel="noopener noreferrer" href="https://github.com/Truiton/ServiceBroadcasts">Source Code</a></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">Here you can see that all the three broadcasts from BroadcastService are received. Also from the link above you can access the source code for this&nbsp;<a title="Android Service and BroadcastReceiver Example" href="http://www.truiton.com/2014/09/android-service-broadcastreceiver-example/">Android Service and BroadcastReceiver Example</a>. On a closing note, I would like to say this example is not the perfect way one should use an Android&nbsp;service, its just an alternate approach which does not break any guidelines. Hope this helped.</p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author"><div class="saboxplugin-tab"><div class="saboxplugin-gravatar"><img alt='Mohit Gupt' src='https://secure.gravatar.com/avatar/a816092ad56645d2635ccfceb9f7e9d44821c19dec126cb394c882ba574eaa04?s=100&#038;d=mm&#038;r=g' srcset='https://secure.gravatar.com/avatar/a816092ad56645d2635ccfceb9f7e9d44821c19dec126cb394c882ba574eaa04?s=200&#038;d=mm&#038;r=g 2x' class='avatar avatar-100 photo' height='100' width='100' itemprop="image"/></div><div class="saboxplugin-authorname"><a href="https://www.truiton.com/author/mohitgupt/" class="vcard author" rel="author"><span class="fn">Mohit Gupt</span></a></div><div class="saboxplugin-desc"><div itemprop="description"><p>Born in New Delhi, India. A software engineer by profession, an android enthusiast and mobile development evangelist. My motive here is to create a group of skilled engineers, who can build better software. Reason being programming is my passion, and also it feels good to make a device do something you want. Professionally I have worked with many software engineering and product development firms. As of now too, I am employed as a senior engineer in a leading tech company. In total I may have worked on more than 20 projects professionally, but whenever I get spare time I share my thoughts here at Truiton.</p>
</div></div><div class="saboxplugin-web "><a href="http://www.truiton.com" target="_self" >www.truiton.com</a></div><div class="clearfix"></div><div class="saboxplugin-socials "><a title="Wordpress" target="_blank" href="https://www.truiton.com/author/mohitgupt/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-wordpress" role="img" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 512 512"><path fill="currentColor" d="M61.7 169.4l101.5 278C92.2 413 43.3 340.2 43.3 256c0-30.9 6.6-60.1 18.4-86.6zm337.9 75.9c0-26.3-9.4-44.5-17.5-58.7-10.8-17.5-20.9-32.4-20.9-49.9 0-19.6 14.8-37.8 35.7-37.8.9 0 1.8.1 2.8.2-37.9-34.7-88.3-55.9-143.7-55.9-74.3 0-139.7 38.1-177.8 95.9 5 .2 9.7.3 13.7.3 22.2 0 56.7-2.7 56.7-2.7 11.5-.7 12.8 16.2 1.4 17.5 0 0-11.5 1.3-24.3 2l77.5 230.4L249.8 247l-33.1-90.8c-11.5-.7-22.3-2-22.3-2-11.5-.7-10.1-18.2 1.3-17.5 0 0 35.1 2.7 56 2.7 22.2 0 56.7-2.7 56.7-2.7 11.5-.7 12.8 16.2 1.4 17.5 0 0-11.5 1.3-24.3 2l76.9 228.7 21.2-70.9c9-29.4 16-50.5 16-68.7zm-139.9 29.3l-63.8 185.5c19.1 5.6 39.2 8.7 60.1 8.7 24.8 0 48.5-4.3 70.6-12.1-.6-.9-1.1-1.9-1.5-2.9l-65.4-179.2zm183-120.7c.9 6.8 1.4 14 1.4 21.9 0 21.6-4 45.8-16.2 76.2l-65 187.9C426.2 403 468.7 334.5 468.7 256c0-37-9.4-71.8-26-102.1zM504 256c0 136.8-111.3 248-248 248C119.2 504 8 392.7 8 256 8 119.2 119.2 8 256 8c136.7 0 248 111.2 248 248zm-11.4 0c0-130.5-106.2-236.6-236.6-236.6C125.5 19.4 19.4 125.5 19.4 256S125.6 492.6 256 492.6c130.5 0 236.6-106.1 236.6-236.6z"></path></svg></span></a><a title="Twitter" target="_blank" href="http://twitter.com/mohitgupt" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Facebook" target="_blank" href="https://www.facebook.com/Mr.Mohit.Gupt" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a></div></div></div><p>The post <a href="https://www.truiton.com/2014/09/android-service-broadcastreceiver-example/">Android Service and BroadcastReceiver Example</a> appeared first on <a href="https://www.truiton.com">Truiton</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.truiton.com/2014/09/android-service-broadcastreceiver-example/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">699</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: www.truiton.com @ 2026-07-07 22:18:01 by W3 Total Cache
-->