hey guys, i am researching android app development, and i cant find much on building an app in C or C++, so my question is, is it possible to build an android app using only C or C++ ?
Yes, in the most recent versions of the NDK they've announced such a capability. Before that, you could have an app that's a thin layer of Java on top of a C/C++ NDK core.
The majority of the run-time library is still Java-based, and accessing it from C++ is not exactly straightforward. JNI exposes the Java world to C/C++ callers, but it does not look pretty.
You might consider one of the other cross-platform services (e.g. MoSync), but realize that they are also limited in the sense that they give you access to more generic language features. Advanced or new features, such as NFC are not yet supported. Further, if you are planning on deploying the app commercially, you may have to pay them a royalty. You can get a better amount of information at their site.
Sure, using the Android Native Developers Kit.
Related
Is it Reccommended to use JNI and C++ Code to make a shared library code between IOS and Android ?
I'am asking this because i think it not just saves us plenty of wasted time for implementing same logic in both platforms but also we will have the speed of a C++ core Backing the logic-process of our modules.
Update :
I ask my question in another way :
is it recommended to share a C++ Library for core functions of Android And IOS versions of a similar app ? or it would be better to completely migrate the codes to a multiplatform language ?
Since I remember my needs back then, I know that hybrid apps were not an option, Also JNI is not used for making cross-platform apps but the best use is to drive hardware peripherals via native UNIX scripts for Android or run c++ code on Android. So if we omit PhoneGap, Appcelerator, Ionic etc we will be facing several cross-platform technologies that have attracted many developer attentions so far.
Xamarin:
The framework was founded by the same people who have created Mono, an Ecma standard-compliant, .NET Framework-compatible set of tools. Xamarin offers developers a single C# codebase that can be used to produce native apps for all major mobile operating systems.
Unlike many other frameworks, Xamarin has already been used by over 1.4 million developers from around the world. Thanks to Xamarin for Visual Studio, developers can take advantage of the power of Microsoft Visual Studio and all its advanced features, including code completion, IntelliSense, and debugging of apps on a simulator or a device. Xamarin Test Cloud makes it possible to instantly test apps on 2,000 real devices in the cloud. This is by far the best way how to deal with the heavy fragmentation of the Android ecosystem and released bug-free apps that work without any major issues.
But being honest I didn't enjoy my first time face-to-face meeting with Xamarin. There were so many bugs and also speed and performance problems were bothering.
React Native
React Native is developed by Facebook and used by Instagram, Airbnb, Walmart, Tesla, Baidu, and many other Fortune 500 companies. It is an open-source version of Facebook’s React JavaScript framework. Because React Native uses the same UI building blocks as regular iOS and Android apps, it’s impossible to distinguish a React Native app from an app built using Objective-C or Java. As soon as you update the source code, you can see the changes instantly manifest in an app preview window. Should you ever feel the urge to manually optimize certain parts of your application, React Native lets you combine native code with components written in Objective-C, Java, or Swift.
The ones I mentioned above are not the only options, but since now they are the most used frameworks between programmers. But beware that Flutter is being publicly announced by Google in Google IO and maybe it may be going to create a hit soon.
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.
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.
I have been making applications in objective-c for a while now and feel i have a good understanding of it. I have made many applications and started to make a few basic games.
However now i want to target android as well. I recently saw applications such as Titanium and the Corona SDK that let you create applications in one language and deploy to both platforms.
My question is, for anyone experienced with these, would it be better to just learn how to code android applications and then make android and IOS apps separate, or would it be a much better idea to start using one of the development tools listed above?
I am mostly talking about the creation of standard applications, not games.
Also more importantly, if i was to apply for a job developing apps, what would the company look for? someone experienced in each platforms sdk respectively or someone familiar with the titanium or Corona sdk to code and output the applications simultaneously.
I have looked around but could only find info regarding people who have not started either android or iphone development. I am already very familiar with objective C and iphone development.
If anyone could help that would be great!
Thanks for your time!
I would suggest learning the native Java SDK. If you do anything more than simple apps, you will feel constricted and limited by the "write-once" SDKs, as you will want to exploit the special features of each platform.
In terms of employability, if you know both native iPhone and Android SDKs, I would expect your employability to be much higher than just knowing the cross-platform language. By having a diverse knowledge of "complex" languages (such as Java, and Objective-C), if employers wanted a cross-platform approach, they are likely to recognise your adaptability to the task at hand. Conversely, by only knowing cross-platform development, you are limiting your chance of work - if the client wants to use a more in-depth feature of the platform, which is not available in your cross-platform language.
Do you have any experience with java? If not that is where I'd suggest you start. And unfortunately there is no end all be all for what potential employers may be looking for. It would depend on specifically what they are aiming to have you create(Something that makes more specialized use of one of the platform features would likely require a native app. Where as something mostly based on content could use one of the phoneGap type solutions because it would result in farthest reach). I can tell you though any of the "write once - deploy everywhere" platforms that are currently available will limit the amount of platform APIs you'll get access to. Because of that I would personally suggest that you dig into the native platform some and once you have a decent understanding of how things fit together at a high level maybe start looking at the other solutions.
If you know Java, then my suggestion is to use native SDK for developing in Android. The OO concept is similar, but the design is somehow different from iPhone development.
Platform like Titanium may be good for standard apps. But I think gradually you will want to use and tweak the native libraraies functionality. Then common frameworks are weak.
I have been developing for iPhone, Android, JME, BlackBerry also tried HTML5, my understanding is to use the native platform if possible. But the app is small, e.g. a simple RSS reader, then common platform is okay.
But in most of the cases, developer want to use special features provided by the native SDKs.
If you want to stick to Objective C, checkout out Apportable, which enables you to build and deploy Objective C apps to Android.
This is my first S/O question, please be gentle!
I'd like to know more about porting C applications to native ARM for use on Android devices.
I can make simple programs using the prebuild toolchain which comes with the source, but how can I use this toolchain with applications which are more than one file and require configure and make?
This article explains it quite well:
http://davanum.wordpress.com/2007/12/09/android-invoke-jni-based-methods-bridging-cc-and-java/
Basically, you create a shared library like you normally do, wrap it with JNI and call it with native methods from Java.
At Google I/O they talked about introducing an "NDK" -- native development kit -- that should simplify the process of creating applications that use native (C) code.
It's worth noting a couple of things before you go too far down this route:
The NDK will provide limited functionality. It will be primarily intended to offer a way to run extremely time-sensitive code natively, but won't have access to the full system, nor will it provide an alternative application development model (you'll still need to write most of your app for Dalvik).
You can write native apps without the NDK, but you won't be able to distribute them to end-users using the conventional APK application package supported by the app store. It's really only a viable option if your app is being distributed as part of the carrier / OEM build - and even then isn't recommended.