You are on page 1of 19

Discuss different types of user interface view

Ans:
What are the purpose of geocoding?
What are the two types of intent?

What are the different data storage options available on the Android platform
Explain content provider in android
// Querying contacts Content Provider
Uri uri = ContactsContract.Contacts.CONTENT_URI;
String[] projection = {ContactsContract.Contacts._ID,
ContactsContract.Contacts.DISPLAY_NAME};

Cursor cursor = getContentResolver().query(uri, projection, null, null,


null);

if (cursor != null) {
while (cursor.moveToNext()) {
String contactId =
cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID
));
String displayName =
cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DIS
PLAY_NAME));

// Process contact data


}
cursor.close();
}
Q: What are the features of SQLite?
Explain how to send email in android application

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;

public class EmailActivity extends AppCompatActivity {


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_email);

findViewById(R.id.sendEmailButton).setOnClickListener(new
View.OnClickListener() {
@Override
public void onClick(View view) {
sendEmail();
}
});
}

private void sendEmail() {


Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("text/plain");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]
{"recipient@example.com"});
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject of
the Email");
emailIntent.putExtra(Intent.EXTRA_TEXT, "Body of the
Email");

// Optional: Specify the package name of the email client


(e.g., Gmail)
// emailIntent.setPackage("com.google.android.gm");

startActivity(Intent.createChooser(emailIntent, "Choose an
Email client:"));
}
}

Replace "recipient@example.com", "Subject of the Email", and "Body of the


Email" with the actual recipient email address, subject, and body content. The sendEmail
method is called when the associated button is clicked.
Explain location based services
explain types of intent in android
what are the different types of android devices in
market

You might also like