Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Android has the concept of event based programming - like most of the graphical interfaces. That means that there's no main method but a lot of methods that get called by Android.</p> <p><strong>How do start an Activity?</strong> Android starts Apps with a Launcher. This is the program you use, when you're on the home screen of your device. It uses Intents which in turn trigger your App. Thru the Manifest you define which Activity will be created and the <code>onCreate</code> method of this Activity is the first called.</p> <p><strong>How to print a result?</strong> Logcat is Androids way to print a message for the programmer. See the <code>Log</code> class. The code <code>Log.d("MyApp", "hello world");</code> prints it to the log. You can read the log in your programming environment like Eclipse.</p> <p><strong>How and where do I put long running code?</strong> Therefore Android has defined the <code>Service</code> class. It runs in background and gets started via Intents (again). You can also use Java's threads but they're somewhat outside of Androids priority scheduling. Services (background) and Activities (foreground) communicate with each other in different ways via messages. When a message is received, a Handler is called. Again another method, called by an event.</p> <p>There's one rule for long running processes in Android: Never run them on the Ui-Thread! They will stop the whole device from reacting on users input.</p> <p>Do you have the feeling now that an Android program looks like a lot of pieces of a puzzle? Well, you're probably right. But that's the way useri interface programs look like - at least from my experience.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload