I need to hand over variables to java from lua.

I can find a good tutorial “Tutorial: Corona Enterprise Quickstart (Android)”;

But I’m sorry that there is no tutorial I can hand over the variables from my lua file.

I can see how to run java code with this tutorial but I need more.

I’ve been trying to find a solution, but I couldn’t.

Is there anyone who can give a solution or some code I can refer to?

https://forums.coronalabs.com/topic/46330-corona-enterprise-quickstart-tutorials/

I would try the basic tutorials above.

Well the Quick Start tutorial kind of shows you. There is a line something like:  luaState:pushBoolean( 1 ) or something like that that will take a Java Boolean (1 or 0) and push it on the Lua object’s stack. Corona knows how to pop those values back off and return them to your Lua code.

In the CoronaEnterprise folder there are several sample apps in /Application/CoronaEnterprise/Samples that show you how to do this. If you would prefer real-world examples, visit http://github.com/coronalabs and search for “plugin-source” (https://github.com/coronalabs?utf8=✓&query=plugins-source). Study those for additional examples for how to do things.

Rob

Have a look at the “SimpleLuaExtensions” sample project under Corona Enterprise’s Samples folder.  It shows several example on how to push variables of differents types (booleans, numbers, strings, arrays, tables) between Lua and java and vice-versa.  It’s pretty well commented on the Java side, explaining how each Java method call to Lua works.  Should answer all of your questions.  :slight_smile:

https://forums.coronalabs.com/topic/46330-corona-enterprise-quickstart-tutorials/

I would try the basic tutorials above.

Well the Quick Start tutorial kind of shows you. There is a line something like:  luaState:pushBoolean( 1 ) or something like that that will take a Java Boolean (1 or 0) and push it on the Lua object’s stack. Corona knows how to pop those values back off and return them to your Lua code.

In the CoronaEnterprise folder there are several sample apps in /Application/CoronaEnterprise/Samples that show you how to do this. If you would prefer real-world examples, visit http://github.com/coronalabs and search for “plugin-source” (https://github.com/coronalabs?utf8=✓&query=plugins-source). Study those for additional examples for how to do things.

Rob

Have a look at the “SimpleLuaExtensions” sample project under Corona Enterprise’s Samples folder.  It shows several example on how to push variables of differents types (booleans, numbers, strings, arrays, tables) between Lua and java and vice-versa.  It’s pretty well commented on the Java side, explaining how each Java method call to Lua works.  Should answer all of your questions.  :slight_smile: