Android imp
Android imp
Basically Intent is a simple message object that is used to communicate between android
components such as activities, content providers, broadcast receivers, and services, here use
to send the email. This application basically contains one activity with EditText to take input of
email address, subject, and body of the email from the user and button to send that email.
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/editText3"
android:layout_alignBottom="@+id/editText3"
android:text="Email Body:"
android:textColor="#0F9D58" />
In MainActivity Intent object is created and its action is defined to ACTION_SEND to send an
email, with Intent three extra fields are also added using the putExtra function. These fields
are: Email of receiver
● Subject of email
● Body of email
2. Develope a program for providing Bluetooth connectivity.
Ans-
Android provides Bluetooth API to perform these different operations.
In order to enable the Bluetooth of your device, call the intent with the following
Bluetooth constant ACTION_REQUEST_ENABLE. Its syntax is.
Once you enable the Bluetooth , you can get a list of paired devices by calling
getBondedDevices() method. It returns a set of bluetooth devices. Its syntax is.
private Set<BluetoothDevice>pairedDevices;
pairedDevices = BA.getBondedDevices();
3. program on Google Map location
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp" >
...
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"/>
...
</manifest>
However, if precise location is needed, then add both ACCESS_COARSE_LOCATION
and ACCESS_FINE_LOCATION permissions to your app's manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp" >
...
<uses-permissionandroid:name="android.permission.ACCESS_COARSE_LOCATION"/
>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
...
</manifest>