Creating a Simple Service in Android

preview_player
Показать описание
Demonstrates how to create, start and stop a simple service using the onStartCommand() and onDestroy() methods.
Рекомендации по теме
Комментарии
Автор

I did the method where you put all the button code in the XML and just have the buttons map to functions instead, but this was a big help adding the service. 

EthanSmith
Автор

At least... I found a amazing tutorial, and comes with a beautiful voice!

xlucioflavio
Автор

Simple and explains some errors which were not easy. Thank you very much and nice voice for explanations :)

Skyice
Автор

Thanks for keeping it simple and explaining everything!

AnthonyPenner
Автор

thank you and it is very clear and nice tutorial and i want still more videos of yours on android.please upload. 

anilkumarraja
Автор

Thank you very much, this was a big help for me. i finally made it work with your tutorial.

amirmahjoubi
Автор

Instead of moving the service. java file u can use the package name then the class name to refer to that class, that could help to.

williamsapplicatie
Автор

Thanks for the information. Very well done.

jermarpo
Автор

What is the difference between 
super.onStartCommand(intent, flags, startId)
and 
START_STICKY 
???
on method : onStartCommand
thanks !!!

Guihgo
Автор

I am creating an application using cocos2d-x on mac & i am converting in to android. But it is not running in background when it goes to sleep or user lock the device. I want to know how to make it run in background.
Thanks in advance.. 

elavarasann
Автор

appreciate the tut, but alot of uneccessary stuff that was just a waste of time. Just dragging the file into a new package is identical to refactor> move, it will auto update all classes that reference it . no need to close the file. also its a good idea to outline exactly what ur going to cover in ur tut in the first 30 seconds

FFWDEntertainment
Автор

the service is not stopping even though I press the stop button

raviteja
Автор

If anyone has any questions, the site tutorialspoint appears to be where this turorial was borrowed heavily from. 

Facebookmovies
Автор

@Ahmad, background service cannot communicate with the UI directly, your service needs to send data to an Activity to get to your textview

ntokozonkosi
Автор

it can't works now, the new api don't allow startservice() at main thread.
maybe bindservice() can work. i am not good at android. need help

mayy
Автор

why we are not getting continuous toast message since it is running until we stop service?

vikaspatil
Автор

very nice, and straight to the point.

THETHPHANTOM
Автор

Awesome tutorial, but what happens when people press the start service button multiple times? The toast message keeps displaying. Does that mean the user can accidentally start a ton of parallel service? If so, how do we defend against this.

Thanks for the great video!

shadoninja
Автор

error is coming unfortunately stopped on adding manifest file code

shubhampurwar
Автор

Thank you !!!! As an Android Newbie, and scouring the web, this stuff might as well by hieroglyphics.. but you're explanations are actually crisp and clean.. finally someone who explains this stuff in terms that newbies like me can understand.. Onward to SQLLite....

MoltenFungus