summaryrefslogtreecommitdiff
path: root/src/contrib/SDL-3.2.20/build-scripts/pkg-support/android/INSTALL.md.in
blob: 80321c2e02d8acf54cc009e7fa4b5cf47f17fa5e (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
79
80
81
82
83
84
85
86
87
88
89
90
91
# Using this package

This package contains @<@PROJECT_NAME@>@ built for the Android platform.

## Gradle integration

For integration with CMake/ndk-build, it uses [prefab](https://google.github.io/prefab/).

Copy the aar archive (@<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar) to a `app/libs` directory of your project.

In `app/build.gradle` of your Android project, add:
```
android {
    /* ... */
    buildFeatures {
        prefab true
    }
}
dependencies {
    implementation files('libs/@<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar')
    /* ... */
}
```

If you're using CMake, add the following to your CMakeLists.txt:
```
find_package(@<@PROJECT_NAME@>@ REQUIRED CONFIG)
target_link_libraries(yourgame PRIVATE @<@PROJECT_NAME@>@::@<@PROJECT_NAME@>@)
```

If you use ndk-build, add the following before `include $(BUILD_SHARED_LIBRARY)` to your `Android.mk`:
```
LOCAL_SHARED_LIBARARIES := SDL3 SDL3-Headers
```
And add the following at the bottom:
```
# https://google.github.io/prefab/build-systems.html

# Add the prefab modules to the import path.
$(call import-add-path,/out)

# Import @<@PROJECT_NAME@>@ so we can depend on it.
$(call import-module,prefab/@<@PROJECT_NAME@>@)
```

---

## Other build systems (advanced)

If you want to build a project without Gradle,
running the following command will extract the Android archive into a more common directory structure.
```
python @<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar -o android_prefix
```
Add `--help` for a list of all available options.

# Documentation

An API reference, tutorials, and additional documentation is available at:

https://wiki.libsdl.org/@<@PROJECT_NAME@>@

# Example code

There are simple example programs available at:

https://examples.libsdl.org/SDL3

# Discussions

## Discord

You can join the official Discord server at:

https://discord.com/invite/BwpFGBWsv8

## Forums/mailing lists

You can join SDL development discussions at:

https://discourse.libsdl.org/

Once you sign up, you can use the forum through the website or as a mailing list from your email client.

## Announcement list

You can sign up for the low traffic announcement list at:

https://www.libsdl.org/mailing-list.php