Xamarin.android instead of Java - android

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.

Related

Writing for iOS and Android - possible for this function?

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!

Tips to shift from App Inventor to Eclipse

I am very good with AppInventor to build Android apps. I have good knowledge of C++ and little knowledge of Java and GUI building in Java. Suggest me how should I shift from App Inventor to Eclipse to build Android apps? Which path should I follow? Is building in Eclipse similar to building in AppInventor like defining different components and then handling their events? Or is it much more than that? Please guide me.
There is also the AppInventor to Java Bridge project at java.appinventor.org, details see below
About:
The AppInventor to Java Bridge project is an addition to
AppInventor that creates a Java written version of the application
from an existing application created through AppInventor. After
creating an application through AppInventor,the user can download a
version of the application that is written in Java, which uses the
JavaBridge* library .
What Our Application Can Do:
Create an Android project in JavaBridge using AppInventor
Applications that use texting, internet and/or sound are supported
Limitations:
- Location aware applications not yet supported
- Nested lists are not yet supported, and will produce incorrect code
UPDATE: the newest version of that tool can be found here: java.appinventor.org
Definitely you should check out the "ALTERNATE Java Bridge". The regular one, built originally by the app inventor team has long since been abandoned. Another programmer picked up the torch and has steadily been using, and improving the bridge for some time. I have been using it myself for 2 years and it is fantastic.
The google project is at: https://code.google.com/p/alternate-java-bridge-library/
and the google discussion group is at : http://groups.google.com/group/alternate-java-bridge-library-discussion
I would just go to the google project site above and ready the tutorial. It is very easy to get started, and he is really good about answering questions for newbies (and i can assist with that as well).
You could take a look at the App Inventor Java Bridge. Check out the link for lots of information, also see here...
The Google App Inventor Java Bridge The App Inventor Java Bridge helps
make a transition from developing Android applications with App
Inventor for Android, to developing with Java and the Android SDK. It
lets you incorporate App Inventor components into apps that you create
in Java with the standard Android SDK tools. If you’ve been using App
Inventor and know some Java, then the Java Bridge is a good way to get
started with the SDK, because building with App Inventor components
hides many of the complexities of the Android framework. As you gain
experience, you can switch over to regular SDK development and create
apps that harness the full power of Android.
Here another link:
http://code.google.com/p/apptomarket/ and you also find videos about the Java Bridge on Youtube, for example this one

Is developing an application for Android using Lua only possible?

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.

Why must I manually edit the XML file in Eclipse? Can it be set to be done automatically as I develop the UI?

I do not have to do such manual updating in App Inventor so it is logical that Eclipse would have a similar automatic update feature.
App Inventor is made especially for non-programmers. Its main purpose is to give everybody the possibility to basicly develop an app so that one with a great idea and no or low programming knowledge would be able to get it done.
Now, Eclipse is an IDE that integrates great with the Android SDK. So it only helps you with basic stuff that any IDE does, plus some things about Android integration (like test your app on the emulator/device really easy).

Appcelerator vs Android SDK

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.

Categories

Resources