Android is an open supply cellular platform launched by Google in 2008 and ever-since it grew to become the favorite for individuals and builders all over the world. Android is Linux based mostly multiprocess and multithreaded OS. Google’s Android OS isn’t restricted to telephones however you should utilize it to construct a DVR, a handheld GPS, an MP3 participant and so on.
Though Android platform is an open supply and customizable, Android customers and builders have turn into ordinary to the constructs developed by Google for Android gadgets. Using these Android ideas is important for creating an utility shortly.
Key Ideas of Android are:-
Apps and APK Recordsdata
Views and ViewGroups
Structure XML Recordsdata
I’m supplying you with an summary of the Android key ideas. After having a primary understanding of Android’s key ideas you’ll be able to go deeper into the assorted completely different matters.
Apps and APK Recordsdata
An Android app is an Android Utility. An app is packaged in an APK file i.e. Android utility package deal. The APK file accommodates the compiled Java code and different sources like photos and texts for the Android utility
An Android exercise is a GUI element. You’ll be able to perceive it as a window in a desktop utility. As cell phone screens are small, an exercise takes up the entire display. Should you open a number of actions then they’re stacked on prime of one another. You can’t organize actions aspect by aspect like you are able to do with desktop home windows.
Actions are distinctive, centered actions which a consumer can take. As it’s troublesome to scroll, zoom in or click on hyperlinks on a small display therefore it is suggested that an app show just one exercise per display. This may current probably the most related info to the consumer and permits them to launch a brand new display for extra info or click on the again button to view the earlier exercise. The display can expose a number of duties but it surely ought to assist the consumer full only one exercise at a time.
In Android, a fraction is a fraction of a complete consumer interface. A fraction solely takes up a part of the display. Fragments are used within the actions. Fragments may also be used inside completely different actions. Fragments comprise Views and ViewGroups inside them.
View and ViewGroups
Android GUI components come into three classes i.e. Actions, Views and ViewGroups. Actions are the home windows/screens. Views are the person GUI components, like a TextView which shows a textual content, a Button that customers can click on on and so on. ViewGroups are containers for Views. A ViewGroup really teams a set of Views collectively. Views and ViewGroups could be nested inside an exercise or inside even a fraction which is nested inside an exercise.
Structure XML Recordsdata
Actions, fragments and ViewGroups can use XML information to outline their structure and contents. The structure XML information inform which GUI elements an exercise or fragment accommodates and in addition the styling of the GUI elements i.e. The dimensions, margins, padding and so on.
In case your app requires performing a operate past its core capabilities like opening a photograph, enjoying a video or trying up a contact then you must discover out whether or not a instrument that may carry out that operate already exists within the OS or in a third-party app. If sure then you will get the good thing about that performance utilizing intents.
For e.g. In case your app accesses consumer contacts then you should utilize intent objects to launch the gadget’s present Contacts utility. This removes the programming duplication and in addition pace up the consumer’s interplay with the gadget because the consumer is not going to must study once more the best way to add a contact to your app.
Android Widgets are literally GUI elements which could be displayed outdoors of an exercise. For e.g. A climate widget which reveals immediately’s climate is proven on many Android dwelling screens. Widgets have been packaged and carried out as a part of an Android utility. Additionally generally Views in Android are additionally known as widgets. For e.g. Many GUI elements are positioned in a Java package deal referred to as android.widget. GUI elements are usually not identical as a widget which may stay on the house display of an Android gadget. Therefore you must perceive the distinction between GUI elements which can be utilized inside ViewGroups, Fragments and elements which can be utilized inside ViewGroups, Fragments and Actions and in addition inside Widgets and Widgets which may stay on the house display of the Android gadget.
In Android, Companies are background course of which could be executed on an Android gadget even when no utility is seen. Companies don’t require a consumer interface. For e.g. A Service can test a distant server for updates or backup information each hour.
Android gadgets have many inbuilt sensors which you’ll entry out of your Android purposes. For e.g the inbuilt GPS in smartphones is a sensor. Due to this fact you will get entry to the GPS from inside your Android purposes.