Hello readers, welcome back!! I was running out of topics to scribble something in my blog. Finally one question which I used to ask from some months came to my mind “How these guys are making excellent applications (some of them are even free) for smartphones?” This article is to throw some light in the area of developing android applications.
I have given an introduction about android in my previous blog Something aboutAndroid. Now, lets move on to something bigger
Introduction
Developers can create apps for the Android platform using the Android SDK.
Java is the major programming language for developing apps and it runs on Dalvik, a custom virtual machine designed for embedded systems:-runs on the top of Linux kernel. The application framework is very powerful and does most of the stuffs for the developers: - access device hardware, access location information, run background services, set alarms, notifications in status bar etc.
Every app runs on its own process with its own instance of DVM, which executes the file in Dalvik executable format (.dex). Dalvik has the capability to enable single device to run multiple VM (Virtual Machine) efficiently.
DVM = Register based à runs classes complied by JLM à transformed into .dex format using DX Tool
So, what about the .Net developers? Do they have to learn Java to create android app? Though, the core concept of c# and Java is the same, it’s not an easy job for .Net developers. Yeah, I know that..!!! Here’s the happy news
Though Java is the underlying code for Android OS, one company called XMarian became the game changer ripping out most of the java with c#.
Xmarian has created platform called Mono allowing Android and iOS apps to be developed using c#, which runs on the top of Java. They have 2 major products MonoTouch – for iOS and MonoDroid – for Android.
Also company’s recent project - “XobotOS Research Project” shows the capability to remove java layer via “machine translation of Android from Java to C#”. In this project, more than million lines of Java code was converted to C# using tool called Sharpen.
1st Android application
So, that was some theory about android app and its time to create one. Whenever we learn a new language, we always create “Hello World!” no matter Web, Windows applications.
a) In Java
Steps to create Hello World in java is given below
Language - Java should be installed in the PC
IDE - Install Eclipse IDE, which will make the development easy since it has great plug-in for project creation and management (Development can also be done using command-line without Eclipse)
Platform – At least one Android platform need to be installed in the SDK environment
AVD – Create an AVD (Audio Virtual Device), which defines the system image and device settings used by the Android Emulator (to run the applications)
Project – Create android project in Eclipse; - there are some basic properties in this step such as Build Target (to choose Android version), project name, package name etc.
Code – write the code: - one important class is Activity which can run and do work.
UI - Create the android user interface, composed of hierarchies of objects called “Views”. View is a drawing object used in UI layout such as button, image, label etc. Android provides an option to create alternate UI construction model – XML based layout files, to avoid changing source code for small UI changes.
Structure of XML = Tree of XML elements à each node is the name of View class
Run – Once the code is compiled run the app using Emulator that creates run configuration and launches the Android Emulator
Output – The extension of android application is .apk. In-fact this is a zip file disguised as an .apk. If we change the extension and un-zip, we can see a file named classes.dex, the most important file containing encrypted java files.
We can’t directly convert a jar file to an apk since it has to be compiled for Android. Eclipse IDE makes this job easier for us to create signed apk from java code.
b) In .Net
Steps to create Hello World in .Net is given below
Language – Install .Net Framework 4.0
IDE – Visual Studio 2010 is the best IDE available for creating .Net applications. We also need a plug-in “Mono for Android or MonoDroid” for creating Android apps.
Mono is an open source implementation of the .NET Framework based on the C# programming language and the Common Language Runtime (CLR). Mono tools make it possible for .NET developers to use their existing code, libraries, tools, and C# skills to build mobile apps for devices running Apple's iOS and Google's Android.
Project – Mono gives various options for creating new application – Library project, Android application, and OpenGL (Open graphics library for 2D and 3D graphics) application
Code – Similar to Java, Activity class is used in c# too, and this will be created on project creation
UI – Create the user interface for Android. XML based UI system (XAML and HTML) can be used to replace hard coded strings. The auto-generated Resource class is in the
Resource.designer.cs and this should not be edited.
Emulator – MonoDevelop is the emulator used by Monodroid. We should choose a device on running the emulator
Deploy & Launch – Monodroid deploys the app to the emulator and then launches it.
Hands on with Eclipse
The detailed steps to develop apps using eclipse is given below
1) Install JDK – this is freely available in Java / Oracle web site
2) Install Android SDK Kit – free download from http://developer.android.com
3) Run Android SDK – You need to install the required Android packages and resources online (for each version such as 2.2, 2.3, 4.0 etc)
4) Install Eclipse for Java
5) Install the ADT plug in to create Android project in eclipse – you cannot create new android project without this
6) Run AVD Manager (this comes along with SDK) – Create virtual device bases on the android version and target device
7) Run Eclipse – Create new Android project – do some coding (many examples available online)
8) Compile and test it in AVD Manager
Conclusion
I hope my article has given some basics idea to .Net and Java developers who want to start developing android apps. The examples mentioned in the article are to create stand alone applications similar to windows apps.
What about web applications? While designing web applications don’t we have to think about smartphones? Hmm, may be next article!!!
If you like the article, post your comments and keep reading!!! Thanks ..See you later!!!
If you like the article, post your comments and keep reading!!! Thanks ..See you later!!!
Resources
Developer’s guide – http://developer.android.com/guide/basics/what-is-android.html
Creating apps in .Net - http://docs.xamarin.com/android
Appreciate your comments. I will try to come up with more stuffs relevant to current technical era ...its never ending world ..is it !!!
ReplyDeleteThanks a bunch for sharing this with all people you
ReplyDeleteactually know what you're talking about! Bookmarked. Kindly additionally seek advice from my web site =). We may have a link trade agreement between us
Also see my website - how to lose weight fast
sure buddy...im on it
DeleteThanks , I have recently been searching for info about this
ReplyDeletesubject for ages and yours is the greatest I've discovered till now. But, what in regards to the bottom line? Are you certain concerning the supply?
My site > www.experimental.xf.cz
Hi! Someone in my Facebook group shared this site with us so I came to take a look.
ReplyDeleteI'm definitely loving the information. I'm bookmarking and will be tweeting this
to my followers! Terrific blog and amazing
design and style.
my webpage > myroutelog.com
Thanks....ur blog is very unique in the idea...good
DeleteIt's truly very complex in this active life to listen news on TV, therefore I simply use world wide web for that purpose, and get the most up-to-date news.
ReplyDeleteTake a look at my web-site : how to download movies
Hi this is somewhat of off topic but I was wondering if
ReplyDeleteblogs use WYSIWYG editors or if you have to manually code
with HTML. I'm starting a blog soon but have no coding expertise so I wanted to get advice from someone with experience. Any help would be enormously appreciated!
Also see my web page - free iphone
Hi, the blog template is very simple and you dont need coding experience at all... you will get 2 formats - text (WYSIWYG) and html (with tags)... i use the 1st one and keep typing and inserting images...the preview option will show how exactly it will look after publishing... also u can chose a template to change the overall look-and-feel
DeleteThanks for the good writeup. It if truth be told was a entertainment account it.
ReplyDeleteLook complex to far added agreeable from you! However,
how could we keep in touch?
Feel free to visit my site ; learn piano
Woah! I'm really enjoying the template/theme of this website. It's simple, yet effective.
ReplyDeleteA lot of times it's tough to get that "perfect balance" between superb usability and visual appearance. I must say you've done a superb job with this.
Additionally, the blog loads super fast for me on Firefox.
Superb Blog!
Feel free to surf my site ... speed up my computer
Thanks.. :)
DeleteHi there to all, it's really a good for me to visit this site, it consists of useful Information.
ReplyDeleteMy webpage - Work from home
Thanks...please do look at my latest post about mobile communication
DeleteGood replies in return of this matter with real arguments and describing the whole
ReplyDeletething about that.
Also visit my webpage nfl streaming
What's up to every body, it's my first visit of this web site; this web site carries awesome
ReplyDeleteand really fine data in favor of readers.
Here is my web-site ... www.buddymeets.com
It's in point of fact a nice and useful piece of information. I'm glad that you shared this useful info with us.
ReplyDeletePlease keep us informed like this. Thanks for sharing.
Also see my webpage > adsense alternatives
Hello there, You have done an incredible job. I will certainly
ReplyDeletedigg it and personally suggest to my friends. I'm confident they will be benefited from this web site.
Also visit my webpage :: lmqs1983.com
Hi there to every body, it's my first go to see of this website; this web site contains amazing and actually fine information designed for visitors.
ReplyDeleteLook at my site ... Diablo 3 guide
Remarkable! Its genuinely awesome post, I have
ReplyDeletegot much clear idea on the topic of from this piece of writing.
My web page ... cigarettes online
Very nice article, exactly what I needed.
ReplyDeleteAlso see my website :: Asunnot Alanyassa
hello there and thank you for your info – I have certainly picked up something new from right here.
ReplyDeleteI did however expertise several technical points using this website, as I experienced to
reload the site lots of times previous to I could get it to load properly.
I had been wondering if your hosting is OK? Not that I'm complaining, but sluggish loading instances times will sometimes affect your placement in google and can damage your high quality score if advertising and marketing with Adwords. Anyway I'm adding this RSS to my e-mail and can look
out for much more of your respective exciting content.
Make sure you update this again soon.
my web site - asuntoturkista.net
Excellent web site you have got here.. It's hard to find high-quality writing like yours nowadays. I seriously appreciate individuals like you! Take care!!
ReplyDeleteHere is my blog post :: tattoo removal
Thanks for the comments
DeleteI just like the helpful information you supply on your
ReplyDeletearticles. I'll bookmark your blog and check again here frequently. I'm fairly certain I will be
informed many new stuff proper here! Good luck for
the next!
Visit my page - bleaching skin
Hiya very nice site!! Guy .. Beautiful .. Superb ..
ReplyDeleteI'll bookmark your site and take the feeds additionally? I'm glad to
search out so many useful info here in the post, we want work
out extra techniques in this regard, thanks for sharing.
. . . . .
Feel free to visit my blog post - laser tattoo removal
Pretty component to content. I just stumbled upon your web site and
ReplyDeletein accession capital to assert that I acquire actually loved
account your blog posts. Any way I will be subscribing for your
feeds and even I success you access persistently rapidly.
Visit my website :: http://livingmy1life.com/blogs/entry/Doctor-s-Suggestions-About-Ways-To-Get
This design is steller! You obviously know how to keep
ReplyDeletea reader entertained. Between your wit and your videos, I was almost
moved to start my own blog (well, almost...HaHa!) Fantastic job.
I really loved what you had to say, and more than that,
how you presented it. Too cool!
my web site > immobilienalanya.Net
Thanks for comments...all the best for your new blog
DeleteHi there, every time i used to check webpage posts
ReplyDeletehere in the early hours in the dawn, as i love to find out more and more.
Also visit my web-site - http://insainia.com/?module=VilmaCarna¶ms=28681
You can certainly see your enthusiasm within the work you write.
ReplyDeleteThe sector hopes for more passionate writers such
as you who aren't afraid to mention how they believe. At all times follow your heart.
Also see my website > complaindrain.com