Skip to main content

Posts

Showing posts with the label Android

Building Blocks of Android

Hello Everyone! This article is based on the different components of Android. There are some essential components which are the building blocks of any android new project. Each component has its unique feature and maximum components must be included in any android project to improve the functionality. The android building blocks question has also been asked in university exams (sometimes along with the Android Architecture ). There are some essential components which makes up the building blocks of any android project. Every component is an entry point through which the system or a user can enter the app. Some components rely upon others. These loosely coupled components are bound by the application manifest file which contains description of each component and how they interact. The manifest file also contains the app’s metadata, its hardware configuration and platform requirements, external libraries and required permissions. T...

Intents in Android

Hello Everyone! This article is based on Intents in Android. Here we are discussing about intents, their types, basic intent syntax, intent filter and intent object. From university exam perspective, intents in android is an important topic and has been asked few times along with Android Architecture and Android Components . Intents are message passing mechanisms that are used within an application as well as between various applications. Intents in general are used to navigate users among various activities within same application or in a different application. A classic example of intent is using intent between two different applications. Suppose a location of a place is shared on WhatsApp. When the user clicks on the location, he/she is then transferred into google map application where they can see the location on the map. Intents are not only restricted into moving/switching from one application to other but can also be used to - (...

Android Dalvik Virtual Machine

Hello Everyone! In this article we are discussing about the Dalvik Virtual Machine. It is one of the important concept in android architecture. Dalvik Virtual Machine has also been asked few times in university exams (sometimes as a separate question and sometimes along with the Android Architecture ). Dalvik Virtual Machine is one of the key elements of Android Application. The Dalvik Virtual Machine (DVM) is an android virtual machine which is optimized for mobile devices. It optimizes the virtual machine for memory, battery life and performance. Dalvik Virtual Machine is only supported by the android operating system. The overall execution is faster using Dalvik VM. Rather than using a traditional Java Virtual Machine, Android uses its own custom VM, designed to ensure that multiple instances run efficiently on a single device. One reason for using Dalvik VM is that Java VM was not open source and hence not efficient to use on a la...

Android Architecture Stack

Hello Everyone! In this article we are discussing about the android architecture. It is essential for all the android application developers to understand the android architecture to get a clearer idea about the structure on which the application is made. From the exam point of view, the android architecture stack question has been asked several times (sometimes along with the Dalvik Virtual Machine ). Android operating system is a stack of software components which is roughly divided into five sections and four layers. The five sections of android architecture are- Linux kernel Libraries Android Runtime Application Framework Applications This is a layered architecture with each section having a different functionality. A) Linux Kernel - It is the bottom most layer of the architecture. This is the kernel on which android is based. This layer provides a level of abstraction between the hardware devices. It also contains all the l...

Creating a List using List View in Android Studio

Hello Everyone, In this blog we are using the concept of List View. ListView is a view which groups several items and display them in vertical scrollable list. The list items are automatically inserted to the list using an Adapter that pulls content from a source such as an array or database. Here we are using a array of string to store the list items. Follow the steps given below to create an android project with the ListView      1) Open Android Studio and select New Project. Select an Empty Activity.   2) Click on Project -- Res -- Layout -- (Right Click on Layout) -- New -- Layout Resource File. Rename this file as "activity_listview". This file will display the contents in textbox. Here we require two xml files, one to define the structure of list view and other to display the content of list view. The activity_main.xml file contains the ListView structure. Thus all the files necessary for this project are created. Now ju...

Creating Two Activities in Android Studio

Hello Everyone, In this blog, we are creating an android application which will allow the user to go from one activity to another using a simple button widget. Here we are going to use android components like activity, button widgets and intents. In this application we will use two activities- MainActivity and SecondActivity.  Follow the steps given below to create an android project with two activities.   1) Open Android Studio and select New Project. Select an Empty Activity. Thus your first activity (MainActivity) is created.   2) Once the new project is created, go to File -- New -- Activity -- Empty Activity.   3) Rename the activity as "SecondActivity". Also select the option to generate a Layout file. Do not change the other settings. Now, your second activity is also created.   4) Copy-paste the code given below in the respective files. Then build and run the application. MainActivity.java ...