tree: 75e18aae7548b8057b08fbcd20c7bc3095a4f356 [path history] [tgz]
  1. AndroidManifest.xml.template
  2. BUILD.gn
  3. debug.keystore
  4. gtest_activity.cc
  5. gtest_activity.h
  6. native_activity.cc
  7. native_activity.gni
  8. native_activity.h
  9. native_activity_apk.py
  10. README.md
testing/android/native_activity/README.md

Native Activity

Executables packaged as native activities in an Android APK. These activities contain no Java code.

To create an APK of your existing exectuable target, replace exectuable with native_activity_apk from the native_activity.gni template and give it an apk_name.

Example

native_activity_apk("apk_unittests") {
  apk_name = "toolkit_unittests"

  testonly = true

  sources = [ "toolkit_android_unittests.cc" ]

  deps = [
    ":unittests_lib",
    "//flutter/testing/android/native_activity:gtest_activity",
  ]
}

One of the translation units in must contain an implementation of flutter::NativeActivityMain. The gtest_activity target contains an implementation of an activity that run GoogleTests. That can be used off the shelf.