Android Ui Layouts: Textview Imageview Edittext Radiobutton
Android Ui Layouts: Textview Imageview Edittext Radiobutton
Android Layout is used to define the user interface that holds the UI controls or
widgets that will appear on the screen of an android application or activity screen.
Generally, every application is a combination of View and ViewGroup. As we know,
an android application contains a large number of activities and we can say each
activity is one page of the application. So, each activity contains multiple user
interface components and those components are the instances of the View and
ViewGroup. All the elements in a layout are built using a hierarchy
of View and ViewGroup objects.
View
View
A ViewGroup act as a base class for layouts and layouts parameters that hold other
Views or ViewGroups and to define the layout properties. They are Generally Called
layouts.
ViewGroup
The Android framework will allow us to use UI elements or widgets in two ways:
Use UI elements in the XML file
Create elements in the Kotlin file dynamically
Types of Android Layout
Here, we can create a layout similar to web pages. The XML layout file contains at
least one root element in which additional layout elements or widgets can be added to
build a View hierarchy. Following is the example:
XML
<LinearLayout
xmlns:android="http:// schemas.android.com/apk/res/android"
xmlns:tools="http:// schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:hint="Input"
android:inputType="text"/>
<Button
android:id="@+id/showInput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="show"
android:backgroundTint="@color/colorPrimary"
android:textColor="@android:color/white"/>
</LinearLayout>
When we have created the layout, we need to load the XML layout resource from our
activity onCreate() callback method and access the UI element from the XML
using findViewById.
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
Kotlin
import android.os.Bundle
import android.widget.Button
import android.widget.EditText
import android.widget.LinearLayout
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
showButton.setText("Submit")
linearLayout.addView(showButton)
showButton.setOnClickListener
{
}
}
android:layout_marginBotto Used to declare the extra space used in the bottom side
m of View and ViewGroup elements.
VoiceXML
VoiceXML (VXML) is a digital document standard for specifying interactive media and voice
dialogs between humans and computers. It is used for developing audio and voice response
applications, such as banking systems and automated customer service portals. VoiceXML
applications are developed and deployed in a manner analogous to how a web
browser interprets and visually renders the Hypertext Markup Language (HTML) it receives from
a web server. VoiceXML documents are interpreted by a voice browser and in common
deployment architectures, users interact with voice browsers via the public switched telephone
network (PSTN).
The VoiceXML document format is based on Extensible Markup Language (XML). It is a
standard developed by the World Wide Web Consortium (W3C).
VoiceXML applications are commonly used in many industries and segments of commerce.
These applications include order inquiry, package tracking, driving directions, emergency
notification, wake-up, flight tracking, voice access to email, customer relationship management,
prescription refilling, audio news magazines, voice dialing, real-estate information and
national directory assistance applications.[citation needed]
VoiceXML has tags that instruct the voice browser to provide speech synthesis,
automatic speech recognition, dialog management, and audio playback. The following is an
example of a VoiceXML document:
History[edit]
AT&T Corporation, IBM, Lucent, and Motorola formed the VoiceXML Forum in March 1999, in
order to develop a standard markup language for specifying voice dialogs. By September 1999
the Forum released VoiceXML 0.9 for member comment, and in March 2000 they published
VoiceXML 1.0. Soon afterwards, the Forum turned over the control of the standard to the W3C.
[1]
The W3C produced several intermediate versions of VoiceXML 2.0, which reached the final
"Recommendation" stage in March 2004. [2]
VoiceXML 2.1 added a relatively small set of additional features to VoiceXML 2.0, based on
feedback from implementations of the 2.0 standard. It is backward compatible with VoiceXML 2.0
and reached W3C Recommendation status in June 2007. [3]
Related standards[edit]
The W3C's Speech Interface Framework also defines these other standards closely associated
with VoiceXML.
SSML[edit]
The Speech Synthesis Markup Language (SSML) is used to decorate textual prompts with
information on how best to render them in synthetic speech, for example which speech
synthesizer voice to use or when to speak louder or softer.
PLS[edit]
The Pronunciation Lexicon Specification (PLS) is used to define how words are pronounced. The
generated pronunciation information is meant to be used by both speech recognizers and
speech synthesizers in voice browsing applications.
CCXML[edit]
The Call Control eXtensible Markup Language (CCXML) is a complementary W3C standard. A
CCXML interpreter is used on some VoiceXML platforms to handle the initial call setup between
the caller and the voice browser, and to provide telephony services like call transfer and
disconnect to the voice browser. CCXML can also be used in non-VoiceXML contexts.