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?
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.
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.
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.
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...
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.
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.
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.
Related
Read a number of questions on writing in just one language for both iOS and Android and what I learned is that it depends on the special functions you need. What I want to build is a very simple app that will ask the user what he or she is doing. We need this for billing the customers but my co-workers keep forgetting to update their time-sheet, so I want to write this little app that pops-up every x minutes and asks them what their doing. At the end of the day the list will be sent by e-mail or whatever.
Anyway.... is a pop-up from an app from the background a 'special' function? Can a general language be used on both for this?
Edit: I have searched for crossplatform tools, but all replies talk about specific functions that still require native coding. That is why I was wondering if something as simple as a popup with question and entering / saving a text, would be native or could easily be handled with a crossplatform tool.
You may use Xamarin to create a cross platform applications. I am satisfied with Xamarin platform at the moment. I have been working on native iOS, java for Android also.
Please keep in your mind that, it would be great if you are familar with these platforms because Xamarin is just a wrapper of methods which exist in the native platforms. Since I am familar with native Android and iOS, it makes me comfortable when I work on Xamarin platform.
My personal recommendation is to stick with Native platform. But if you have to work on cross platform, I believe Xamarin is a good option.
Pros:
If you are familiar with C#, it will help you a lot to develop an application for android, ios and windows platforms in Xamarin.
It is demanding platforms, and many big companies are looking Xamarin developers especially after the Microsoft acquisition.
Cons:
You need to buy a license.
There are other platforms as well, but I did not use any of them. Here are some of them
Cordova
HTML5
Unity
PhoneGap
Appcelerator
Corona
Qt
You may find useful the following urls
http://appindex.com/blog/ten-best-cross-platform-development-mobile-enterprises/
http://www.developereconomics.com/pros-cons-top-5-cross-platform-tools/
For sure what you describe can be achieved with using Ionic. Its a free solution and it comes with a lot of good documentation to get you up and running quickly. You'll need to use AngularJS for developing apps with Ionic so that might be a good solution if you know your way around that framework, or if you are familiar with Javascript or have done some web development before.
On regards to your question regarding native functionality (by popups I assume you mean notifications) Ionic sits on top of Cordova so there is a huge amount of native plugins that you can use to implement native functionality. You can take a look at plugins here.
Hope this helps!
I'm student and and my favorite language is C#.
However i must create my first application for android and I have just found something about Xamarin. Does it make sense to use that instead of Java? Beacouse Java really doesn't match me.
It's a academic project, but also I'd like to deploy that to Google Play Store.
In the Xamarin shop I found that I can develop my application on the free version, but propable i need Xamarin.Forms and buy INDIE license, isn't it?
Adam, I will greatly encourage you to write your first app in native Android. Xamarin is an amazing tool set and you should keep tuned in to Xamarin but be rest assured that Xamarin or any other non native development tool is not for the beginners nor the faint of heart.
The reason I encourage you to get started with native Android is because of Documentation, Examples and Getting Unstuck. When you run into problem with native Android, either Google already have a sample project that addresses that issue with code example, or it has already been asked, debated and answered in StackOverflow.
One thing that will help you though is the complexity of your first project, if you choose a complex app you may never ship it. If you choose a moderate app, then the issue of having to know Java is essentially a mute point because the framework provides most of the plumbing code you need to accomplish most basic use cases. The remaining Java you will pick up as needed.
Goodluck
It dosnt matter if your develop with Xamarin or native Java. You will always have to know about the Android Framework.
Futher you don't need to use Xamarin.Forms, you could also write the UI Part platform specific.
The need for Xamarin.Form is that you code your UI once and be able to deploy them to iOS, Android and WindowsPhone devices.
I hope this question is specific enough. I have a client for whom I made an iOS native app and an Android native app (same app, different platform). It's a fixed pixel design (I made this work for Android somehow:) and it works on iPad, iPhone and most Android devices (with some letterboxing). Now I am asked to write the same app for the Windows store and they want me to use HTML and JavaScript. My question is, when I use HTML and JavaScript, would it be "easy" for me to use this code into some sort of hybrid solution (PhoneGap, etc)? The app doesn't need much complicated functionality but does need to support push notifications on iOS and it needs to be able to play videos, preferably HLS. Any advice on what the best hybrid solution and do hybrid solutions allow you to build for Windows 8?
I'm a cross-platform developer working on PhoneGap and Titanium Appcelerator. The correct answer is "It depends". Currently the state of cross-platform development is not very recommendable. Yes, you can write plugins for PhoneGap and it does support windows phone but you will have a ridiculously hard time getting them to communicate with each other properly. I learnt this from experience.
If it was a hacking/hobby project to further the cause then I would say go for it but for a time-bound client project like yours, I would recommend against cross-platform solutions and go native instead. Plus native always gives considerably better control, speed and ease of development. You will probably develop it faster in native than cross platform anyway. I've played around with windows SDK and it seems easy to use and well-built with good documentation and you can use C# which is similar to Java since you have already used it on android.
You can also build windows 8 desktop apps using html and javascript natively but this isn't present in windows phone 8 yet.
As I mentioned, If you don't need too many native controls, then you can go cross-platform. For your requirements, it can be done. If you have already developed android and ios apps and only need windows app now, then going native would be easier. But if you have to make all 3 then you can go cross platform if your requirements are restricted to what you mention. Here's a good quora thread that discusses the pro's and cons:
http://www.quora.com/Is-Titanium-good-for-developing-iPhone-apps
Take a look on Xamarin
Main idea - they brings real native code for all platforms.
They have instruments to compile C# code that it can be used at all platforms
For example you should create UI in XCode (for iPhone) and use ModoDevelop to create DAL/BLL, then you can re-use C# code base over all other platforms
They have cross-platform iPhone/Android/WP7/W8 samples on GitHub
Also see Q&A on Stackoverflow tagged Xamaring
We are starting to build multiple apps for multiple clients both in IOS and Android native platforms. The problem is we are going completely native which is taking too much time.
I would like to look at the linked in method (http://arstechnica.com/information-technology/2012/10/a-behind-the-scenes-look-at-linkedins-mobile-engineering/) which is a more hybrid approach using HTML and native code.
The problem is I don't think Phonegap is that good - good for prototyping but maybe not for full versions of apps as it can be a bit slow and a bit buggy.
I would like to look into doing a model where we create like 65% HTML and 35% native to that device (like linked in)
Would anyone have any suggestions for this? Would people say we need a massive development team to pull such an approach off?
I welcome thought:)
Thanks
I have been looking at appcelerator it seems pretty fine! Without a doubt, one of the advantages of appcelerator is its support for multi-platform. I am interested in building an android app and maybe a iphone app later on. So it is not crucial to support multiple platforms at the moment.
If you disregard supporting multiple platforms and just focus on android development. Is appcelerator still advantageous? Does it lack any features of "Android sdk"?
(When I say "Andorid sdk" I mean development with Eclipse with native Android sdk, if it makes any sense)
We looked at Appcelerator when starting our Android project. We knew we would have to do an iOS client next, so Appcelerator was enticing.
We decided not to go that route because it doesn't support all the native features of each device.
For example, we decided early on that our user interface in Android would need a widget. No support for that in Appcelerator, as it's specific to Android. [This was a few months back -you may want to check again].
Compromising on the user interface was too much for us. We decided to go with C/C++ for the app logic and use Android SDK for the user interface.
Our apps now have two pieces: C/C++ as much as possible to the "brains" and the native (Android/Cocoa Touch) for the UI to take advantage of the UI experience.
Works of course for platforms that can integrate C/C++.
The parting advice: design your user interface first, then find a tool that can implement it. Users have high expectations of the UI in portable devices. Compromising on it early on may be the KOD for your project.
[EDIT] Every so often I see an upvote for this question. I would like to update with what we learned in the past two years:
Using C/C++ for the common parts of our application has paid off. It does require a slightly more complicated build process, but the savings are gigantic if the piece of code being shared is complex (as in our case).
For the user interface piece we are beginning to look into hybrid apps (some UI elements in HTML). There are still debates out there about HTML interfaces (Facebook and LinkedIn are two that move to native code for the UI), but also some reports that when chosen carefully it works. There is a great talk from Flipoard on that; with slides here.
UPDATE Oct/2014
In March/2014 Smashing Magazine published an excellent article comparing native iOS, native Android, PhongeGap (Cordova) and Appcelerator Titanium. They show the development of a simple app in each environment.
This is the last part of the series. At the top of this part there are links to the previous parts of the series and at the bottom there is the comparison of the approaches. There are also interesting comments from readers at the end.
UPDATE May/2015
Still get an upvote for this question every so often, so I would like to share what we have done since I wrote the first part of the answer.
We are now working on a project that also has a web client. We have now the iOS client, the Android client, plus the web client.
JavaScript is the natural choice for the web client.
Since we want to share as much code (at the business logic layer) across these clients, it means we need to find a way to run the JavaScript code in iOS and Android.
And that's what we ended up doing.
This is a summary of how we handle it:
For all clients: all data structures are defined with Google's protobuf. This allows to automatically generate the serialization/deserialization code for iOS and Android.
iOS: run the JavaScript code with the help of JavaScriptCore (a good overview here).
Android: run the JavaScript code with the help of Google's V8 engine.
The bridge between JavaScript and the iOS/Android layer can be a bottleneck, especially the serialization of the objects. We had to optimize a few things and learned a few lessons to stay out of trouble.
Generally the experience has been positive. We saved significant amount of time by sharing the code across all clients.
If I had to start another project like this one (that requires sharing code with web and mobile clients), I would also take a look at what Google did for inbox. It wasn't available when we started. Looks promising.
UPDATE August/2015
And the world keeps turning...
I would also take a good look at React Native if I had to start a new mobile app now.
It's based on JavaScript, bridging web and mobile development more easily.
There is a great tutorial in Ray Wenderlich's site.
UPDATE February 2016
My shortlist for cross-platform development is down to two:
ionic
React Native
I've been paying more attention to ionic because our web app uses AngularJS and so does ionic (Cordova + AngularJS). React Native will force the team to learn another framework (of course the argument is the opposite if your web app uses React).
Nevertheless, I'd seriously consider React Native, even having to learn another framework, because of the reported performance and look-and-feel of the app. From React Native's site:
With React Native, you can use the standard platform components such
as UITabBar on iOS and Drawer on Android
If you are starting now, I recommend you take the time to at a minimum complete their tutorials so you get a better feeling of each framework. Each tutorial can be complete in one to two hours:
ionic tutorial
React Native tutorial
For a simpler approach: Smashing Magazine just published (at the time I wrote this update) a good article showing how to use the native navigation elements to make the app feel (well...) native, while using web views to render the content. The article goes into the details of how to make the HTML/CSS usable in the mobile devices (it's not just pushing the HTML/CSS you already have).
If you only focus on develop apps for Android platform, I recommend you should use native Android (Eclipse + Android SDK as you said) instead Titanium.
Reason: Titanium is suitable if
You want to develop apps quicly, or
Your apps is simple, or
You see Java is so difficult (maybe :p ), so you choose the easier (Javascript of Titanium).
And here is the reasons why you should use native Android instead Titanium:
You want to develop a complex app, or
You want to customize app appearance. It's very important. Imaging you make an app for client, and they need their app to be customized for more eye-catching. Choosing Titanium means you must use their control, which lacks of ability to customize. It'd be better if using native Android that you can customize everything you want.
that is a very difficult question to answer without any specifics regarding the requirements of the application.
I would suggest you take a quick look at the API documentation of Appcelerator to see what the framework provides and also take a moment to list the basic requirements of your application and then determine what tool will be best for your project.
I think you are onto a good start using Appcelerator, since it uses JavaScript, etc. Easy to learn, but good examples. It will also enable you to use the same code and reach iPhone,iPad apps. Learning to use just the Android SDK is more complicated. Even then you still need to develop later iPhone etc apps. If you come from a web background this makes sense. There are good video's for quick learning. Good Luck
My experiences with Appcelerator seem to suggest they are more of an iOS shop. Their toolset for Android is, IMHO, quite lacking. ADT supports visual UI building and debugging on device, which Titanium Studio does not. There has been a bug filed about this for several months now, and it continues to be delayed. If your focus is Android, use Google ADT or MOTODEV Studio for Android. These IDEs are quite nice and are used by professionals.
The above answer presents a great way to develop mobile apps. DO NOT COMPROMISE ON A HIGH-QUALITY USER EXPERIENCE.
Lacking of bluetooth support is a huge deficiency for Appcelerator and no one gives a clue about roadmap.
edit : appcelerator now have BT support in Tizen 3.1
Well, in the new version of appcelerator (APPCELERATORSTUDIO 4.0) you can have alloy projects, and something like css files for your UI (tss), so in fact they are really customizable.
Greatings
Appcelerator has a lot of support and it really easy to use. It supports 100% of native api calls now. They have really good documentation too.
I'm facing a dilemma: I have a solid ASP.NET development experience in C# and looking to start mobile development. I have done research and know that there are some hacks for getting a development environment for iOS on windows, and recently after Apple lifted ban on 3rd party dev apps, Adobe Flash CS5 can be used to package iOS apps. I do have some prior experience with Flash and AS2.
So my question is: should i use Flash CS5 for iOS and MonoDroid for Android or should i just get Mac and learn Objective C for iOS and learn Java for Android? What would be the most practical solution?
Thank you in advance
EDIT: In the end, after trying out both Java Development in Eclipse against Android SDK and Mono for Android, I decided it's best to write Android apps in native environment. Eclipse FTW! As for iOS, I think it will also be best to use native Mac tools and Objective C.
While there are ways to get around using Objective-C for iOS development, I'm going to recommend that you learn it anyway. You need a Mac to deploy anyway, you might as well use it to develop as well.
Objective-C is bloody bizarre when you first start using it, with its strange square brackets and odd ways of doing things. However, once you've spent some time writing code in it, a change happens in your brainmeats and you suddenly realize that this is really an elegant way to work. Xcode is also quite an excellent IDE.
You can start with the iPhone Applications Programming lessons on iTunesU from Stanford. It's free, and covers what you'll need to know pretty throughly.
Worst case, you've learned a new language, and how Apple thinks iPhone apps should be developed. Even if you ultimately use something else, that understanding will help you out long term.
Take a look at monotouch & MonoDroid (Coming Soon), it still requires a mac. But you can open your solutions in VS2010 and use resharper, and just use the Mac for deploying and building. Take a look at this Here to open monodevelop solutions in Visual Studio.
http://monotouch.net
For Android, I would recommend learning Java. I just started working with Android in Java on my Windows machine after developing some ASP.NET sites. I'm familiar with Java, but the syntax is so similar to C# that it's very easy to understand and pick up. So far it is more difficult figuring out and remembering the details of the architecture of mobile applications as opposed to the language. It also helps that there are a number of good books and online resources for converting from C# to Java and vice versa.
Update: I found a good post over on programmers.stackexchange.com that talks about C# vs. Java for Android development with good discussion on the pros and cons of switching: https://softwareengineering.stackexchange.com/questions/33076/as-a-c-developer-would-you-learn-java-to-develop-for-android-or-use-monodroid-i
#Dimitri I was almost your identical skill set when iOS 2.0 was released. I decided to try and learn Objective-C and now its my language of choice. Its a bit different to start with but most of the changes are simple to learn. Whether you are programming for iOS using Objective-C or something like Monotouch either way you have to learn the frameworks. If you use Monotouch you will never be able to be on the bleeding edge of the iOS enhancements. Using Objective-C you will be able to use the latest beta APIs and ensure your apps work right. You will need a Mac to deploy to the App store so just bite the bullet and get a Mac. Get a MacBook Air 13"
I went the route of Monotouch for iOS and Java for the Android. Unfortunately, Monotouch still requires a Mac. I am currently participating in the MonoDroid beta, which looks pretty promising too. It's all a matter of taste. I should also note that, for the most part, HTML/Javascript is a nice way to get portable apps in some circumstances. I would expect HTML5 apps to become even more viable as tooling improves.
I choose to use the Mono, MonoTouch and Mono for Android technology stack from Novell. When coupled with a micro framework like MonoCross (open source in Google code) it helps me write applications for both iPhone and Android devices while leveraging a shared code base for much of it. I would highly suggest the same route, it has allowed me to implement numerous solutions for small businesses and enterprise customers alike.
I didn't have the ASP .NET experience like you, but I was a Pocket PC/Windows CE developer so C# and the .NET Framework were also my strongest tools when I started on journey towards Mono many moons ago.
You can do iOS,Android and Windows using Xamarin.
Android and Windows can be done easily but doing iOS on Windows was tough so far like networked mac is required for debug and development but things have changed now.
Microsoft has introduced Xamarin Live Player using which you can debug,develop and deploy the app completely in windows without the help of any Apple system but to sign and release the app to appstore you will need Apple System though