Android Examples
Login / Register
Android Examples
  • Home
  • Android
  • NEWS
  • Java
  • Faq
  • Algorithms
  1. Home
  2. ANDROID
  3. SERVICE

Service Basics Service Basics

Jan 02 2013 631893 by admin Download Source Code

** A Service runs with the main application thread , so some time user interaction will lock the current application . Use Service inside a separate thread, you will reduce the risk of Application Not Responding (ANR) errors . So  application's main thread can remain dedicated to user interaction with your activities.

** If you are starting service inside any activity then it will block activity so when created service done then only your activity will unlock. in this mean time if user will interacting to activity then Application Not Responding (ANR) errors will come.

** If you want user interaction on when activity is visible and also some server or time taking tasks(performs intensive or blocking operations) then you might create a thread in onCreate(), start running it in onStart(), then stop it in onStop(). Also consider using AsyncTask or HandlerThread, instead of the traditional Thread class

Read More

Categories

  • Android Basics (71)
  • Android Advanced (8)
  • Projects (1)

Tags

ANDROID
  • INSTALLATION
  • BEGINNER
  • SQLite
  • LAYOUTS
  • GUI
  • THREAD
  • BROADCAST RECEIVER
  • LISTVIEW
  • GPS
  • CONTACTS
  • XML / JSON
  • WEBVIEW
  • SHARED PREFERENCES
  • CONTENT PROVIDER
  • SERVICE
  • CAMERA
  • FILE UPLOAD
  • CUSTOM
  • WIFI
  • CALL
  • SMS
  • WEBSERVICE
  • ANIMATION
  • AUTOCOMPLETE
  • ACCELEROMETER
  • NOISE
  • MVC
  • GCM
  • FACEBOOK

Top Downloads

Open File Chooser With Camera Option In Webview File Option Open File Chooser With Camera Option In Webview File Option
Feb 03, 2014 671496
Facebook Integration - Android Example Facebook Integration - Android Example
Jan 13, 2016 670839
Android Session Management Using SharedPreferences - Android Example Android Session Management Using SharedPreferences - Android Example
Jan 19, 2014 670638
Show Loader To Open Url In WebView - Android Example Show Loader To Open Url In WebView - Android Example
Dec 24, 2013 670544
Android SharedPreferences Basics Android SharedPreferences Basics
Dec 28, 2013 670477
Play Video File - Android Example Play Video File - Android Example
Nov 09, 2013 669918
Android Push Notifications using Google Cloud Messaging GCM Android Push Notifications using Google Cloud Messaging GCM
Oct 05, 2013 633194
Upload File To Server - Android Example Upload File To Server - Android Example
Feb 28, 2013 632483
Incomming SMS Broadcast Receiver - Android Example Incomming SMS Broadcast Receiver - Android Example
Feb 04, 2013 632410
How To Make HTTP POST Request To Server - Android Example How To Make HTTP POST Request To Server - Android Example
Feb 06, 2013 632305
Android Examples

Founder of Android Example.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook.

Email: info@androidexample.com

Follow Us

Information

  • About Us
  • Terms & Conditions
  • Privacy Policy
  • Contact Us

My Account

  • My Account
  • My Questions

Sign Up to Our Newsletter

Sign up our newsletter and get exclusive deals you will not find anywhere else straight to your inbox!

Features

  • Java Blogs
  • News
  • Faqs

© 2025 AndroidExample All Rights Reserved.

This website uses cookies to ensure you get the best experience on our website. For more information Learn about cookies