In: Computer Science
Using implicit Intents, you are to write a complete Android application, using menus or BottomNavigationView to
1. Allow the user to send SMS messages to multiple users at the
same time.
2. Allow the user to send E-mail to multiple users including CC and
BCC
3. Allow the user to Locate any specific place on Google Map by
either
specifying a detailed information about a location or by specifying Latitude and longitude coordinates
4. Take a picture.
Impress me lots lots lots with this application.
Your are free to add whatever to need or wish.
Enjoy!
i need code for application
Answer : Given data
package de.cketti.mailto.sample;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.snackbar.Snackbar;
import de.cketti.mailto.EmailIntentBuilder;
public class MainActivity extends AppCompatActivity {
private View mainContent;
private EditText emailTo;
private EditText emailCc;
private EditText emailBcc;
private EditText emailSubject;
private EditText emailBody;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mainContent = findViewById(R.id.main_content);
emailTo = findViewById(R.id.email_to);
emailCc = findViewById(R.id.email_cc);
emailBcc = findViewById(R.id.email_bcc);
emailSubject = findViewById(R.id.email_subject);
emailBody = findViewById(R.id.email_body);
findViewById(R.id.button_send_email).setOnClickListener(v -> sendEmail());
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.menu_feedback) {
sendFeedback();
}
return true;
}
private void sendFeedback() {
boolean success = EmailIntentBuilder.from(this)
.to("[email protected]")
.subject(getString(R.string.feedback_subject))
.body(getString(R.string.feedback_body))
.start();
if (!success) {
Snackbar.make(mainContent, R.string.error_no_email_app, Snackbar.LENGTH_LONG).show();
}
}
void sendEmail() {
String to = emailTo.getText().toString();
String cc = emailCc.getText().toString();
String bcc = emailBcc.getText().toString();
String subject = emailSubject.getText().toString();
String body = emailBody.getText().toString();
EmailIntentBuilder builder = EmailIntentBuilder.from(this);
try {
if (!TextUtils.isEmpty(to)) {
builder.to(to);
}
if (!TextUtils.isEmpty(cc)) {
builder.cc(cc);
}
if (!TextUtils.isEmpty(bcc)) {
builder.bcc(bcc);
}
if (!TextUtils.isEmpty(subject)) {
builder.subject(subject);
}
if (!TextUtils.isEmpty(body)) {
builder.body(body);
}
boolean success = builder.start();
if (!success) {
Snackbar.make(mainContent, R.string.error_no_email_app, Snackbar.LENGTH_LONG).show();
}
} catch (IllegalArgumentException e) {
String errorMessage = getString(R.string.argument_error, e.getMessage());
Snackbar.make(mainContent, errorMessage, Snackbar.LENGTH_LONG).show();
}
}
}
Note: This is just a part of code, I'm not able to send the entire code,I don't know the exact reason why, mayne due to limited number of words, or maybe due to server down.
You can let me know how to send it, I'm having files too which are required for execution of an application.
____________THE END_______________