How does Android work for Java programmers?
Android development is commonly a buzz in the world of Java programming. Android has kept Java at the top of the programming language rankings since its appearance in 2007. Now, how important is it for Java programmers to learn Android? It all depends, if you like app development and you need a mobile version for your app, Android offers you this opportunity. Millions of phones that run Android are available and will grow over time, higher than iPhone's iOS. All of this makes us want to read more about Android programming, and this article is about that.This tutorial will give you a boost to better understand how the Android system works? not detailed but a general view. One advantage for java programmers is that the Android API is very similar to the Java API. Another advantage is that you could use the same tools for example, use the Eclipse IDE to develop Android applications, integrating the plugin provided by Google. In the other direction, if you want to go for iOS development, a great journey awaits you with Objective C and the iOS SDK. It's easier for a C++ programmer to learn Objective C and iOS, than a Java programmer. So the battle between Java and C++ continues with the development of applications for smartphones. Back to our topic, now, let's see how Android works?
How runs Android?
Android uses Java for app development. So, it is necessary to have the minimum basics in java to be able to code your Android apps using the API provided by Google. The similarities are limited here, Android does not use the JVM virtual machine to execute the compiled files, but it uses Dalvik virtual machine, which is not a real JVM and does not translate code into byte code. .class files are compiled in DVM under the DEX extension. After the conversion to DEX format, the .class files are put together with other resources in an Android package (APK) that will then be distributed and installed in the different smartphones. The Dalvik VM is based on the Apache Harmony project library, which means that it does not support all the features of the J2SE API. If you're using the Eclipse IDE to code Android apps, then you don't have to worry about that because it's going to help you with the auto-complete feature.How are Android apps run?
If you're familiar with Linux and process processing, then it is easy to understand how Android apps run. By default, each Android app has a single identifier provided by the Android operating system. After the application starts, it runs in its own virtual machine by its own processes. The Android operating system handles the launch and termination of the app process, if necessary. This means that each android application runs in isolation from the others, but they can have access to hardware and other system resources. If you're familiar with mobile development like J2ME, then you might have an idea about permissions. So when an application is installed or launched, it must have the required permissions to connect to the internet, photos, camera, GPS and other system resources. It is the user who accepts during installation and gives these permissions to the application, or he refuses. all of these permissions are set in the manifest.xml file in the Android app, which contains all the app's settings. The four major components in the development of an application are: activities, services, Content Providers and Broadcast Receivers.Of these four, it is the activities that are of great importance since they are used to manage the display on the screen. An activity represents a single screen, for example in a video game, you can have multiple screens to log in, score, instructions, and screen to play. Each of these screens represents an activity inside your app. The advantage is that the system that handles the creation of objects Activity, when you want to start an activity, you need to call the startActivity() which takes an object Intent. The system creates a new object Activity or summarizes the execution of an already existing object. The android system has its method to not waste the memory of the phone or tablet, it launches, stops, creates and destroys activities and applications. This is the Life cycle of a application in android.
Now that we've had a general introduction and how Android works, what are you waiting for? Starting today, you can start developing Android apps and create your first HelloWorld app. You can also search for the solution on the internet when you encounter programming problems. All this allows you to deepen your knowledge little by little over time.