Free Android app covering all aspects of addiction, including prevention and treatment

Android Activities

Getting active: all about Activities Activities are application components that we, mostly, see as the screen. It displays images, text, buttons, etc. that we interact with. Some activities don’t display anything. Apps usually have a number of activities. One is seen as the main activity. This is the first screen…
Using your application resources You should keep your resources, like images, strings, values, etc. separate from your code. Some of the folders in the res directory
Bound Services. A way to interact with the Service Our tutorial app uses a Service to play a sound clip. We start a Service when the app starts. The Service will run as long as the app is alive. We need to bind to the Service to start and stop…
Bound Services: a primer Quick recap on Services Services are app components that you can use to do work in the background. Services run in your app’s process in the main thread. Don’t block the main thread. Use a separate thread to do any heavy work in your Service. You…
Out in the open: The foreground Service It’s unlikely that the system will kill a foreground Service. Typically we’d use foreground Services for work that the user is aware of, like playing music. When we use a foreground Service, we have to send a notification to: let the user know…