Java 8 Stream API in Android N

According to Google’s introduction, starting with Android N, the Android API is supposed to support Java streams.

However, using the Android N preview SDK, I am unable to use any of the Stream APIs in my project (which is configured with Android N as minimum, target and build SDK version).

  • Which method is being called after popBackStack?
  • SurfaceView flashes black on load
  • Android: why is my OnKeyListener() not called?
  • Set a Margin between two buttons programmatically from a linearlayout
  • How to use Toast when I cant use “this” as context
  • Android - adding AppWidgets to an Activity
  • The java.util.stream package seems to be missing, as are the stream() methods of all collection implementations I’ve tried.

    Are the necessary classes not yet included in the current preview release of the SDK?

    Related posts:

    android gridview row dividers / separators
    Animation with animationSet() in android
    GoogleAccountCredential name is null despite calling setSelectedAccountName (Android 6.0)
    Difference between task and process in Android
    Android - Disable screen support x large screens
    Android licensing strategy for publishing to Google Play and Amazon app store
  • Android application as a service without activity
  • Animating listview data change
  • Android: how to wait AsyncTask to finish in MainThread?
  • Android image view matrix scale + translate
  • Changing ActionBar tabs underline color programmatically
  • How to draw Bitmap fast in onDraw() method in canvas android
  • One Solution collect form web for “Java 8 Stream API in Android N”

    It’s not yet in the current preview, but it has already been merged into the AOSP Git master. See here https://android.googlesource.com/platform/libcore/+/916b0af2ccdd1bdfc0283b1096b291c40997d05f

    EDIT:

    Just to avoid possible confusion: in March 2016, when this question has been asked by the OP, Android N developer preview-1 was the only publicly available build of what is now known as Android 7.0 “Nougat”.

    The preview-1 build did in fact not include the Java 8 Stream API, but it was added shortly after (one month later) in the developer preview-2 build.

    So, Android 7.0 API level 24 does support the Java 8 Stream API now.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.