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