Android Programs Lab Manual
Android Programs Lab Manual
Steps:
1. Click New Project, the New Project Dialog box appears.
2. Choose Empty Views Activity then click Next.
3. Specify the Name of your project, Select the Language as Java, and Select the SDK as API
24(“Nougat”,Android 7.0).Click Finish Button.
4. Update the following code in activity_main.xml and [Link]
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:textSize="40sp"
android:textStyle="bold|italic"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</[Link]>
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
[Link](this);
setContentView([Link].activity_main);
}
}
=>Output of the program
Step 1: Click New Project, the New Project Dialog box appears.
2. Choose Empty Views Activity then click Next.
3. Specify the Name of your project, Select the Language as Java, and Select the SDK as API
24(“Nougat”,Android 7.0).Click Finish Button.
4. Update the following code in activity_main.xml and [Link]
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This is Portrait"
android:textSize="40sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.496"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.25" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onClick"
android:text="Launch new activity"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.499" />
</[Link]>
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
[Link](this);
setContentView([Link].activity_main);
}
Step 2: Create another new empty views activity and give the name as Nextactivity (Go to app>>
New>>Activity>>Empty Views Activity)
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This is Landscape Orientation"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</[Link]>
Step 3: Add the screen orientation values in [Link]
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/[Link]"
tools:targetApi="31">
<activity
android:name=".Nextactivity"
android:exported="false"
android:screenOrientation="landscape"
/>
<activity
android:name=".MainActivity"
android:exported="true"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="[Link]" />
Step 1: Click New Project, the New Project Dialog box appears.
2. Choose Empty Views Activity then click Next.
3. Specify the Name of your project, Select the Language as Java, and Select the SDK as API
24(“Nougat”,Android 7.0).Click Finish Button.
4. Update the following code in activity_main.xml and [Link]
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="200dp"
android:text="Login Form"
android:textSize="40sp" />
<TextView
android:id="@+id/tvUserName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="User Name"
android:textSize="24sp" />
<EditText
android:id="@+id/etUserName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter the User Name"
android:inputType="text"
android:textSize="24sp" />
<TextView
android:id="@+id/tvPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Password"
android:textSize="24sp" />
<EditText
android:id="@+id/etPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter the Password"
android:inputType="textPassword"
android:textSize="24sp" />
<Button
android:id="@+id/btnLogin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Login"
android:layout_gravity="center" />
</LinearLayout>
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
[Link](this);
setContentView([Link].activity_main);
}
}
=>Output of the program
4. Create and Application to implement new activity using explicit intent and implicit intent
Step 1: Click New Project, the New Project Dialog box appears.
2. Choose Empty Views Activity then click Next.
3. Specify the Name of your project, Select the Language as Java, and Select the SDK as API
24(“Nougat”,Android 7.0).Click Finish Button.
4. Update the following code in activity_main.xml and [Link]
=>Coding part of Activity_main.xml
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Explicit Activity"
android:textSize="30sp"
android:layout_gravity="center"
android:layout_marginTop="200dp"
/>
<Button
android:id="@+id/btnExplicitContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="200dp"
android:onClick="onClick"
android:text="Explicit Activity" />
</LinearLayout>
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
[Link](this);
setContentView([Link].activity_main);
[Link](findViewById([Link]), (v, insets) -> {
Insets systemBars = [Link]([Link]());
[Link]([Link], [Link], [Link], [Link]);
return insets;
});
}
public void onClick(View view) {
Intent intent = new Intent([Link], [Link]);
startActivity(intent);
}
Step 2: Create another new empty views activity and give the name as Nextactivity (Go to app>>
New>>Activity>>Empty Views Activity)
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Implicit Activity"
android:textSize="30sp"
android:layout_gravity="center"
android:layout_marginTop="200dp"
/>
<Button
android:id="@+id/btnImplicitContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="200dp"
android:onClick="onClick"
android:text="Implicit Activity" />
</LinearLayout>
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
[Link](this);
setContentView([Link].activity_next);
[Link](findViewById([Link]), (v, insets) -> {
Insets systemBars = [Link]([Link]());
[Link]([Link], [Link], [Link], [Link]);
return insets;
});
a. To create resource file, click app>> res >> drawable >> new >>Drawable Resource File
b. Set filename as bg_inner.xml, root element as shape and then click ok.
a. Copy the image file (Ctrl +C) from the file location
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
}
}
Step 4. Create one more empty views activity and give the name as NextActivity(Go to app>>
New>>Activity>>Empty Views Activity) and change the activity_next.xml file and no changes in the
[Link] file
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
[Link](this);
setContentView([Link].activity_next);
[Link](findViewById([Link]), (v, insets) -> {
Insets systemBars = [Link]([Link]());
[Link]([Link], [Link], [Link], [Link]);
return insets;
});
}
}
Steps:
1. Click New Project, the New Project Dialog box appears.
2. Choose Empty Views Activity then click Next.
3. Specify the Name of your project, Select the Language as Java, and Select the SDK as API
24(“Nougat”,Android 7.0).Click Finish Button.
4. Update the following code in activity_main.xml and [Link]
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This is a TextView"
android:textSize="18sp"
android:layout_marginBottom="16dp"/>
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter your text here"
android:layout_marginBottom="16dp" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click Me"
android:layout_marginBottom="16dp" />
<CheckBox
android:id="@+id/checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Check Me"
android:layout_marginBottom="16dp" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Which Section You belong to"
android:textSize="20sp"
android:layout_marginBottom="16dp"/>
<RadioGroup
android:id="@+id/radioGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginBottom="16dp" />
<RadioButton
android:id="@+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="A section" />
<RadioButton
android:id="@+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="B Section" />
<Switch
android:id="@+id/switch1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Switch Testing"
android:layout_marginBottom="16dp"/>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select your favourite Programming Language"
android:textSize="20sp"
android:layout_marginBottom="16dp"/>
<Spinner
android:id="@+id/spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"/>
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Progress Bar"
android:textSize="20sp"
android:layout_marginBottom="16dp"/>
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/[Link]"
android:progress="25"
android:layout_marginBottom="16dp" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select the number between 1 to 50"
android:textSize="20sp"
android:layout_marginBottom="16dp"/>
<NumberPicker
android:id="@+id/numberPicker1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"/>
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select your date of birth"
android:textSize="20sp"
android:layout_marginBottom="16dp"/>
<DatePicker
android:id="@+id/datePicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"/>
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Set the next class hour time"
android:textSize="20sp"
android:layout_marginBottom="16dp"/>
<TimePicker
android:id="@+id/timePicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"/>
</LinearLayout>
</ScrollView>
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
[Link](this);
setContentView([Link].activity_main);
[Link](findViewById([Link]), (v, insets) -> {
Insets systemBars = [Link]([Link]());
[Link]([Link], [Link], [Link], [Link]);
return insets;
});
Spinner spinner = findViewById([Link]);
ArrayList<String> arrayList = new ArrayList<>();
[Link]("Select Language");
[Link]("JAVA");
[Link]("ANDROID");
[Link]("C Language");
[Link]("CPP Language");
[Link]("Python Programming");
}
}
=> Output of the program
Steps:
1. Click New Project, the New Project Dialog box appears.
2. Choose Empty Views Activity then click Next.
3. Specify the Name of your project, Select the Language as Java, and Select the SDK as API
24(“Nougat”,Android 7.0).Click Finish Button.
Step1. Create Android resource directory by clicking res>>new>>Android Resource directory, give
the name as menu
Step2. Right click menu folder click new>> Menu Resource File, give the name of the file as menus.
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
[Link](this);
setContentView([Link].activity_main);
}
@Override
public boolean onCreatePanelMenu(int featureId,Menu menu)
{
MenuInflater inflater=getMenuInflater();
[Link]([Link],menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
if([Link]()==[Link]) {
[Link](this, "Php Page", Toast.LENGTH_SHORT).show();
}
if([Link]()==[Link]) {
[Link](this, "Java Page", Toast.LENGTH_SHORT).show();
}
if([Link]()==[Link]) {
[Link](this, "C# Page", Toast.LENGTH_SHORT).show();
}
return true;
}
}
Step 5. Change the theme value [Link] file
<category android:name="[Link]"/>
</intent-filter>
</activity>
</application>
</manifest>
Steps:
1. Click New Project, the New Project Dialog box appears.
2. Choose Empty Views Activity then click Next.
3. Specify the Name of your project, Select the Language as Java, and Select the SDK as API
24(“Nougat”,Android 7.0).Click Finish Button.
4. Update the following code in activity_main.xml and [Link]
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="200dp"
android:text="Login Form"
android:textSize="40sp" />
<TextView
android:id="@+id/tvUserName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="User Name"
android:textSize="24sp" />
<EditText
android:id="@+id/etUserName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter the User Name"
android:inputType="text"
android:textSize="24sp" />
<TextView
android:id="@+id/tvPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Password"
android:textSize="24sp" />
<EditText
android:id="@+id/etPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter the Password"
android:inputType="textPassword"
android:textSize="24sp" />
<Button
android:id="@+id/btnSave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:onClick="onSaveClick"
android:text="Save" />
<Button
android:id="@+id/btnNext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:onClick="onNextClick"
android:text="Next" />
</LinearLayout>
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
[Link](this);
setContentView([Link].activity_main);
etUserName = findViewById([Link]);
etPassword = findViewById([Link]);
}
Next Step. Create one more empty views activity and give the name as NextActivity (Go to app>>
New>>Activity>>Empty Views Activity)
Coding part of activity_next.xml
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="200dp"
android:text="Your Details"
android:textSize="40sp" />
<TextView
android:id="@+id/tvUserName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="User Name"
android:textSize="24sp" />
<EditText
android:id="@+id/etUserName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter the User Name"
android:inputType="text"
android:textSize="24sp" />
<TextView
android:id="@+id/tvPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Password"
android:textSize="24sp" />
<EditText
android:id="@+id/etPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter the Password"
android:inputType="text"
android:textSize="24sp" />
</LinearLayout>
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
etUserName = findViewById([Link]);
etPassword = findViewById([Link]);
}
}
Steps:
1. Click New Project, the New Project Dialog box appears.
2. Choose Empty Views Activity then click Next.
3. Specify the Name of your project, Select the Language as Java, and Select the SDK as API
24(“Nougat”,Android 7.0).Click Finish Button.
4. Update the following code in activity_main.xml and [Link]
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="20dp"
android:layout_y="110dp"
android:text="Enter Rollno:"
android:textSize="20sp" />
<EditText
android:id="@+id/Rollno"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_x="175dp"
android:layout_y="100dp"
android:inputType="number"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="20dp"
android:layout_y="160dp"
android:text="Enter Name:"
android:textSize="20sp" />
<EditText
android:id="@+id/Name"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_x="175dp"
android:layout_y="150dp"
android:inputType="text"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_x="20dp"
android:layout_y="210dp"
android:text="Enter Marks:"
android:textSize="20sp" />
<EditText
android:id="@+id/Marks"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_x="175dp"
android:layout_y="200dp"
android:inputType="number"
android:textSize="20sp" />
<Button
android:id="@+id/Insert"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_x="25dp"
android:layout_y="300dp"
android:onClick="onClickInsert"
android:text="Insert"
android:textSize="30dp" />
<Button
android:id="@+id/Delete"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_x="200dp"
android:layout_y="300dp"
android:onClick="onClickDelete"
android:text="Delete"
android:textSize="30dp" />
<Button
android:id="@+id/Update"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_x="25dp"
android:layout_y="400dp"
android:onClick="onClickUpdate"
android:text="Update"
android:textSize="30dp" />
<Button
android:id="@+id/View"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_x="200dp"
android:layout_y="400dp"
android:onClick="onClickView"
android:text="View"
android:textSize="30dp" />
<Button
android:id="@+id/ViewAll"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_x="100dp"
android:layout_y="500dp"
android:onClick="onClickViewAll"
android:text="View All"
android:textSize="30dp" />
</AbsoluteLayout>
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity {
EditText Rollno,Name,Marks;
SQLiteDatabase db;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
[Link](this);
setContentView([Link].activity_main);
Rollno=findViewById([Link]);
Name=findViewById([Link]);
Marks=findViewById([Link]);
}
public void onClickInsert(View view) {
if ([Link]().toString().trim().length() == 0 ||
[Link]().toString().trim().length() == 0 ||
[Link]().toString().trim().length() == 0) {
showMessage("Error", "Please enter all values");
return;
}
[Link]("INSERT INTO student VALUES('" + [Link]() + "','" + [Link]() +
"','" + [Link]() + "');");
if([Link]().toString().trim().length()==0)
{
showMessage("Error", "Please enter Rollno");
return;
}
Cursor c=[Link]("SELECT * FROM student WHERE rollno='"+[Link]()+"'",
null);
if([Link]())
{
[Link]("DELETE FROM student WHERE rollno='"+[Link]()+"'");
showMessage("Success", "Record Deleted");
}
else
{
showMessage("Error", "Invalid Rollno");
}
clearText();
}
if([Link]().toString().trim().length()==0)
{
showMessage("Error", "Please enter Rollno");
return;
}
Cursor c=[Link]("SELECT * FROM student WHERE rollno='"+[Link]()+"'",
null);
if([Link]()) {
[Link]("UPDATE student SET name='" + [Link]() + "',marks='" +
[Link]() +
"' WHERE rollno='"+[Link]()+"'");
showMessage("Success", "Record Modified");
}
else {
showMessage("Error", "Invalid Rollno");
}
clearText();
}
if([Link]().toString().trim().length()==0)
{
showMessage("Error", "Please enter Rollno");
return;
}
Cursor c=[Link]("SELECT * FROM student WHERE rollno='"+[Link]()+"'",
null);
if([Link]())
{
[Link]([Link](1));
[Link]([Link](2));
}
else
{
showMessage("Error", "Invalid Rollno");
clearText();
}
}
Steps:
1. Click New Project, the New Project Dialog box appears.
2. Choose Empty Views Activity then click Next.
3. Specify the Name of your project, Select the Language as Java, and Select the SDK as API
24(“Nougat”,Android 7.0).Click Finish Button.
4. Update the following code in activity_main.xml and [Link]
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Phone Number:"
android:width="165sp"
android:textSize="18sp" />
<EditText
android:id="@+id/etPhoneNumber"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:hint="Enter number"
android:inputType="phone" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Message to be Sent:"
android:width="165sp"
android:textSize="18sp" />
<EditText
android:id="@+id/etMessage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="Enter message"
android:inputType="textMultiLine" />
</LinearLayout>
<Button
android:id="@+id/btnSendSMS"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="32dp"
android:onClick="onClick"
android:text="SEND SMS" />
</LinearLayout>
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
if (!checkSMSPermission()) {
requestSMSPermission();
}
}
private boolean checkSMSPermission() {
return [Link](this,
[Link].SEND_SMS) == PackageManager.PERMISSION_GRANTED;
}
Steps:
1. Click New Project, the New Project Dialog box appears.
2. Choose Empty Views Activity then click Next.
3. Specify the Name of your project, Select the Language as Java, and Select the SDK as API
24(“Nougat”,Android 7.0).Click Finish Button.
4. Update the following code in activity_main.xml and [Link]
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity {
EditText etTo, etSubject, etMessage;
@Override
protected void onCreate(Bundle savedInstanceState)
{
[Link](savedInstanceState);
setContentView([Link].activity_main);
etTo = findViewById([Link]);
etSubject = findViewById([Link]);
etMessage = findViewById([Link]);
}
Steps:
1. Click New Project, the New Project Dialog box appears.
2. Choose Empty Views Activity then click Next.
3. Specify the Name of your project, Select the Language as Java, and Select the SDK as API
24(“Nougat”,Android 7.0).Click Finish Button.
4. Update the following code in activity_main.xml and [Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity implements OnMapReadyCallback {
private GoogleMap mMap;
private double latitude = 0.0;
private double longitude = 0.0;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment)
getSupportFragmentManager()
.findFragmentById([Link]);
if (mapFragment != null) {
[Link](this);
} else {
[Link](this, "Map Fragment Not Found", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onMapReady(@NonNull GoogleMap googleMap) {
mMap = googleMap;
// Add a marker at current or given location and move the camera
LatLng location = new LatLng(latitude, longitude);
[Link](new MarkerOptions().position(location).title("Marker"));
[Link]([Link](location, 15));
}
}
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/[Link]"
tools:targetApi="31">
<metadata
android:name="[Link].API_KEY"
android:value="YOUR_API_KEY_HERE" />
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="[Link]" />
</manifest>
13. Create an Application with Login module. Check User name and password. On successful login
change textview “Login Successful”. On Login fail alert using Toast “Login Fail”
Steps:
1. Click New Project, the New Project Dialog box appears.
2. Choose Empty Views Activity then click Next.
3. Specify the Name of your project, Select the Language as Java, and Select the SDK as API
24(“Nougat”,Android 7.0).Click Finish Button.
4. Update the following code in activity_main.xml and [Link]
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="200dp"
android:text="Login Form"
android:textSize="40sp" />
<TextView
android:id="@+id/tvUserName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="User Name"
android:textSize="24sp" />
<EditText
android:id="@+id/etUserName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter the User Name"
android:inputType="text"
android:textSize="24sp" />
<TextView
android:id="@+id/tvPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Password"
android:textSize="24sp" />
<EditText
android:id="@+id/etPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter the Password"
android:inputType="textPassword"
android:textSize="24sp" />
<Button
android:id="@+id/btnLogin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:onClick="onClick"
android:text="Login" />
<TextView
android:id="@+id/tvMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Welcome!!!"
android:textColor="#E91E63"
android:textSize="20sp" />
</LinearLayout>
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
EditText etUserName,etPassword;
TextView tvMessage;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
[Link](this);
setContentView([Link].activity_main);
etUserName=(EditText)findViewById([Link]);
etPassword=(EditText)findViewById([Link]);
tvMessage=(TextView)findViewById([Link]);
}
[Link]("Welcome!!!");
if([Link]().toString().isEmpty())
{
[Link](this,"User name is empty", Toast.LENGTH_LONG).show();
return;
}
if([Link]().toString().isEmpty())
{
[Link](this,"Password is empty", Toast.LENGTH_LONG).show();
return;
}
if([Link]().toString().equals("Admin") &&
[Link]().toString().equals("Admin"))
{
[Link]("Login successful!!!");
}
else
{
[Link](this, "Login Fail", Toast.LENGTH_LONG).show();
}
}
}
b. Follow the prompts to create a new keystore or use an existing one. A keystore is a binary file
that contains a set of private keys.
c. Configure the build type (release) and signing configuration.
e. Create a new app entry if this is your first release or select an existing app.
f. Complete all the required information for the app listing, including the title, description,
screenshots, and categorization
g. Upload your signed APK file.
Besides Google Play, you can distribute your app through other channels such as Amazon
Appstore, Samsung Galaxy Store, or third party app marketplaces.
Each distribution channel may have its own requirements and submission process, so be sure
to follow their guidelines.
Keep an eye on user feedback and app performance metrics through the Google Play Console.
Regularly update your app to fix bugs, add new features, and improve user experience based on
feedback.