22

So I read this article on Mobile Orchard and, as I'm planning on having my first steps in Android development, it got me thinking: is it possible to develop for Android in Lua only? I Googled the topic but found no definitive answer. I know Java is the "base style" for Android but for the coding newbie which I am (elementary Python, basic C++), Lua seems somehow clearer and more friendly. Then here goes my question: can one develop an Android app using Lua only? If so, could you please show me some directions to move from here?

finnw
  • 47,861
  • 24
  • 143
  • 221
Straightfw
  • 2,143
  • 5
  • 26
  • 39

7 Answers7

16

I've been developing a mobile application in Lua to control robots remotely from iOS and Android phones. The app is in pure Lua and runs on top of Mosync platform using MobileLua. There is still some plumbing required, but it's not too complex.

I also have a debugger and a Lua IDE (ZeroBraneStudio) that support debugging of Lua scripts running remotely (including MobileLua scripts running on Android or iOS devices). I provide a demo app you can use as a client to run simple scripts and check remote debugging in action.

[Update] If you are interested in more game oriented options, there are several available: (1) already mentioned Corona SDK, (2) Moai, and (3) Gideros Mobile. There is also Marmalade Quick and Cocos2d-x Lua bindings (for example, quick-cocos2d-x). All these toolkits/frameworks allow to develop in Lua.

Here is a detailed comparison of Moai vs. Corona.

Paul Kulchenko
  • 25,884
  • 3
  • 38
  • 56
8

I know this is an older question, but just to correct some misinformation (in the comments) for people who come later, Corona SDK (as of spring 2013) has a Starter Edition which is free -- no splash screen or anything. The main difference between it and the "Pro" version is you can't do in-app purchases in the Starter Edition. But you can use it to create apps for sale, etc. No expiration date on it or anything.

And in answer to the original question, learning Java may allow you to write Android apps, but if you then also want to target iOS you don't have any great options. By choosing something that's cross-platform from the beginning you can target Android or iOS or both. Lua (in any of the flavors already mentioned) is a great base language to learn for mobile development.

J. A. Whye
  • 331
  • 2
  • 3
  • Wow, thanks a lot for the answer! Though the question is quite old, such information is still very relevant to me :) I wasn't aware that Corona decided to create an edition allowing you to publish for free. That's some great news, thanks once again :) And as for Lua - I've already coded quite a bit in Java since the question but as I see another voice encouraging to Lua from you, I think I may give it a shot soon, too :) – Straightfw May 12 '13 at 16:33
7

The question is what kind of app do you want to build and what skills do you have. If you are already familiar with JavaScript there is Phonegap/Cordova. If you are building games there are a number of frameworks for 2D and 3D which use Lua. Some are free, others have licensing fees but are worth it if it provides a solution to your problem. All have pros and cons. For example I'm not sure if I would want to build an RSS reader in a game framework. Java is just another language, I would recommend just learning Java and the Android framework to start and knowing what is there before adding another application specific framework layer on top.

Morrison Chang
  • 11,691
  • 3
  • 41
  • 77
  • Thanks. I chose it as a best answer as it made me look through the Lua frameworks and I found Corona which blew my mind thanks to its simpliness. Thanks! :) – Straightfw Aug 04 '12 at 14:48
  • Because nothing has changed the last 6 years i add a comment to the answer. Games are almost always written using native NDK and this is fully supported, no Java required, tons of other solutions. For "normal" apps, it's still Java or Kotlin but no script language. – Lothar Jun 12 '18 at 15:33
3

Corona SDK allows you to write iOS and Android apps in Lua. Its very easy to learn, but its not free. Edit: I saw you posted that you found Corona just after I sent my post...

Kev
  • 15,899
  • 15
  • 79
  • 112
amirfl
  • 1,634
  • 2
  • 18
  • 34
  • Wow, looks absolutely brilliant! I wish I could select two answers as the best :) Thank you so much, would surely come in handy many times! I already see how many of the question I was going to have are covered there. However, are you familiar with some similar frameworks which are cheaper? It's quite a lot for me to pay $150 (assuming I'd get the student license) though I know it's an outstanding quality you pay for. – Straightfw Aug 04 '12 at 15:26
  • With Corona you can develop your apps and test them for free. You only have to pay the license once you want to publish them. At that point, if your app and marketing are good, you can make the money back. Another option is http://www.giderosmobile.com, which has a free program, but they leave a splash screen on your app. – amirfl Aug 04 '12 at 15:48
  • I'm afraid you may be mistaken. I downloaded a trial and it says it's gonna work for 30 days, which is definitely too little to get used to the whole SDK and develop a fully-fledged (even simple) game which may be profitable. Also, are you sure one can get to marketing and advertising his game without the license and no one's going to say a word about it? I mean, is the only perk license gives publishing to the Market? – Straightfw Aug 05 '12 at 13:01
  • The information is based on what I've found here: http://www.giderosmobile.com/pricing/ I'm not experienced with Gideros, but only with Corona. – amirfl Aug 05 '12 at 23:03
  • I was talking about Corona :) When I install it, it says I have 30 days left. The question about running the marketing before buying the license was with regards to Corona as well. – Straightfw Aug 06 '12 at 10:52
  • I guess that changed since when I was a trial user of Corona. Anyway, I'd still recommend them. Back then you can use Corona for free to develop your app, once you decide to publish it, you had to get the subscription. Marketing has little to do with the development platform itself, so there is nothing wrong with starting the marketing process before development begins. – amirfl Aug 06 '12 at 12:09
  • I see. Though, I believe the marketing does have something to do with the SDK. Namely, if I develop a game with an SDK and then put an advert showing this game's features (developed using the SDK) or some gameplay and announce a release date, I'm practically advertising something that I'm not yet entitled to. Of course, the game is developed by me but does the free trial allow me to advertise what I created with it any way I want and the only thing is that I can't do is publish it till I pay? – Straightfw Aug 06 '12 at 12:37
3

You can try http://scormpool.com/luastudio Develop and run code on your device including iOS, Android, Mac, Win.

Exporter can help you to make standalone app on listed above platforms.

mobiler.a
  • 31
  • 1
0

This may not be useful to the OP, however for other people interested in using lua to write their apps, I'd share my thoughts. So to answer the question:

Yes, you can use only lua to write apps for android using LuaJava from the kepler project (though I don't believe its being maintained anymore). You can create and manipulate Java objects seemlessly, and interact with the Android APIs through lua. You can even create UI elements dynamically using just lua. However, a small amount of java bootstrap code is needed to start the lua VM from your app. The AndroLua project is a great place to start for Android. The creator has done a lot of work making lua work with Android and packaging it all into an app. From experience I can say it works great! However, I would in no way recommend this to a beginner, as it requires a lot of knowledge about java and lua to make things work, meaning more work not less.

For AndroLua, just clone the repo and use that as a base for your own app. Last time I used it, I just imported it into android-studio, and after fixing a few problems with my own setup, had it compiling and running on my device.

o080o
  • 11
  • 1
0

If only pure Lua then the answer is no.. unless you want to use a lot of libraries

If you want to make little Android app/games then use a game engine, learning is a step by step process, don't dive straight into the hard part.

James Penner
  • 71
  • 1
  • 6