2016-03-22 22:51:36 +01:00
# Vulkan examples on Android
2016-02-16 15:07:25 +01:00
## Vulkan on Android
Since Vulkan is not yet part of the Android OS (like OpenGL ES) the library and function pointers need to be dynamically loaded before using any of the Vulkan functions. See the **vulkanandroid.h** and **vulkanandroid.cpp** files in the base folder of the repositoy root for how this is done.
2016-03-22 22:51:36 +01:00
## Device support
- **To run these examples you need a device with an Android image that suports Vulkan**
- Builds currently only support arm-v7, x86 may follow at a later point
2016-03-26 11:49:37 +01:00
- Android TV leanback launcher is supported, so the examples will show up on the launcher
2016-03-22 22:51:36 +01:00
- Basic gamepad support is available too (zoom and rotate)
## Imporant note
2016-03-26 11:49:37 +01:00
The Android part of the Vulkan example base is not yet finished, and while the examples run fine they might encounter some problems as most of the resources are not yet correctly released when closing the app.
2016-03-22 22:51:36 +01:00
## Building
### Requirements
- [Android NDK r11b ](http://developer.android.com/ndk/downloads/index.html ) - Somewhere in your sarch path
- Batch files for building are provided for windows only, with linux to be added at some point
### Building the Examples
2016-02-16 15:07:25 +01:00
2016-03-26 11:49:37 +01:00
### Complete set
**Please note that building (and deploying) all examples may take a while**
#### Build only
```
build-all
```
This will build all apks and puts them into the **bin** folder.
#### Build and deploy
```
install-all
```
This will build all apks and deploys them to the currently attached android device.
### Single examples
These are for building and/or deploying a single example.
2016-02-16 15:07:25 +01:00
2016-03-22 22:51:36 +01:00
#### Build only
2016-02-16 15:07:25 +01:00
2016-03-26 11:49:37 +01:00
Call build(.bat) with the name of the example to build, e.g. :
```
build triangle
```
This will build the apk for the triangle example and puts it into the **bin** folder.
#### Build and deploy
2016-02-16 15:07:25 +01:00
2016-03-22 22:51:36 +01:00
```
2016-03-26 11:49:37 +01:00
build triangle -deploy
2016-03-22 22:51:36 +01:00
```
2016-02-16 15:07:25 +01:00
2016-03-26 11:49:37 +01:00
This will build the apk for the triangle example and deploys it to the currently attached android device.
## Removing
2016-02-16 15:07:25 +01:00
2016-03-26 11:49:37 +01:00
A batch file for removing all installed examples is provided in case you installed all of them and don't want to remove them by hand (which is especially tedious on Android TV).
2016-02-16 15:07:25 +01:00
2016-03-22 22:51:36 +01:00
```
2016-03-26 11:49:37 +01:00
uninstall-all
2016-03-22 22:51:36 +01:00
```
2016-03-26 11:49:37 +01:00
This will remove any installed Android example from this repository from the attached device.