Skip to content

Implement a proper Android port #20855

Closed

Description

@paulrouget

I'll use this issue to log my thoughts on how to properly implement an Android port.

The way it works today is:

  • The glutin port (/ports/servo/) is built as a library (even though Cargo.toml says it's a binary) by hijacking the linker (see fake-ld.sh)
  • a basic java app creates a SurfaceView
  • it loads the servo libary which will create the GL context
  • the loop is in the library

The way I'd like it to work:

  • remove the ugly hack where the executable is transformed into a library
  • do not use /ports/servo/ or Glutin
  • introduce /ports/libsimpleservo/ where we wrap /components/servo/ in a simpler API with JNI symbols
  • the java app will create a SurfaceView
  • the java app will also create the GL context and start the loop

This is how the Klar and Crow ports work.

Activity

  1. paulrouget commented on May 30, 2018

    @paulrouget
    ContributorAuthor

    TODO:

    • test VR mode.
  2. added
    P-android
    on May 30, 2018
  3. paulrouget commented on May 30, 2018

    @paulrouget
    ContributorAuthor
  4. paulrouget commented on May 31, 2018

    @paulrouget
    ContributorAuthor

    Current status:

    • introduced /ports/libservojni with a very simple API
    • introduced /support/android/servoview, a basic Android widget that loads libservojni
    • refactored the main Android app to make use of the servoview. Added few widgets
    • toolchain didn't have to change:
      • ./mach build -d --android builds libservojni.so
      • ./mach package --dev --android builds servo.apk
      • ./mach install --dev --android && ./mach run --android installs and runs the apk

    The ServoView is a regular Android widget that can be used in the design view:

    screen shot 2018-05-31 at 16 07 30

  5. added a commit that references this issue on Jul 5, 2018
    5823b41
  6. added 2 commits that reference this issue on Jul 13, 2018
    b0c5a45
    8f9ac67
  7. added 8 commits that reference this issue on Jul 27, 2018
    c3e7976
    a3284da
    4ccae58
    98b3cac
    d404d69
    25caf1e
    15aab83
    95b54ca
  8. moved this to Done in Androidon Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-android

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions