xref: /aosp_15_r20/external/libwebsockets/test-apps/android/README (revision 1c60b9aca93fdbc9b5f19b2d2194c91294b22281)
1*1c60b9acSAndroid Build Coastguard Worker/*
2*1c60b9acSAndroid Build Coastguard Worker * libwebsockets Android client - libwebsockets test application for Android
3*1c60b9acSAndroid Build Coastguard Worker *
4*1c60b9acSAndroid Build Coastguard Worker * Copyright (C) 2016 Alexander Bruines <[email protected]>
5*1c60b9acSAndroid Build Coastguard Worker *
6*1c60b9acSAndroid Build Coastguard Worker * This file is made available under the Creative Commons CC0 1.0
7*1c60b9acSAndroid Build Coastguard Worker * Universal Public Domain Dedication.
8*1c60b9acSAndroid Build Coastguard Worker *
9*1c60b9acSAndroid Build Coastguard Worker * The person who associated a work with this deed has dedicated
10*1c60b9acSAndroid Build Coastguard Worker * the work to the public domain by waiving all of his or her rights
11*1c60b9acSAndroid Build Coastguard Worker * to the work worldwide under copyright law, including all related
12*1c60b9acSAndroid Build Coastguard Worker * and neighboring rights, to the extent allowed by law. You can copy,
13*1c60b9acSAndroid Build Coastguard Worker * modify, distribute and perform the work, even for commercial purposes,
14*1c60b9acSAndroid Build Coastguard Worker * all without asking permission.
15*1c60b9acSAndroid Build Coastguard Worker *
16*1c60b9acSAndroid Build Coastguard Worker * The test apps are intended to be adapted for use in your code, which
17*1c60b9acSAndroid Build Coastguard Worker * may be proprietary.  So unlike the library itself, they are licensed
18*1c60b9acSAndroid Build Coastguard Worker * Public Domain.
19*1c60b9acSAndroid Build Coastguard Worker */
20*1c60b9acSAndroid Build Coastguard Worker
21*1c60b9acSAndroid Build Coastguard WorkerThis directory contains an Android Studio (2.1.1) project that builds
22*1c60b9acSAndroid Build Coastguard Workerlibwebsockets (+ openssl + zlib) and an Android application that is able
23*1c60b9acSAndroid Build Coastguard Workerto connect to the 'dumb-increment-protocol' of the libwebsockets test server.
24*1c60b9acSAndroid Build Coastguard Worker
25*1c60b9acSAndroid Build Coastguard WorkerBuilding the native libraries requires the Android NDK which can be
26*1c60b9acSAndroid Build Coastguard Workerinstalled using the SDK manager.
27*1c60b9acSAndroid Build Coastguard Worker
28*1c60b9acSAndroid Build Coastguard WorkerThe app/src/main/jni/NativeLibs.mk is fully integraded with Gradle but will
29*1c60b9acSAndroid Build Coastguard Workeronly work on Linux and requires the following applications to be available
30*1c60b9acSAndroid Build Coastguard Workerin addition to the NDK:
31*1c60b9acSAndroid Build Coastguard Worker
32*1c60b9acSAndroid Build Coastguard Worker   awk cmake egrep git tar wget makedepend
33*1c60b9acSAndroid Build Coastguard Worker
34*1c60b9acSAndroid Build Coastguard Worker(makedepend can be installed from (Debian) xutils-dev)
35*1c60b9acSAndroid Build Coastguard Worker
36*1c60b9acSAndroid Build Coastguard WorkerTo build the project:
37*1c60b9acSAndroid Build Coastguard Worker
38*1c60b9acSAndroid Build Coastguard Worker- Open an 'existing project' with Android Studio and select this directory.
39*1c60b9acSAndroid Build Coastguard Worker  (answer yes/ok to the question to integrate with Gradle).
40*1c60b9acSAndroid Build Coastguard Worker
41*1c60b9acSAndroid Build Coastguard Worker- Open the file app/src/main/jni/Application.mk and make sure NDK_ROOT
42*1c60b9acSAndroid Build Coastguard Worker  is set correctly and that APP_PLATFORM is set to the appropriate API level.
43*1c60b9acSAndroid Build Coastguard Worker
44*1c60b9acSAndroid Build Coastguard Worker- Build the project with CTRL+F9
45*1c60b9acSAndroid Build Coastguard Worker  (open the gradle console to follow the build progress).
46*1c60b9acSAndroid Build Coastguard Worker
47*1c60b9acSAndroid Build Coastguard Worker- Install APK to device and run.
48*1c60b9acSAndroid Build Coastguard Worker
49*1c60b9acSAndroid Build Coastguard Worker- Connect to libwebsockets test server.
50*1c60b9acSAndroid Build Coastguard Worker
51*1c60b9acSAndroid Build Coastguard Worker
52