التخطي إلى المحتوى الرئيسي

المشاركات

عرض الرسائل ذات التصنيف Android Tutorials

Android Introduction

What is Android A Software platform and operating system for mobile, tablet, and other small device applications, now android operating system is also used on Smart TV, a Sensor device, Laptop, and multiple electronic device system. The android operating system is based on the Linux kernel that's why it is a secure and reliable operating system. Android was found way back in 2003. It was developed in Palo Alto, California. Android was developed by Andy Rubin, Rich Miner, Nick Sears, and Chris White. Android was purchased by GOOGLE in AUGUST,2005 for 50 million $. What is  Open  handset  alliance(oha) It’s a consortium of several companies. This group of companies is allowed to use the source code of Android and develop applications. The reason for Nokia not to develop Android  Mobiles is Nokia is not part of OHA. FEATURES OF ANDROID 1) Android is not a single piece of hardware. 2) Android supports wireless communication using:-   2.1)  3G Networks ...

What is Activity in Android?

 What is the activity? ........................................... It is a predefined class of Java that is used to provide a code layer and design layer to create an android application screen. The activity uses a .java file to manage code and a .xml file to manage design. The activity has two different classes 1) Activity  --->  It is the parent class that is used to provide functionality for the current version only. 2) AppCompatActivity ---> It is a child class of activity that is used to provide functionality for the current version and the previous version of the android device. class A extends Activity {   } class B extends AppCompatActivity { } here class A and B both are activity class What is onCreate() in Android Activity? It is a predefined method of Activity class that will be called automatically when Activity class will be initialized. This is the initial method of activity. What is a Bundle? It is used to pass data from one activity to another, ...

Radio button and Checkbox widget in Android

 RadioButton:- This widget is used to choose a single option in a group of options. Android provides <RadioGroup> class to manage RadioButton Grouping and SubGrouping. <RadioButton>:  class is used to provide a RadioButton view on Android Activity. Example of RadioButton Code for Activity Design File:- <? xml version ="1.0" encoding ="utf-8" ?> < LinearLayout xmlns: android ="http://schemas.android.com/apk/res/android" xmlns: app ="http://schemas.android.com/apk/res-auto" xmlns: tools ="http://schemas.android.com/tools" android :layout_width ="match_parent" android :layout_height ="match_parent" android :orientation ="vertical" android :paddingTop ="120dp" tools :context =".MainActivity9" > < RadioGroup android :layout_width ="wrap_content" android :layout_height ="wrap_content" > ...

Toast in Android? What is Toast?

  Toast in Android? What is Toast? Toast is used to provide an alert dialog in the android application that will be automatically closed according to a given time interval. Toast is the predefined class that contains maketext() to display content. maketext() contain three different parameters. 1)  Address of container:-  we can use this, getApplicationContext, getContext, Activity Instance, Widget instance. 2) Message:-   It is used to display content in String Format 3)  Duration:-  we can pass time interval in milliseconds or Time Constant Length_Long (3 sec) and Length_Short(1 sec) 4) show():-  It is used to display alert box or toast into the application. Example of Toast 1)  Design File:- <? xml version ="1.0" encoding ="utf-8" ?> < LinearLayout xmlns: android ="http://schemas.android.com/apk/res/android" xmlns: app ="http://schemas.android.com/apk/res-auto" xmlns: tools ="http://schemas.android.com/tools" andr...

Intent in Android

 The intent in Android:- The intent is created by Intention whose meaning is to navigate from one activity to another. In the android application, we will use the Intent class to manage Intent Activity. Type of Intent:- 1)  Implicit Intent:-   this type of Intent is used to call predefine activity of Android that is already in-built on the Android operating system. For example when we dial a call then dialer screen is an example of Implicit Intent. When we surf any URL into the Android browser then it will automatically open the browser view which is an example of Implicit Intent. Intent  I  = new Intent(PredefineActivity) call to predefine activity dialog startActivity(I) Example of Implicit Intent:- JAVA FILE:- package com.example.additionapplication; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.Button; import java.net.URI; publi...

Layout in Android?

  Layout in Android? It is used to display screen structure( layout) in Android Application, Layout can be Linear, Relative, Grid, Table, Absolute, Frame, and Constraint Layout in Android. We can create Layout initially in the android application because Layout provides Parent and Child Container in the Android application. The default orientation of the Linear Layout is Horizontal. 1) Linear Layout:- It is used to display elements using Linear sequence and its orientation can be verticle and horizontal. Linear Layout is the simplest layout in android applications. We can easily place a Linear Layout as a Parent Layout and Child Layout. 1) <LinearLayout android:orientation="verticle" > </LinearLayout> 2)   Linear Layout using Nested Sequence. <LinearLayout android:orientation="verticle" > <LinearLayout android:orientation="verticle" > </LinearLayout> <LinearLayout android:orientation="verticle" > </LinearLay...