December 2015
Beginner
698 pages
15h 16m
English
To make this app, create a new project and call it Device Detection. Delete the default Hello world! widget. Drag Button onto the top of the screen and set its onClick property to detectDevice. We will code this method in a minute.
Drag two LargeText widgets onto the layout and set their id properties to txtOrientation and txtResolution, respectively. You should now have a layout that looks something like this:

Add the following members just after the MainActivity class declaration to hold references to our two TextView widgets:
private TextView txtOrientation; private TextView txtResolution;
Now, in the onCreate method ...
Read now
Unlock full access