Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit beba583

Browse files
committed
Anjay-java 2.8.0.1
1 parent 8d391a1 commit beba583

File tree

163 files changed

+435
-490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+435
-490
lines changed

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,4 @@ CMakeDoxyfile.in
276276
CMakeDoxygenDefaults.cmake
277277
CPackConfig.cmake
278278
CPackSourceConfig.cmake
279-
bindings/distributions/*
280-
bindings/docs/*
281-
bindings/generated/*
282-
bindings/scripts/*
283-
bindings/tmp/*
279+
library/.cxx/

.gitmodules

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
[submodule "deps/anjay"]
2-
path = deps/anjay
1+
[submodule "native-library/deps/anjay"]
2+
path = native-library/deps/anjay
33
url = https://github.com/AVSystem/Anjay.git
4-
[submodule "deps/jni.hpp"]
5-
path = deps/jni.hpp
4+
[submodule "native-library/deps/jni.hpp"]
5+
path = native-library/deps/jni.hpp
66
url = https://github.com/mapbox/jni.hpp.git
7-
[submodule "deps/mbedtls"]
8-
path = deps/mbedtls
7+
[submodule "native-library/deps/mbedtls"]
8+
path = native-library/deps/mbedtls
99
url = https://github.com/ARMmbed/mbedtls

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Changelog
2+
3+
## 2.8.0.1 (Dec 1, 2020)
4+
5+
- Update Anjay to 2.8.0
6+
- Reorganize project structure
7+
- Configure publishing of packages to Maven Central
8+
9+
## 2.7.0 (Oct 23, 2020)
10+
11+
- Initial release using Anjay 2.7.0

README.md

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[![Maven Central](https://img.shields.io/maven-central/v/com.avsystem.anjay/anjay-android?label=maven%20central%3A%20anjay-android)](https://search.maven.org/artifact/com.avsystem.anjay/anjay-android)
2+
[![Maven Central](https://img.shields.io/maven-central/v/com.avsystem.anjay/anjay-java?label=maven%20central%3A%20anjay-java)](https://search.maven.org/artifact/com.avsystem.anjay/anjay-java)
3+
14
# Anjay-java [<img align="right" height="50px" src="https://avsystem.github.io/Anjay-doc/_images/avsystem_logo.png">](http://www.avsystem.com/)
25

36
## About
@@ -9,55 +12,54 @@ This project provides almost 1:1 API bindings between [Anjay](https://github.com
912
This is a preview release and we don't provide any guarantees about API stability
1013
or library reliability.
1114

12-
## Usage
15+
## Using in Android Studio
16+
17+
This project is released to Maven Central repository as
18+
`com.avsystem.anjay.anjay-android`. Add `mavenCentral()` in `repositories`
19+
section of your build script and `implementation 'com.avsystem.anjay:anjay-android:2.+'` in `dependencies` to use it.
20+
21+
## Using anjay-java package
22+
23+
Although the `anjay-java` package is released on Maven Central repository, it
24+
requires native shared library to be available. See the Compilation guide for
25+
details how to build the native library.
1326

14-
First of all, remember to update all submodules using `git submodule update --init --recursive`.
27+
## Compilation guide
1528

16-
### CMake
29+
First of all, remember to update all submodules using
30+
`git submodule update --init --recursive`.
31+
32+
### Build library
1733

18-
The library, example client and documentation can be built from command line as follows:
1934
```sh
20-
$ cmake .
21-
$ make -j
35+
./gradlew :library:build
2236
```
2337

24-
To run the example client execute:
38+
The `jar` file is placed in `library/build/libs` directory. Note that it doesn't
39+
include the native library, which can be found in `library/build/cmake`
40+
directory.
41+
42+
### Build and run demo
43+
2544
```sh
26-
$ java -Djava.library.path=$PWD/ -jar demo.jar
45+
./gradlew :demo:build
46+
java -Djava.library.path=library/build/cmake/ -jar demo/build/libs/demo.jar
2747
```
2848

2949
By default, the client attempts to connect to `coap://127.0.0.1:5683`, but it
30-
can be customized using command line arguments. Use `--help` to see all available
31-
options.
32-
33-
### Android Studio
34-
35-
1. Start with creating a simple base project (_Empty activity_ for example),
36-
using Java and API 26 or newer.
37-
2. In the left navigator right click on the _app_ and select
38-
_Link C++ Project with Gradle_, set _Build System_ to _CMake_ and choose
39-
_CMakeLists.txt_ file from the root project directory.
40-
3. As of today's version of mbed TLS (2.23.0) there's a problem preventing it
41-
from compiling. A crude and simple workaround for this is to edit
42-
application's `build.gradle` as below:
43-
```
44-
android {
45-
// ...
46-
defaultConfig {
47-
// ...
48-
externalNativeBuild {
49-
cmake {
50-
// Workaround for bad casts within mbed TLS
51-
cFlags "-Wno-pointer-sign"
52-
}
53-
}
54-
}
55-
// ...
56-
}
57-
```
58-
4. The next step is to add Anjay's Java sources to your project so that you can
59-
actually use the bindings. The simplest way to do it is to create a symlink
60-
from `bindings/main/java/com/avsystem` to `app/src/main/java/com/avsystem`.
61-
5. Now you can check
62-
`bindings/src/main/java/com/avsystem/anjay/demo/DemoClient.java` to see
63-
how to use Anjay's Java bindings.
50+
can be customized using command line arguments. Use `--help` to see all
51+
available options.
52+
53+
### Building for Android
54+
55+
```sh
56+
ANDROID_SDK_ROOT=<path to Android SDK> ./gradlew -Pandroid :library:build
57+
```
58+
59+
The `aar` files are in `library/build/outputs/aar` directory.
60+
61+
### Running tests
62+
63+
```sh
64+
./gradlew :testing:check
65+
```

bindings/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

bindings/library/gradle/wrapper/gradle-wrapper.jar

Lines changed: 0 additions & 1 deletion
This file was deleted.

bindings/library/gradlew

Lines changed: 0 additions & 185 deletions
This file was deleted.

0 commit comments

Comments
 (0)