summaryrefslogtreecommitdiffhomepage
path: root/android/README.md
blob: e3b5a9c3e0c2fbe878c3df327cc03bf44d414011 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Mullvad VPN Android app

This directory contains the Android project as well as related files and information. Apart from the
content of this directory, the Android project also relies on building the [mullvad-daemon](../mullvad-daemon/)
(which includes the GotaTun WireGuard implementation) as a shared library bundled into the assembled APK.

The app is available for download on
[our website](https://mullvad.net/download/android/),
[GitHub Releases](https://github.com/mullvad/mullvadvpn-app/releases),
[F-Droid](https://f-droid.org/packages/net.mullvad.mullvadvpn/) and
[Google Play](https://play.google.com/store/apps/details?id=net.mullvad.mullvadvpn).

## Quick start

### Browsing the source code

The content in this directory (`<repository-root>/android`) follows a standard Android project
structure and can therefore be opened in Android Studio or any other IDE or editor of your choice.

### Building the app

The easiest and recommended way to build the Android project is to use the containerized build
(which requires `podman`):
```
../building/containerized-build.sh android --dev-build
```
See the [build instructions](./docs/BuildInstructions.md) for further information.

## Linting and formatting

### Kotlin formatting
`ktfmt` is used for kotlin formatting.

See the [official documentation](https://github.com/facebook/ktfmt) for how to use it as default
formatter in Android Studio. Ensure to set `kotlinLangStyle` as "Code Style" and to set the project
to rely on the `EditorConfig` (`.editorconfig` file).

Also, see the [`ktfmt` gradle plugin documentation](https://github.com/cortinico/ktfmt-gradle) for
how to use it as a gradle task.

### XML formatting
In order to format XML files, the script `scripts/tidy.sh` is used. As the script name implies, it's basically a helper script to run the tool called `tidy`. It needs to be installed unless the
container image is used.

Command to format:
```
scripts/tidy.sh format
```

Command to format and check for any changes:
```
scripts/tidy.sh formatAndCheckDiff
```

#### macOS
Since macOS is using a different version of `sed` running the tidy script (`scripts/tidy.sh`) will
lead to the creation of a large number of files ending with `-e`. The recommended fix for this
issue is to install the gnu version of `sed`. This can be done by running:
`brew install gnu-sed` and then set `gnu-sed` as your default `sed`.

### Android Gradle Plugin lint tool

The Android Gradle Plugin lint tool for linting of resources and code. The tool is configured to be
strict. See each `build.gradle.kts`for more information.

## Translations and localization

See the [locale README][desktop-locales-readme] for how to easily update translations. It also
includes documentation for which phrases and terms shouldn't be translated (Do Not Translate).
Also see the [translations converter README][translations-converter-readme] for documentation about
the tool used to sync translations between the Android and Desktop apps.

[desktop-locales-readme]: ../desktop/packages/mullvad-vpn/locales/README.md
[translations-converter-readme]: ./translations-converter/README.md

## Icons and assets

For a general overview of icons and graphics read [the graphics readme](../graphics/README.md).