Skip to content

Commit

Permalink
all: clean up and add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
larpon committed Oct 15, 2024
1 parent a99aa3f commit c38e73e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ You can build an Android app ready for the Play Store with the following command
```bash
export KEYSTORE_PASSWORD="pass"
export KEYSTORE_ALIAS_PASSWORD="word"
vab -prod --name "V App" --package-id "com.example.app.id" --icon /path/to/file.png --version-code <int> --keystore /path/to/sign.keystore --keystore-alias "example" /path/to/v/source/file/or/dir
vab -prod --name "V App" --package-id "com.example.app.id" --icon-mipmaps --icon /path/to/file.png --version-code <int> --keystore /path/to/sign.keystore --keystore-alias "example" /path/to/v/source/file/or/dir
```
Do not submit apps using default values.
Please make sure to adhere to all [guidelines](https://developer.android.com/studio/publish) of the app store you're publishing to.
Expand Down
1 change: 1 addition & 0 deletions cli/cli.v
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ pub fn args_to_options(arguments []string, defaults Options) !(Options, &flag.Fl
activity_name: fp.string('activity-name', 0, defaults.activity_name,
'The name of the main activity (e.g. "VActivity")')
icon: fp.string('icon', 0, defaults.icon, 'App icon')
icon_mipmaps: fp.bool('icon-mipmaps', 0, defaults.icon_mipmaps, 'Generate App mipmap(-xxxhdpi etc.) icons from either `--icon` or, if exists, a .png in app skeleton "res/mipmap" directory')
version_code: fp.int('version-code', 0, defaults.version_code, 'Build version code (android:versionCode)')
//
output: fp.string('output', `o`, defaults.output, 'Path to output (dir/file)')
Expand Down
2 changes: 1 addition & 1 deletion cli/options.v
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub mut:
c_flags []string @[long: 'cflag'; short: c; xdoc: 'Additional flags for the C compiler']
v_flags []string @[long: 'flag'; short: f; xdoc: 'Additional flags for the V compiler']
lib_name string @[ignore] // Generated field depending on names in input/flags
icon_mipmaps bool @[xdoc: 'Generate App mipmap(-xxxhdpi etc.) icons from either `--icon` or, if exists app skeleton']
icon_mipmaps bool @[xdoc: 'Generate App mipmap(-xxxhdpi etc.) icons from either `--icon` or, if exists, a .png in app skeleton "res/mipmap" directory']
assets_extra []string @[long: 'assets'; short: a; xdoc: 'Asset dir(s) to include in build']
libs_extra []string @[long: 'libs'; short: l; xdoc: 'Lib dir(s) to include in build']
version_code int @[xdoc: 'Build version code (android:versionCode)']
Expand Down
14 changes: 14 additions & 0 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Freqently Asked Questions

- [Where is the `examples` folder?](#where-is-the-examples-folder)
- [Generating `mipmap-xxxhdpi` icons in the APK/AAB](#generating-mipmap-xxxhdpi-icons-in-the-apkaab)
- [`vab` can't find my device when deploying?](#vab-cant-find-my-device-when-deploying)
- [The app force closes/crashes when I start it?](#the-app-force-closescrashes-when-i-start-it)
- [`vab` can't find my SDK/NDK/JAVA_HOME?](#vab-cant-find-my-SDKNDKJAVA_HOME)
Expand All @@ -25,6 +26,19 @@ Note that not all of V's examples have been written with Android in mind and
may thus fail to compile or run properly, pull requests with Android fixes are
welcome.

## Generating `mipmap-xxxhdpi` icons in the APK/AAB

Yes. Pass `--icon-mipmaps` when building your application.

The icon mipmaps will be generated based on the image passed via `--icon /path/to/icon.png`,
or if `--icon` is *not* passed (or invalid) `vab` will try and generate the mipmaps
based on what image that may reside in the "package base files" directory's "`res/mipmap"`.

For a vanilla build of `vab` the mipmap icons will be generated based on:
`platforms/android/res/mipmap/icon.png`

See [Package base files](https://github.com/vlang/vab/blob/master/docs/docs.md#package-base-files) for more info.

## `vab` can't find my device when deploying?

You [need to enable debugging](https://developer.android.com/studio/command-line/adb#Enabling) on your device.
Expand Down

0 comments on commit c38e73e

Please sign in to comment.