Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Try OkHTTP on Android again #2856

Closed
Closed

Description

@ljbade

Time to try #2033 again and use OkHTTP instead of curl for Android.

Previous blocker for this was #2400 which has not been looked at for a while.

Things that might have fixed that crash:

OkHTTP will be an enabler for offline support.

/cc @bleege @tobrun

Activity

  1. added
    Android
    on Oct 29, 2015
  2. added this to the android-v2.3.0 milestone on Oct 29, 2015
  3. ljbade commented on Oct 29, 2015

    @ljbade
    ContributorAuthor

    We will need to perform extended testing over a period of time as #2400 was a rare and hard to reproduce reliably.

    Perhaps a Sirius build with this change included will provide the confidence needed.

  4. ljbade commented on Oct 29, 2015

    @ljbade
    ContributorAuthor

    Simply switching config.mk to the Android HTTP implementation, reveals bit rot in http_request_android.cpp due to refactors.

  5. mb12 commented on Oct 29, 2015

    @mb12

    @ljbade The only advantage of this is reduced .apk size. Its no longer an issue on Android (since apk size limit has been doubled). Why do we want to change this if curl implementation does not have any bugs?

  6. ljbade commented on Oct 29, 2015

    @ljbade
    ContributorAuthor

    After fixing the compile errors, the OkHTTP stack is working again. So far I have not been able to reproduce #2400 but more testing is needed.

  7. added a commit that references this issue on Oct 29, 2015
    0ddb1ab
  8. self-assigned this
    on Oct 29, 2015
  9. bleege commented on Oct 30, 2015

    @bleege
    Contributor

    Why do we want to change this if curl implementation does not have any bugs?

    @mb12 The big reason is as you mentioned, a reduced .aar and .apk sizes. Not having to compile it for N ABI really helps keep things svelte. Another reason is to use more platform specific implementations (in this case Java for Android) as it is more accessible to developers.

  10. bleege commented on Nov 9, 2015

    @bleege
    Contributor

    For future reference, by replacing curl with OkHttp the Mapbox Android Library .aar file goes from ~11 MB to ~7.8 MB.

    curl
    Mapbox Android SDK 2.2.0 with curl

    okhttp
    Mapbox Android SDK 2.3.0-SNAPSHOT with OkHttp replacing curl

    The size of OkHttp and it's dependency Okio combine to be about ~375 KB so that the net result is a ~2.825 MB overall decrease in size by replacing curl with OkHttp.

    okhttp-library
    OkHttp Library

    okio-library
    Okio Library

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

Metadata

Metadata

Assignees

Labels

Androidoffline

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions