© Peter Späth and Jeff Friesen 2020
P. Späth, J. FriesenLearn Java for Android Developmenthttps://doi.org/10.1007/978-1-4842-5943-6_8

8. Exploring the Basic APIs, Part 2

Peter Späth1  and Jeff Friesen2
(1)
Leipzig, Sachsen, Germany
(2)
Winnipeg, MB, Canada
 

There are more basic APIs in the java.lang package and also in java.lang.ref, java.lang.reflect, and java.util to consider for your Android apps. For example, you can add timers to your games.

Exploring Random

In Chapter 7, we formally introduced you to the java.lang.Math class’s random() method. If you were to investigate this method’s source code from the perspective of Java 8 or later (at least up to Java 12), you would encounter the following implementation:
public static double random() {
    return ...

Get Learn Java for Android Development: Migrating Java SE Programming Skills to Mobile Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.