Professional Documents
Culture Documents
PendingIntent lets us pass a future Intent to another application and allow that application to
execute that Intent as if it had the same permissions as our application, whether or not our
application is still around when the Intent is eventually invoked.
To perform network operations in your application, your manifest must include the
following permissions:
Android includes support for high performance 2D and 3D graphics with the Open Graphics
Library (OpenGL®), specifically, the OpenGL ES API. OpenGL is a cross-platform
graphics API that specifies a standard software interface for 3D graphics processing
hardware.
In android UI or input controls are the interactive or View components that are used to
design the user interface of an application. In android we have a wide variety of UI or
input controls available, those are TextView, EditText, Buttons, Checkbox, Progressbar,
Spinners, etc.
A well-designed custom view is much like any other well-designed class. It encapsulates a
specific set of functionality with an easy to use interface, it uses CPU and memory
efficiently, and so on. In addition to being a well-designed class, though, a custom view
should: Conform to Android standards
Android RatingBar can be used to get the rating from the user. The Rating returns a
floating-point number. It may be 2.0, 3.5, 4.0 etc.
Android RatingBar displays the rating in stars. Android RatingBar is the subclass of
AbsSeekBar class.
The getRating() method of android RatingBar class returns the rating number.
14. Explain the local and remote binding concepts of Services. 04
Local service means it runs in the same process probably in the same application. You
can start a service using the method startService() and you can stop the service by using
the method stopService(). These two life cycle methods or Service And remote service are
generally run in a different application. you can access them by writing AIDL Interfaces
and you can attach to a remote service by using binder.
Remote Service
This type of services normally design and implement software functionality to be used by
other apps. Android system services (wifi/gps/usb/etc.)are the main examples in this
category. If you need provide functionality to be used by other apps, you need to
develop a remote service which implements remote binding, intent (through
startCommand) or other IPC mechanism.
Notifications provide short, timely information about events in your app while it's not
in use. This page teaches you how to create a notification with various features for
Android 4.0 (API level 14) and higher. For an introduction to how notifications appear
on Android, see the Notifications Overview. For sample code that uses notifications,
see the Android Notifications Sample.
Notice that the code on this page uses the NotificationCompat APIs from the Android
support library. These APIs allow you to add features available only on newer
versions of Android while still providing compatibility back to Android 4.0 (API level
14). However, some new features such as the inline reply action result in a no-op on
older versions.
Content" can come from anywhere in your device. The system as well as every app can
provide content.
Those Uris act similar to http urls and help identify the data source that provides the
information (http://phonebook.com). An Uri goes in practice 1 step further and identifies at
least the table inside a database (http://phonebook.com/by_name), sometimes even the exact
item. (e.g. http://phonebook.com/by_name/macdonjo) - or like content://com.android.contacts/123 in
reality.
P.s. the code you've found there looks pretty dated. Both managing cursor as well as
the People convenience class are deprecated for a while now.
18. Write an android program for Phone call.
<RelativeLayout
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"
tools:context=".MainActivity">
<AnalogClock
android:layout_marginTop="20dp"
android:layout_marginLeft="120dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<DigitalClock
android:layout_marginLeft="140dp"
android:textSize="25dp"
android:layout_marginTop="300dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
Output:
22. Illustrate Fragment life cycle states and respective callback methods.
A fragment's lifecycle state can never be greater than its parent. For example, a
parent fragment or activity must be started before its child fragments. Likewise, child
fragments must be stopped before their parent fragment or activity. Figure 1 shows
each of the fragment's Lifecycle states and how they relate to both the fragment's
lifecycle callbacks and the fragment's view Lifecycle.
<menu
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"
tools:context=".MainActivity">
<item
android:id="@+id/message"
android:icon="@android:drawable/ic_menu_send"
app:showAsAction="always"
android:title="message"/>
<item
android:id="@+id/picture"
android:icon="@android:drawable/ic_menu_gallery"
app:showAsAction="always|withText"
android:title="picture"/>
<item
android:id="@+id/mode"
android:icon="@android:drawable/ic_menu_call"
app:showAsAction="always"
android:title="mode"/>
<item
android:id="@+id/about"
android:icon="@android:drawable/ic_dialog_info"
app:showAsAction="never|withText"
android:title="calculator"/>
<item
android:id="@+id/exit"
app:showAsAction="never"
android:title="exit"/>
</menu>