You're going to learn how to make a progressbar, which gives you a feedback what's going on in the background.
Let say you have a LoadingScreen activity (loadingscreen.xml layout), and a Main activity (main.xml).
You'd like to do some job in the Main activity, and update the progressbar status at the same time. To do this, we are going to use Messages. Although, you can update you're progressbar by sending the progressbar instance itself to your Main activity, but that's obviously not the prettiest solution.
What we going to do is:
1. Declaring a progressbar instance in LoadingScreen Activity:
So in your LoadingScreen.java, after Oncreate(), you should add something like this line to your codeline: (don't forget to add a progressbar to your layout first!)
In Days to Xmas tutorial you can see a simple widget example, which demonstrates what widgets are used for, and shows an example how they can work. Now I begin a series of tutorials to fully explain the working of widgets.
We will also create a sample application, during the tutorials, which will show a countdown to a given date in secunds, but things that are not required for this specific example applications will be explained too.
The emulator available in the Android SDK is not just a tool that allows you to easily test applications without having to install it to a real device, or even having one. With the proper configuration it is possible to test situations which are hardly reproduced on a physical one.
In this tutorial we will show you how you can easily debug a service.
Introduction
When you start a project with a service in it in debug mode, and you placed a breakpoint in a method of the service, the debugger will not stop.
Solution
The solution that works in almost all situation is to wait declaratively in the code for the debugger to attach. To do this, you have to make a call to:
android.os.Debug.waitForDebugger();
The breakpoint can be inserted at any line after this call.
As a complete example, the SoftKeyboard tutorial is enhanced with the call above: