Android Application Development
Android Application Development
Newfeature(b).mymessage()
Newfeature(b).mymessageline()
}
To perform a call to
android.intent.action.CALL someone specified by
the data
println(this.toString())
}
}
2. Extension Function:
Think of an extension function like a superpower
you give to a type (like a superhero gaining a new
ability). When you define an extension function,
you’re saying, “Hey, I want to give this extra ability
to this type of object”. So, when you use that
ability (call the function), the ‘this’ keyword inside
the function refers to the object you’re using it on.
fun String.addGreeting() : String {
return “Hello, $this!”
}
val greeting = “World”.addGreeting()
println(greeting)
Themes:
A theme is nothing but an Android style applied to an
entire Activity or application, rather than an
individual View.
Thus, when a style is applied as a theme, every View
in the Activity or application will apply each style
property that it supports. For example, you can apply
the same CustomFontStyle style as a theme for an
Activity and then all text inside that Activity will
have green monospace font.
To set a theme for all the activities of your
application, open the AndroidManifest.xml file and
edit the <application> tag to include the
android:theme attribute with the style name. For
example –
<application android:theme="@style/CustomFontStyle">
3. It takes more time for creation. It takes less time for creation.
The process has its own Process Thread has Parents’ PCB, its own
Control Block, Stack, and Address Thread Control Block, and Stack and
11. Space. common Address space.
Example:
Refer ‘kotlin 2’ ppt pg no. 218 to 223
setOnZoomOutClickListener(OnClickListenerlist
ener): This method is invoked when Zoom Out is
pressed. It too works in the same manner as the
setOnZoomInClickListener() method works, but
it minimizes ie converges the UI.
zoomControls.setOnZoomOutClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// add the code which will be executed when
// the zoom out button has been pressed
}
});
setIsZoomInEnabled(boolean isEnabled): It is
one of the methods of Zoom Controls which is
used to enable or disable the zoom-in
functionality.
// it will enable the zoomIn button
zoomControls.setIsZoomInEnabled(true)
// it will disable the zoomIn button
zoomControls.setIsZoomInEnabled(false)
setIsZoomOutEnabled(boolean isEnabled): It is
also one of the methods of Zoom Controls, which
is used to enable or disable the zoom out
functionality.
// it will enable the zoomOut button
zoomControls.setIsZoomOutEnabled(true)
// it will disable the zoomOut button
zoomControls.setIsZoomOutEnabled(false)
setZoomSpeed(long speed): This is used to set
the zoom speed of the zoom that is being done
with zoom controls.
Important Attributes of Zoom Controls:
id: This attribute is used to give the zoom
controls a unique identity.
<ZoomControls android:id=”@+id/zoom_controls/>
background: This is used to give the background
color to the zoom controls.
<ZoomControls
android:id=”@+id/zoom_controls
android:background=”#fffff”/>
padding: This is used to give padding on the sides
of zoom controls.
<ZoomControls
android:id=”@+id/zoom_controls
android:padding=”20dp”/>
Methods Description
Q44. AutoCompleteTextView.
Ans: