<?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>notification large icon Archives - Truiton</title>
	<atom:link href="https://www.truiton.com/tag/notification-large-icon/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Technology Reaching Us In Time - Online</description>
	<lastBuildDate>Thu, 21 Nov 2019 13:28:52 +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>notification large icon Archives - Truiton</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">54534495</site>	<item>
		<title>Android Foreground Service Example</title>
		<link>https://www.truiton.com/2014/10/android-foreground-service-example/</link>
					<comments>https://www.truiton.com/2014/10/android-foreground-service-example/#comments</comments>
		
		<dc:creator><![CDATA[Mohit Gupt]]></dc:creator>
		<pubDate>Sat, 04 Oct 2014 13:51:20 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android notification with buttons]]></category>
		<category><![CDATA[notification large icon]]></category>
		<category><![CDATA[Service]]></category>
		<guid isPermaLink="false">http://www.truiton.com/?p=713</guid>

					<description><![CDATA[<p>Android guidelines suggest that a long running operation should be performed in a service. As that long running operation may not require a UI and Android Services do not provide a UI. But what if that long running operation requires a UI or maybe just two or three pre-defined inputs. The first solution that comes&#8230;&#160;<a href="https://www.truiton.com/2014/10/android-foreground-service-example/" rel="bookmark">Read More &#187;<span class="screen-reader-text">Android Foreground Service Example</span></a></p>
<p>The post <a href="https://www.truiton.com/2014/10/android-foreground-service-example/">Android Foreground Service 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="480" data-attachment-id="718" data-permalink="https://www.truiton.com/2014/10/android-foreground-service-example/android-foreground-service/" data-orig-file="https://i0.wp.com/www.truiton.com/wp-content/uploads/2014/10/Android-Foreground-Service.jpg?fit=640%2C480&amp;ssl=1" data-orig-size="640,480" data-comments-opened="1" data-image-title="Android Foreground Service" data-image-description="&lt;p&gt;Photo Credit: &lt;a href=&quot;https://www.flickr.com/photos/50512772@N07/10870683024/&quot;&gt;Soenke HH&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/10/Android-Foreground-Service.jpg?fit=640%2C480&amp;ssl=1" src="https://i0.wp.com/www.truiton.com/wp-content/uploads/2014/10/Android-Foreground-Service.jpg?resize=640%2C480" alt="Android Foreground Service" class="wp-image-718" srcset="https://i0.wp.com/www.truiton.com/wp-content/uploads/2014/10/Android-Foreground-Service.jpg?w=640&amp;ssl=1 640w, https://i0.wp.com/www.truiton.com/wp-content/uploads/2014/10/Android-Foreground-Service.jpg?resize=300%2C225&amp;ssl=1 300w" sizes="(max-width: 640px) 100vw, 640px" /></figure></div>



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



<p class="wp-block-paragraph">Android guidelines suggest that a long running operation should be performed in a service. As that long running operation may not require a UI and Android <a title="Android Service" href="http://developer.android.com/reference/android/app/Service.html" target="_blank" rel="noopener noreferrer">Services</a> do not provide a UI. But what if that long running operation requires a UI or maybe just two or three pre-defined inputs. The first solution that comes in my mind is Android Foreground Service. This type of service falls under the category of <em>started service</em>, as its not bound to any component and neither it returns any result back to the caller.</p>



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



<h2 class="wp-block-heading">Introduction to Android Foreground Service</h2>



<p class="wp-block-paragraph">Lets start with a basic know hows; As you may know that services are used for time consuming operations which do not require a user interface. But there are situations when long running operations are in progress and you would want the user to know progress of that operation. E.g.:</p>



<ol class="wp-block-list"><li>Music Player</li><li>VOIP Calls</li><li>File Download</li><li>and many more</li></ol>



<p class="wp-block-paragraph">Services have a unique property; once &#8216;started&#8217; they can run even if you put the app in background. All the above listed operations are similar sort of operations, once started they don&#8217;t need a UI to complete. But for good user experience you would want the user to know that, this sort of operation is going on. Also now notifications in android allow for three action buttons, through which the user can interact with the ongoing operation if they want. Therefore the best suitable approach for these sort of operations is an Android Foreground Service.</p>



<p class="wp-block-paragraph">In this tutorial for Android foreground service, I would make a music player stub (not an actual player). Here the user would be able to start a foreground service from an activity by calling <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. After this when  <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 is invoked in service class, I would call the actual <a rel="noopener noreferrer" href="http://developer.android.com/reference/android/app/Service.html#startForeground%28int,%20android.app.Notification%29" target="_blank"><code>startForeground()</code></a> method. By doing this Android would fire a notification, and from now on this service would be called as an Android Foreground Service. The interesting part here would be that after starting the service we can actually close the activity and interact with service through the notification buttons, or notification actions. To start off lets have a look at the 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 xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.truiton.foregroundservice"
    android:versionCode="1"
    android:versionName="1.0" >

    &lt;uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="19" />

    &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"
            android:launchMode="singleTask" >
            &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=".ForegroundService" >
        &lt;/service>
    &lt;/application>

&lt;/manifest></pre>



<p class="wp-block-paragraph">Point to be noted here is that the main activity is launched in <code>android:launchMode="singleTask"</code>, as whenever we launch this activity we want only once instance of it at task root level. In this <a title="Android Foreground Service Example" href="http://www.truiton.com/2014/10/android-foreground-service-example/">Android Foreground Service Example</a> I have used a constants file to keep the code clean. In any project, as a good coding practice it is advised that all constants are kept in a single class, as its a little easier to access. Have a look at the constants file for this example:</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.foregroundservice;

public class Constants {
	public interface ACTION {
		public static String MAIN_ACTION = "com.truiton.foregroundservice.action.main";
		public static String PREV_ACTION = "com.truiton.foregroundservice.action.prev";
		public static String PLAY_ACTION = "com.truiton.foregroundservice.action.play";
		public static String NEXT_ACTION = "com.truiton.foregroundservice.action.next";
		public static String STARTFOREGROUND_ACTION = "com.truiton.foregroundservice.action.startforeground";
		public static String STOPFOREGROUND_ACTION = "com.truiton.foregroundservice.action.stopforeground";
	}

	public interface NOTIFICATION_ID {
		public static int FOREGROUND_SERVICE = 101;
	}
}</pre>



<p class="wp-block-paragraph">Next lets define the layout for main activity:</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="${relativePackage}.${activityClass}" >

    &lt;TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="52dp"
        android:text="Main Screen"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    &lt;Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView1"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="26dp"
        android:text="Start Foreground Service" />

    &lt;Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/button1"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="35dp"
        android:text="Stop Foreground Service" />

&lt;/RelativeLayout></pre>



<p class="wp-block-paragraph">After defining layout it would look something like this:</p>



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



<p class="wp-block-paragraph">Let me define the MainActivity.java, from where I&#8217;ll start the service:</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.foregroundservice;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button startButton = (Button) findViewById(R.id.button1);
        Button stopButton = (Button) findViewById(R.id.button2);

        startButton.setOnClickListener(this);
        stopButton.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.button1:
                Intent startIntent = new Intent(MainActivity.this, ForegroundService.class);
                startIntent.setAction(Constants.ACTION.STARTFOREGROUND_ACTION);
                startService(startIntent);
                break;
            case R.id.button2:
                Intent stopIntent = new Intent(MainActivity.this, ForegroundService.class);
                stopIntent.setAction(Constants.ACTION.STOPFOREGROUND_ACTION);
                startService(stopIntent);
                break;

            default:
                break;
        }

    }
}</pre>



<p class="wp-block-paragraph">As you can see in the above piece of code, I have defined the objects for two buttons and on click of first button I am starting the service in foreground mode, and on click of second button I have written the code to stop the service. Now lets define the main class of this <a title="Android Foreground Service Example" href="http://www.truiton.com/2014/10/android-foreground-service-example/">Android Foreground Service Example</a>, ForegroundService.java:</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.foregroundservice;

import android.app.Notification;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.IBinder;
import android.support.v4.app.NotificationCompat;
import android.util.Log;

public class ForegroundService extends Service {
	private static final String LOG_TAG = "ForegroundService";

	@Override
	public void onCreate() {
		super.onCreate();
	}

	@Override
	public int onStartCommand(Intent intent, int flags, int startId) {
		if (intent.getAction().equals(Constants.ACTION.STARTFOREGROUND_ACTION)) {
			Log.i(LOG_TAG, "Received Start Foreground Intent ");
			Intent notificationIntent = new Intent(this, MainActivity.class);
			notificationIntent.setAction(Constants.ACTION.MAIN_ACTION);
			notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
					| Intent.FLAG_ACTIVITY_CLEAR_TASK);
			PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,
					notificationIntent, 0);

			Intent previousIntent = new Intent(this, ForegroundService.class);
			previousIntent.setAction(Constants.ACTION.PREV_ACTION);
			PendingIntent ppreviousIntent = PendingIntent.getService(this, 0,
					previousIntent, 0);

			Intent playIntent = new Intent(this, ForegroundService.class);
			playIntent.setAction(Constants.ACTION.PLAY_ACTION);
			PendingIntent pplayIntent = PendingIntent.getService(this, 0,
					playIntent, 0);

			Intent nextIntent = new Intent(this, ForegroundService.class);
			nextIntent.setAction(Constants.ACTION.NEXT_ACTION);
			PendingIntent pnextIntent = PendingIntent.getService(this, 0,
					nextIntent, 0);

			Bitmap icon = BitmapFactory.decodeResource(getResources(),
					R.drawable.truiton_short);

			Notification notification = new NotificationCompat.Builder(this)
					.setContentTitle("Truiton Music Player")
					.setTicker("Truiton Music Player")
					.setContentText("My Music")
					.setSmallIcon(R.drawable.ic_launcher)
					.setLargeIcon(
							Bitmap.createScaledBitmap(icon, 128, 128, false))
					.setContentIntent(pendingIntent)
					.setOngoing(true)
					.addAction(android.R.drawable.ic_media_previous,
							"Previous", ppreviousIntent)
					.addAction(android.R.drawable.ic_media_play, "Play",
							pplayIntent)
					.addAction(android.R.drawable.ic_media_next, "Next",
							pnextIntent).build();
			startForeground(Constants.NOTIFICATION_ID.FOREGROUND_SERVICE,
					notification);
		} else if (intent.getAction().equals(Constants.ACTION.PREV_ACTION)) {
			Log.i(LOG_TAG, "Clicked Previous");
		} else if (intent.getAction().equals(Constants.ACTION.PLAY_ACTION)) {
			Log.i(LOG_TAG, "Clicked Play");
		} else if (intent.getAction().equals(Constants.ACTION.NEXT_ACTION)) {
			Log.i(LOG_TAG, "Clicked Next");
		} else if (intent.getAction().equals(
				Constants.ACTION.STOPFOREGROUND_ACTION)) {
			Log.i(LOG_TAG, "Received Stop Foreground Intent");
			stopForeground(true);
			stopSelf();
		}
		return START_STICKY;
	}

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

	@Override
	public IBinder onBind(Intent intent) {
		// Used only in case of bound services.
		return null;
	}
}</pre>



<p class="wp-block-paragraph"><span style="text-decoration: underline;">Please Note:</span> <em>R.drawable.truiton_short is just an image I used for displaying the notification large icon in setLargeIcon method, you can use any other drawable or bitmap like R.drawable.ic_launcher.</em></p>



<p class="wp-block-paragraph">In the above class, as you can see I am starting the foreground service by calling <a rel="noopener noreferrer" href="http://developer.android.com/reference/android/app/Service.html#startForeground%28int,%20android.app.Notification%29" target="_blank"><code>startForeground()</code></a> method. This is the point when a normal service transforms into a foreground service. Also please keep in mind that when a foreground service is stopped by calling the  <a rel="noopener noreferrer" href="http://developer.android.com/reference/android/app/Service.html#stopForeground%28boolean%29" target="_blank"><code>stopForeground()</code></a> method it does not stop the service, it just removes the service from foreground mode. To stop the service you may have to call 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. To start a service in foreground mode, you need to create an Android notification with notification id. So lets have a closer look at the notifications:</p>



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



<h2 class="wp-block-heading">Android Notification with Button</h2>



<p class="wp-block-paragraph">In this Android Foreground Service Example a special type of notification is used. This type of notification can perform actions, and they are called Android notification actions. Please have a look at the screen shot below:</p>



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



<p class="wp-block-paragraph">For a better understanding also have a look at the full source code:</p>



<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/ForegroundService">Full Source Code</a></p>



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



<p class="wp-block-paragraph">You may observe that, above notification has three buttons/actions attached to it. To do this, one has to use the <a title="Notification Builder Add Action" rel="noopener noreferrer" href="http://developer.android.com/reference/android/app/Notification.Builder.html#addAction%28int,%20java.lang.CharSequence,%20android.app.PendingIntent%29" target="_blank">addAction</a> method, with appropriate <a title="Pending Intent" rel="noopener noreferrer" href="http://developer.android.com/reference/android/app/PendingIntent.html" target="_blank">pending intent</a>. If you closely observe the above class, <a rel="noopener noreferrer" href="http://developer.android.com/reference/android/app/PendingIntent.html#getService%28android.content.Context,%20int,%20android.content.Intent,%20int%29" target="_blank">getService</a> method is used for pendingIntents of notification actions. By using this method my intent would go directly to the <a href="http://developer.android.com/reference/android/app/Service.html#onStartCommand%28android.content.Intent,%20int,%20int%29"><code>onStartCommand()</code></a> method of my ForegroundService. This would deliver my intent directly to the service instead of going through an activity. The advantage of this approach is that, I don&#8217;t need to be dependent on my activity. This truly makes this service a foreground service. Hope this Android Foreground Service Example 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/10/android-foreground-service-example/">Android Foreground Service Example</a> appeared first on <a href="https://www.truiton.com">Truiton</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.truiton.com/2014/10/android-foreground-service-example/feed/</wfw:commentRss>
			<slash:comments>16</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">713</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-08 02:19:53 by W3 Total Cache
-->