Skip to content
This repository was archived by the owner on Nov 17, 2022. It is now read-only.

docs: docs about Android App Bundle #1423

Merged
merged 5 commits into from
Dec 5, 2018

Conversation

KristianDD
Copy link
Contributor

PR Checklist

What is the current state of the documentation article?

There is no documentation about Android App Bundle

What is the new state of the documentation article?

There is an article about Android App Bundle

Describes NativeScript/nativescript-cli#4068


For each of the architectures that you specify in your `webpack.config.js`, the plugin will produce a `snapshot.blob` file inside `assets/snapshots/${target_arch}/snapshot.blob`. Those files are **not** subject to Android App Bundle and you will find a corresponding `blob` for each architecture in the resulting .apks. This will increase the size of the resulting .apks.

If you want to take advantage of Android App Bundle you will need to instruct the `nativescript-dev-webpack` plugin to produce a `.so` snapshot. For this purpose you will need to have the Android NDK installed on your system. It is strongly recommended that the same version of the NDK is used to produce the snapshot file as the one used to compile the {N} runtime itself. Currently we use NDK r16b.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we need to state that snapshots cannot be generated on windows

Copy link
Contributor

@etabakov etabakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some minor suggestions on my side/

Copy link
Contributor

@ggarabedian ggarabedian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple of missing commas and words that can be removed. You should consider extending the first paragraph or at least providing a link to the Android docs article about App bundle.

👍 from me.

@@ -36,6 +36,8 @@ However if you want to improve the performance of your application with the `nat

The default file format that the `nativescript-dev-webpack` plugin produce when you execute `tns build android --bundle --env.uglify --env.snapshot` is a `.blob` file.

> Note: The snapshot generation feature is limited to macOS and Linux platforms due to inability to build `mksnapshot` tool running on Windows. Currently, the --env.snapshot flag is ignored on Windows.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(...) due to inability to build the mksnapshot tool when running on Windows. (...)

---

# Android App Bundle
Android App Bundle is a new publishing format which makes it easier to reduce the size of application download from Google Play Store, without uploading multiple `.apk` files.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend going for something more descriptive here. For example, the Android developer docs have a lot of information on this subject https://developer.android.com/guide/app-bundle/. You can use something like this:

"An Android App Bundle is a new publishing format that contains all the compiled code and resources of your app, but leaves the actual APK generation and signing to Google Play. The store then uses the app bundle to generate and serve optimized APKs based on the device configuration of the specific user. In general, the benefit of using Android App Bundles is that you no longer have to build, sign, and manage multiple APKs to support different devices, and users get smaller, more optimized downloads. For more information about the Android App Bundle, see the About Android App Bundles article in the official Android Developer documentation"

Alternatively, you can add only the last sentence, so that people who would like to learn more can go there and read the article :)

Android App Bundle is a new publishing format which makes it easier to reduce the size of application download from Google Play Store, without uploading multiple `.apk` files.

## Available configurations
By default 'arm64-v8a' CPU architecture is excluded from the build of NativeScript application. The following configuration will enable it, but there is a chance that on older devices with this architecture this might affect the startup times.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing comma after By default:
By default, the arm-v8a CPU architecture is (...)

```

## Additional optimizations
If you want to improve the performance of your application with the `nativescript-dev-webpack` plugin you might want to make some additional changes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand this sentence correctly, you should use need to or should instead of might want to. And a comma is missing before you:
(...) application with the nativescript-dev-webpack plugin, you might want to should make some additional changes. (...)


The default file format that the `nativescript-dev-webpack` plugin produces when you execute `tns build android --bundle --env.uglify --env.snapshot --aab` is a `.blob` file.

> Note: The snapshot generation feature is limited to macOS and Linux platforms due to inability to build `mksnapshot` tool running on Windows. Currently, the --env.snapshot flag is ignored on Windows.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(...) due to inability to build the mksnapshot tool when running on Windows. (...)


For each of the architectures that you specify in your `webpack.config.js`, the plugin will produce a `snapshot.blob` file inside `assets/snapshots/${target_arch}/snapshot.blob`. Those files are **not** subject to Android App Bundle and you will find a corresponding `blob` for each architecture in the resulting `.apks`. This will increase the size of the resulting `.apks`.

If you want to take advantage of Android App Bundle you will need to instruct the `nativescript-dev-webpack` plugin to produce a `.so` snapshot. For this purpose you will need to have the Android NDK installed on your system. It is strongly recommended that the same version of the NDK is used to produce the snapshot file as the one used to compile the {N} runtime itself. Currently we use NDK r16b.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing comma before you:
(...) For this purpose, you will need to instruct (...)

@NickIliev NickIliev merged commit 9f7d0a4 into master Dec 5, 2018
@NickIliev NickIliev deleted the kddimitrov/android-application-bundle branch December 5, 2018 07:05
@lock
Copy link

lock bot commented Dec 5, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Dec 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants