0% found this document useful (0 votes)
4 views2 pages

PR 27

The document contains XML and Java code for an Android application that allows users to send emails. It includes layout definitions for input fields for the email address, subject, and message, as well as the necessary Java code to handle the email sending functionality. Additionally, it specifies permissions and features required in the Android manifest file.

Uploaded by

tanujapawar940
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

PR 27

The document contains XML and Java code for an Android application that allows users to send emails. It includes layout definitions for input fields for the email address, subject, and message, as well as the necessary Java code to handle the email sending functionality. Additionally, it specifies permissions and features required in the Android manifest file.

Uploaded by

tanujapawar940
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Pr:27 android:layout_width="match_parent"

Q.1  android:layout_height="wrap_content"

XML android:text="Send Email"/>

<?xml version="1.0" encoding="utf-8"?> </LinearLayout>

<LinearLayout JAVA
xmlns:android="[Link]
droid" package [Link].myapplication12;

android:layout_width="match_parent" import [Link];

android:layout_height="match_parent" import [Link];

android:orientation="vertical" import [Link];

android:padding="20dp"> import [Link];

<EditText import [Link];

android:id="@+id/etTo" import [Link];

android:layout_width="match_parent" import [Link];

android:layout_height="wrap_content" public class MainActivity extends AppCompatActivity {

android:hint="Enter Email Address"/> EditText etTo, etSubject, etMessage;

<EditText Button btnSend;

android:id="@+id/etSubject" @Override

android:layout_width="match_parent" protected void onCreate(Bundle savedInstanceState) {

android:layout_height="wrap_content" [Link](savedInstanceState);

android:hint="Enter Subject"/> setContentView([Link].activity_main);

<EditText etTo = findViewById([Link]);

android:id="@+id/etMessage" etSubject = findViewById([Link]);

android:layout_width="match_parent" etMessage = findViewById([Link]);

android:layout_height="wrap_content" btnSend = findViewById([Link]);

android:hint="Enter Message" [Link](new


[Link]() {
android:lines="4"/>
@Override
<Button
public void onClick(View v) {
android:id="@+id/btnSend"
String to = [Link]().toString(); android:icon="@mipmap/ic_launcher"

String subject = [Link]().toString(); android:supportsRtl="true"

String message = [Link]().toString();


android:theme="@style/[Link]
Intent emailIntent = new ctionBar">>
Intent(Intent.ACTION_SEND);
<activity
[Link]([Link]("[Link]
android:name=".MainActivity"
[Link]("text/plain");
android:exported="true">
[Link](Intent.EXTRA_EMAIL, new
String[]{to});

[Link](Intent.EXTRA_SUBJECT, <intent-filter>
subject);
<action
[Link](Intent.EXTRA_TEXT, android:name="[Link]"/>
message);
<category
startActivity([Link](emailIntent, android:name="[Link]"/>
"Send Email"));
</intent-filter>
} }); } }
</activity>
MANIFEST
</application>
<manifest
xmlns:android="[Link] </manifest>
droid"

package="[Link].myapplication12">

<uses-permission
android:name="[Link]"/>

<uses-permission
android:name="[Link].ACCESS_FINE_LOCAT
ION"/>

<uses-permission
android:name="[Link].ACCESS_COARSE_LO
CATION"/>

<uses-feature
android:name="[Link]"
android:required="false"/>

<application

android:allowBackup="true"

You might also like