---===[ Message from the authors: This wiki might be taken down due to maintenance ]===----


From Juneday education
Revision as of 07:30, 4 April 2017 by Henrik Sandklef (Talk | contribs) (Activity)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


To give your application a visible user interface you use one or many Activities. In an Activity we can use Views and Fragments to build up the user action.

Introduced in lecture: Android basics.

Read more about Activity on Actvity.

Android Monitor

Android Monitor helps you to profile the performance of your apps so you can optimize, debug, and improve them. It lets you monitor the following aspects of your apps - Android Monitor


Every resource (image, Button, layout, String…) gets an ID. This ID is generated at compile time and is used in runtime to “look up” (find) a View and possibly use that View.

These IDs are integer (actually static int) stored in a file called R.java. When building your project this file gets compiled as well and you can use methods such as:

Introduced in: Android Basics


The visual interface (e g Activity) is defined with a layout.

Introduced in lecture: Android basics


Use the Log API in Android if you want to log output. Declare a tag as a static String in your class:

private static final String TAG = "MyActivity";

or why not:

private static final String TAG = Storage.class.getSimpleName();
assuming your class' name is Storage.

and then Log messages like this (in the same class of course):

Log.v(TAG, "index=" + i);



A View in Android is either:

  • Widget (window gadget) such as Button, EditText, ToggleButton, RadioButton and Spinner
  • Layout (see above)

Introduced in lecture: Android basics