Android

  • By
  • February 9, 2022
  • Android

Android –

App Module

For new project, the default module name is “app”.

A module can be defined as a collection of source files and build settings that allow you to divide your project into discrete units of functionality. In a project you can have multiple modules and one module may use another module as a dependency. Every  module is  independently built, tested, and debugged.

The container is provided by Module for our app’s source code, resource files, and app level settings such as the module-level build file and Android Manifest file.

For Free, Demo classes Call: 8037516148
Registration Link: Click Here!

When the Create New Module window is opened, Android Studio offers the following app modules:

  • Phone and Tablet Module
  • Android Wear Module
  • Android TV Module
  • Glass Module.

All of the above provide essential files and some code templates that are appropriate for the corresponding app or device type –

Manifests:

It contains the Androidmanifest.xml file.

AnddroidManifest.xml describes the fundamental characteristics of an app and each of its components.

It works as an interface between your Android OS and your application, so if you forgot to declare your components in this file then it will not be considered by the OS.

Xmlns:android

Defines the Android namespace. It should always be set to 

“http://schemas.android.com/apk/res/android”

Package:

A full Java Language style package name for Android Application. It should be unique. A package name serves as a unique identifier for the application. Whatever is the package name it is also the default name for the application process.

You cannot change the package name, once you publish your application . The package name defines your application’s identity If you change the package name then it is considered to be a different application and users of the previous version cannot update to the new version because the package name defines the identity. Learn more at Android Course in Pune.

Version Code:

It is an integer which is only used to determine whether one version is more recent than the other, with higher numbers demoting more recent versions.

The greatest possible value for version Code is 2100000000.

VersionName:

It is a string used as a version number which is displayed to the users. It has no other purpose other than getting displayed to the user.

android:minSdkVersion

This is treated as an integer designating the minimum API Level required for the application to run. The Android system will prevent the user from installing the application, if the system’s API Level is lower than the value specified in this attribute . You should always declare this attribute.

android:targetSdkVersion

This is an Integer designating the API level that the application targets. The default value equals that given to minSdk Version if it is not set. The system that you have tested against the target version and the system should not enable any compatibility behaviors to maintain your app’s forward-compatibility with the target version is getting informed by this attribute. Your application is still able to run on older versions (down to minSdkVersion).

<application>…<application>

It includes all the declarations to the application. Android: icon: It will point to the application icon available under res/mipmap.

The application uses the image named ic.launcher.png located in the mipmap folders.

For Free, Demo classes Call: 8037516148
Registration Link: Click Here!

What are views? What is a View group?

View:= A View is anything which occupies a rectangular area on the screen and is responsible for drawing and event handling..

Thus every UI element is a subclass of View, to be more precise of android.view.View.

The Android SDK provides a set of pre-built views that can be used to construct a user interface, e.g. buttons, Check box, Edit Text etc. which are also known widgets.

Widgets:-

Widgets can be thought of as a “pre-built control” through which the user interacts with your application.

Commonly used View subclasses:

  • TextView
  • EditText
  • ImageView
  • ProgressBar
  • Button
  • ImageButton
  • CheckBox
  • DatePicker

These are some of the many subclasses of the View Class. Read more at Android Classes in Pune.

View Group:

The View Group is a subclass of View( android.view.View) and provinces invisible containers that hold other Views or other View Groups and define their layout properties. Thus all the Layouts and Containers inherit from View Group. The base class for layouts and views containers is the view group.

The following commonly used View Group subclasses are present in Android.

  • Linear Layout
  • Relative Layout
  • List View
  • Grid View

For Free, Demo classes Call: 8037516148
Registration Link: Click Here!

Introduction about layout and its types –

Layouts are subclasses of ViewGroup which specifies how a view should be arranged inside the viewgroups. Layout defines the visual structure for a user interface.

You can create layouts in two ways:-

Declare UI elements in XML.

Instantiate layout elements at runtime.

The standard layouts are:

LInear Layout –

Linear layout is a layout that arranges its children in a single column or a single row.The direction of the row can be set by calling setOrientation().

Relative Layout –

A Layout where the positions of the children can be described in relation to each other or tho the parent.

Frame Layout –

Frame Layout is designed to block out an area on the screen to display a single item.

Table Layout –

A Layout that arranges its children into rows and columns. Read more at Android Training in Pune.

 

Author:-

Jyostna Binjwe

SevenMentor Pvt Ltd

Call the Trainer and Book your free demo Class for now!!!
call icon

© Copyright 202! | Sevenmentor Pvt Ltd.

 

Submit Comment

Your email address will not be published. Required fields are marked *

*
*