Fix JavaClassWrapper so it actually works

This commit is contained in:
David Snopek
2024-08-20 16:53:57 -05:00
parent a5830f6eb9
commit 78883a52c6
9 changed files with 397 additions and 60 deletions

View File

@ -6,6 +6,15 @@
<description>
The JavaClassWrapper singleton provides a way for the Godot application to send and receive data through the [url=https://developer.android.com/training/articles/perf-jni]Java Native Interface[/url] (JNI).
[b]Note:[/b] This singleton is only available in Android builds.
[codeblock]
var LocalDateTime = JavaClassWrapper.wrap("java.time.LocalDateTime")
var DateTimeFormatter = JavaClassWrapper.wrap("java.time.format.DateTimeFormatter")
var datetime = LocalDateTime.now()
var formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm:ss")
print(datetime.format(formatter))
[/codeblock]
</description>
<tutorials>
</tutorials>