Call Java class in Lua Android

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
AdrianN
Citizen
Posts: 73
Joined: Wed Mar 28, 2018 5:13 pm
Location: Lima

Call Java class in Lua Android

Post by AdrianN »

Hi, I successfully build apk using this repository.

https://bitbucket.org/MartinFelis/love- ... /src/11.2/

Now I am trying to use the bluetooth function. I have the code to a previously project, to make the connection.
But I no have any idea how to call the class in lua.

I used a little FFI in my projects, but I don't know how to call JNI.

Search in the forum I found this Library https://bitbucket.org/bartbes/jniwrap

I honestly don't know how it works and the project structure, but I receive the following error, using test.lua in this repository to call ExtraTest.java

Code: Select all

--main.lua
require "test"
I/SDL/APP: [LOVE] ERROR: test.lua:10: undefined symbol: getGlobalEnv

How should I do to call a Java class in Lua code in Android.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Call Java class in Lua Android

Post by raidho36 »

I'd suggest you implement this as a LOVE module. It's a straightforward and self-explanatory process.
User avatar
AdrianN
Citizen
Posts: 73
Joined: Wed Mar 28, 2018 5:13 pm
Location: Lima

Re: Call Java class in Lua Android

Post by AdrianN »

raidho36 wrote: Fri Oct 25, 2019 7:01 am I'd suggest you implement this as a LOVE module. It's a straightforward and self-explanatory process.
Do you mean adding a custom library, instead jniwrap, using c ++ code?

Like admob library https://bitbucket.org/bio1712/love2d-ad ... ules/ads/

I don't understand where exactly to put each part of JNIWrap in the project. I build but now I has another error haha.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 2 guests