Skip to content

Android api level < 26 support #252

Description

@baywet

The goal of this issue is to investigate ways to support Android API level < 26 (current requirement for core 2.X and sdk 3/4).

SDK users: please like (and subscribe to get notified of progress) this issue. This will allow us to gage the interest of the community for this work. Don't hesitate to engage in the conversation either.

The current SDK requires API level >= 26 mostly because of the downstream requirements from azure-core/azure-identity. The azure team made a choice of shipping libraries for Java developers first, which might work for Android developers. We (the graph sdk team) have aligned on that decision because we're dependent on them, lack of resources to develop 2 SDKs for the same eco-system, and because of usage data.

Besides the authentication aspects, we've later on made the choice to provide the best Java development experience at the expense of Android backwards compatibility: those productivity features include CompletableFutures, some streaming and string encoding capabilities and more. The easiest way to get an exhaustive list of such platform features is to downgrade the api level of the android linting project and look at the list of errors.

The eco-system usually targets API level 19 or 21, respectively supporting 98.1% and 94.1% of android phones our there at the time of writing (android studio, file, new project, help me choose the api level). And the library authors go one of multiple ways:

  • Complete separate package names between the Java and Android version (most likely what Azure will do)
  • Same package names, but variants in the version (guava is a good example)
  • Support only a single platform (our current case)

On top of all this considerations, the chosen approach should consider the following aspects:

  • Don't degrade the Java development experience.
  • Avoid significant maintenance burden.
  • Be mindful of package sizes as it impacts distribution of the resulting apps. We probably should target an SDK size of <2MB. (excluding downstream dependencies) Proguard/r8 helps keeping apps small but brings a whole set of other issues.
  • Look at kotlin.
  • Look at the existing closed issues and PRs in this repo and in the service repo.
    AB#10300

Activity

  1. baywet commented on Jul 20, 2021

    @baywet
    MemberAuthor

    Some additional context on the CompletableFuture choice microsoftgraph/msgraph-sdk-java#533

  2. perqin commented on Jul 22, 2021

    @perqin

    On CompletableFuture before API 26:

    CompletableFuture is added to Android SDK on API 24, which is used in msgraph-sdk-java-core v2 (for reference, an example of usage).

    AGP 4.0.0+ offers Java 8+ API desugaring support, but unfortunately CompletableFuture is not listed in the supported API List yet.

  3. maisarissi commented on Sep 29, 2022

    @maisarissi

    Hey everyone.
    Level 26 or later today support 91.1% of all Android devices: https://apilevels.com/
    Since we haven't gotten much traction on this issue to support older versions, we are going to close this permanently or until we get a strong request from the community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions