ITA0352 - Mobile Computing Lab Record Book Final
ITA0352 - Mobile Computing Lab Record Book Final
Name:___________________________
Register No:______________________
Department:_____________________
TABLE OF CONTENTS
Aim:
To develop a Simple Android Application that uses GUI components, Font and Colors
Procedure:
1. Start the process.
3. Create a new project by : File ->New -> Project -> Android ( Wizard ) - > Android
Application Project .
4. In New Android Application dialog to enter the required values for creating the new
android application such as Application Name, Package name and Project Name.
6. In Under create activity wizard Add an activity to <template>, select Blank Activity and
click Next.
7. Change the Activity Name to Mainactivity then Click the Finish button to create the
project.
simpledraw/res/layout/activity_mainactivity.xml
This is the XML layout file for the activity you added when you created the project
with Android Studio.
simpledraw/src/com.exmaple.simpledraw/ Mainactivity.java
When you select the file you see the class definition for the activity you created.
simpledraw/AndroidManifest.xml
To run your app on the emulator you need to first create an Android Virtual Device (AVD).
An AVD is a device configuration for the Android emulator that allows you to model a
specific device.
Graphical Layout
import android.app.Activity;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
Button b1,b2,b3;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViewById(R.id.textView1);
b1 = (Button) findViewById(R.id.button1);
b1.setOnClickListener(new View.OnClickListener(){
t1.setText("WELCOME TO ANDROID");
t1.setTextSize(font);
font=font+5;
if (font == 50)
font = 20;
});
b2 = (Button) findViewById(R.id.button2);
b2.setOnClickListener(new View.OnClickListener() {
t1.setText("WELCOME TO ANDROID");
switch(count){
case 1:
t1.setTextColor(Color.parseColor("#7f00ff"));
break;
case 2:
t1.setTextColor(Color.parseColor("#00FF00"));
break;
case 3:
t1.setTextColor(Color.parseColor("#FF0000"));
break;
case 4:
t1.setTextColor(Color.parseColor("#0000FF"));
break;
count++;
if (count == 5)
count = 1;
});
b3 = (Button) findViewById(R.id.button3);
b3.setOnClickListener(new OnClickListener() {
@Override
t1.setText("WELCOME TO ANDROID");
switch (count){
case 1:
t1.setTypeface(Typeface.DEFAULT,
Typeface.ITALIC);
break;
case 2:
t1.setTypeface(Typeface.MONOSPACE,
Typeface.NORMAL);
break;
case 3:
t1.setTypeface(Typeface.SANS_SERIF,
Typeface.BOLD);
break;
case 4:
t1.setTypeface(Typeface.SERIF,
Typeface.BOLD_ITALIC);
break;
count++;
if (count == 5)
count = 1;
});
OUTPUT
RESULT:
Exp: Develop an application that uses Layout Managers
No: 2 and event listeners.
Aim:
To develop a Simple Android Application that uses Layout Managers and Event
Listeners.
Procedure:
1. Start the process.
3. Create a new project by : File ->New -> Project -> Android ( Wizard ) - > Android
Application Project .
4. In New Android Application dialog to enter the required values for creating the new
android application such as Application Name, Package name and Project Name.
6. In Under create activity wizard Add an activity to <template>, select Blank Activity and
click Next.
7. Change the Activity Name to Mainactivity then Click the Finish button to create the
project.
simpledraw/res/layout/activity_mainactivity.xml
This is the XML layout file for the activity you added when you created the project
with Android Studio.
simpledraw/src/com.exmaple.simpledraw/ Mainactivity.java
When you select the file you see the class definition for the activity you created.
simpledraw/AndroidManifest.xml
To run your app on the emulator you need to first create an Android Virtual Device (AVD).
An AVD is a device configuration for the Android emulator that allows you to model a
specific device.
Graphical Layout
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.RatingBar;
import android.widget.RatingBar.OnRatingBarChangeListener;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
EditText et;
Spinner sp;
RadioGroup rg;
ListView lv;
RatingBar rb;
Button b;
String name;
int degree;
String area;
String rating;
String sex;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
et = (EditText) findViewById(R.id.editText1);
sp = (Spinner) findViewById(R.id.spinner1);
rg = (RadioGroup) findViewById(R.id.radioGroup1);
r1 = (RadioButton) findViewById(R.id.radioButton1);
r2 = (RadioButton) findViewById(R.id.radioButton2);
lv = (ListView) findViewById(R.id.listView1);
rb = (RatingBar) findViewById(R.id.ratingBar1);
b = (Button) findViewById(R.id.button1);
// Spinner Item
sp.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
sex = arg0.getItemAtPosition(arg2).toString();
@Override
});
// RadioGroup Item
rg.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
String temp;
degree = arg0.indexOfChild(radioButton);
if (degree == 0)
else
temp = "B.TECH IT";
});
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
});
rb.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
@Override
rating = String.valueOf(arg1);
});
b.setOnClickListener(new View.OnClickListener() {
@Override
name = et.getText().toString();
String str = "Name = " + name + line + "Sex = " + sex + "Degree = " + degree + line +
Toast.LENGTH_LONG).show();
});
}
@Override
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
OUTPUT
RESULT:
Exp: Develop an application that draws basic graphical
No: 3 primitives on the screen
Aim:
To develop a Simple Android Application that draws basic Graphical Primitives on the
screen.
Procedure:
1. Start the process.
3. Create a new project by : File ->New -> Project -> Android ( Wizard ) - > Android
Application Project .
4. In New Android Application dialog to enter the required values for creating the new
android application such as Application Name, Package name and Project Name.
6. In Under create activity wizard Add an activity to <template>, select Blank Activity and
click Next.
7. Change the Activity Name to Mainactivity then Click the Finish button to create the
project.
simpledraw/res/layout/activity_mainactivity.xml
This is the XML layout file for the activity you added when you created the project
with Android Studio.
simpledraw/src/com.exmaple.simpledraw/ Mainactivity.java
When you select the file you see the class definition for the activity you created.
simpledraw/AndroidManifest.xml
To run your app on the emulator you need to first create an Android Virtual Device (AVD).
An AVD is a device configuration for the Android emulator that allows you to model a
specific device.
Graphical Layout
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.widget.ImageView;
{
@Override
@SuppressWarnings("deprecation")
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Creating a Bitmap
i.setBackgroundDrawable(new BitmapDrawable(bg));
//Creating the Paint Object and set its color & TextSize
paint.setColor(Color.BLUE);
paint.setTextSize(50);
OUTPUT
RESULT:
Exp: Develop an application that makes use of databases
No: 4
Aim:
To develop a Simple Android Application that makes use of Database.
Procedure:
1. Start the process.
3. Create a new project by : File ->New -> Project -> Android ( Wizard ) - > Android
Application Project .
4. In New Android Application dialog to enter the required values for creating the new
android application such as Application Name, Package name and Project Name.
6. In Under create activity wizard Add an activity to <template>, select Blank Activity and
click Next.
7. Change the Activity Name to Mainactivity then Click the Finish button to create the
project.
simpledraw/res/layout/activity_mainactivity.xml
This is the XML layout file for the activity you added when you created the project
with Android Studio.
simpledraw/src/com.exmaple.simpledraw/ Mainactivity.java
When you select the file you see the class definition for the activity you created.
simpledraw/AndroidManifest.xml
To run your app on the emulator you need to first create an Android Virtual Device (AVD).
An AVD is a device configuration for the Android emulator that allows you to model a
specific device.
Graphical Layout
import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends Activity implements OnClickListener
EditText Rollno,Name,Marks;
Button Insert,Delete,Update,View,ViewAll;
SQLiteDatabase db;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Rollno=(EditText)findViewById(R.id.editText2);
Name=(EditText)findViewById(R.id.editText1);
Marks=(EditText)findViewById(R.id.editText3);
Insert=(Button)findViewById(R.id.button1);
Delete=(Button)findViewById(R.id.button2);
Update=(Button)findViewById(R.id.button3);
View=(Button)findViewById(R.id.button4);
ViewAll=(Button)findViewById(R.id.button5);
Insert.setOnClickListener(this);
Delete.setOnClickListener(this);
Update.setOnClickListener(this);
View.setOnClickListener(this);
ViewAll.setOnClickListener(this);
VARCHAR);");
if(view==Insert)
if(Rollno.getText().toString().trim().length()==0||
Name.getText().toString().trim().length()==0||
Marks.getText().toString().trim().length()==0)
return;
"','"+Marks.getText()+"');");
showMessage("success","Record added");
clearText();
if(view==Delete)
if(Rollno.getText().toString().trim().length()==0)
{
return;
if(c.moveToFirst())
else
clearText();
if(view==Update)
if(Rollno.getText().toString().trim().length()==0)
return;
else {
clearText();
if(view==View)
if(Rollno.getText().toString().trim().length()==0)
return;
if(c.moveToFirst())
Name.setText(c.getString(1));
Marks.setText(c.getString(2));
else
{
clearText();
if(view==ViewAll)
if(c.getCount()==0)
return;
while(c.moveToNext())
buffer.append("Rollno: "+c.getString(0)+"\n");
buffer.append("Name: "+c.getString(1)+"\n");
buffer.append("Marks: "+c.getString(2)+"\n\n");
builder.setTitle(title);
builder.setMessage(message);
builder.show();
Rollno.setText("");
OUTPUT
RESULT:
Exp: Implement an application that uses Multi-threading
No: 5
Aim:
Procedure:
1. Start the process.
3. Create a new project by : File ->New -> Project -> Android ( Wizard ) - > Android
Application Project .
4. In New Android Application dialog to enter the required values for creating the new
android application such as Application Name, Package name and Project Name.
6. In Under create activity wizard Add an activity to <template>, select Blank Activity and
click Next.
7. Change the Activity Name to Mainactivity then Click the Finish button to create the
project.
simpledraw/res/layout/activity_mainactivity.xml
This is the XML layout file for the activity you added when you created the project
with Android Studio.
simpledraw/src/com.exmaple.simpledraw/ Mainactivity.java
When you select the file you see the class definition for the activity you created.
simpledraw/AndroidManifest.xml
To run your app on the emulator you need to first create an Android Virtual Device (AVD).
An AVD is a device configuration for the Android emulator that allows you to model a
specific device.
Graphical Layout
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
TextView tv;
Button b;
int i;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
pb = (ProgressBar) findViewById(R.id.progressBar1);
tv = (TextView) findViewById(R.id.textView1);
b = (Button) findViewById(R.id.button1);
b.setOnClickListener(new OnClickListener() {
@Override
@Override
try {
Thread.sleep(2000);
} catch (Exception e) {}
pb.post(new Runnable() {
@Override
tv.setText(String.valueOf(value) + "%");
pb.setProgress(value);
if (value == 100)
});
};
new Thread(r).start();
});
@Override
getMenuInflater().inflate(R.menu.main, menu);
return true;
OUTPUT
RESULT:
Exp: Develop a Native Calculator Application
No: 6
Aim:
To develop a Simple Android Application for Native Calculator.
Procedure:
1. Start the process.
3. Create a new project by : File ->New -> Project -> Android ( Wizard ) - > Android
Application Project .
4. In New Android Application dialog to enter the required values for creating the new
android application such as Application Name, Package name and Project Name.
6. In Under create activity wizard Add an activity to <template>, select Blank Activity and
click Next.
7. Change the Activity Name to Mainactivity then Click the Finish button to create the
project.
simpledraw/res/layout/activity_mainactivity.xml
This is the XML layout file for the activity you added when you created the project
with Android Studio.
simpledraw/src/com.exmaple.simpledraw/ Mainactivity.java
When you select the file you see the class definition for the activity you created.
simpledraw/AndroidManifest.xml
To run your app on the emulator you need to first create an Android Virtual Device (AVD).
An AVD is a device configuration for the Android emulator that allows you to model a
specific device.
Graphical Layout
import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
Button one, two, three, four, five, six, seven, eight, nine, zero, add,
EditText disp;
int op1;
int op2;
String optr;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
try {
one.setOnClickListener(this);
two.setOnClickListener(this);
three.setOnClickListener(this);
four.setOnClickListener(this);
five.setOnClickListener(this);
six.setOnClickListener(this);
seven.setOnClickListener(this);
eight.setOnClickListener(this);
nine.setOnClickListener(this);
zero.setOnClickListener(this);
cancel.setOnClickListener(this);
add.setOnClickListener(this);
sub.setOnClickListener(this);
mul.setOnClickListener(this);
div.setOnClickListener(this);
equal.setOnClickListener(this);
} catch (Exception e) {}
if (optr.equals("+")) {
op2 = Integer.parseInt(disp.getText().toString());
disp.setText("");
disp.setText(Integer.toString(op1));
} else if (optr.equals("-")) {
op2 = Integer.parseInt(disp.getText().toString());
disp.setText("");
disp.setText(Integer.toString(op1));
} else if (optr.equals("*")) {
op2 = Integer.parseInt(disp.getText().toString());
disp.setText("");
disp.setText(Integer.toString(op1));
} else if (optr.equals("/")) {
op2 = Integer.parseInt(disp.getText().toString());
disp.setText("");
disp.setText(Integer.toString(op1));
@Override
switch (arg0.getId()) {
case R.id.Button08:
if (op2 != 0) {
op2 = 0;
disp.setText("");
str = str.append(one.getText());
disp.setText(str);
break;
case R.id.Button15:
if (op2 != 0) {
op2 = 0;
disp.setText("");
str = str.append(two.getText());
disp.setText(str);
break;
case R.id.Button14:
if (op2 != 0) {
op2 = 0;
disp.setText("");
str = str.append(three.getText());
disp.setText(str);
break;
case R.id.Button03:
if (op2 != 0) {
op2 = 0;
disp.setText("");
str = str.append(four.getText());
disp.setText(str);
break;
case R.id.Button02:
if (op2 != 0) {
op2 = 0;
disp.setText("");
str = str.append(five.getText());
disp.setText(str);
break;
case R.id.Button01:
if (op2 != 0) {
op2 = 0;
disp.setText("");
str = str.append(six.getText());
disp.setText(str);
break;
case R.id.button1:
if (op2 != 0) {
op2 = 0;
disp.setText("");
str = str.append(seven.getText());
disp.setText(str);
break;
case R.id.Button06:
if (op2 != 0) {
op2 = 0;
disp.setText("");
str = str.append(eight.getText());
disp.setText(str);
break;
case R.id.Button05:
if (op2 != 0) {
op2 = 0;
disp.setText("");
str = str.append(nine.getText());
disp.setText(str);
break;
case R.id.Button11:
if (op2 != 0) {
op2 = 0;
disp.setText("");
str = str.append(zero.getText());
disp.setText(str);
break;
case R.id.editText1:
op1 = 0;
op2 = 0;
disp.setText("");
break;
case R.id.Button09:
optr = "+";
if (op1 == 0) {
op1 = Integer.parseInt(disp.getText().toString());
disp.setText("");
} else if (op2 != 0) {
op2 = 0;
disp.setText("");
} else {
op2 = Integer.parseInt(disp.getText().toString());
disp.setText("");
break;
case R.id.Button13:
optr = "-";
if (op1 == 0) {
op1 = Integer.parseInt(disp.getText().toString());
disp.setText("");
} else if (op2 != 0) {
op2 = 0;
disp.setText("");
} else {
op2 = Integer.parseInt(disp.getText().toString());
disp.setText("");
break;
case R.id.Button07:
optr = "*";
if (op1 == 0) {
op1 = Integer.parseInt(disp.getText().toString());
disp.setText("");
} else if (op2 != 0) {
op2 = 0;
disp.setText("");
} else {
op2 = Integer.parseInt(disp.getText().toString());
disp.setText("");
break;
case R.id.Button04:
optr = "/";
if (op1 == 0) {
op1 = Integer.parseInt(disp.getText().toString());
disp.setText("");
} else if (op2 != 0) {
op2 = 0;
disp.setText("");
} else {
op2 = Integer.parseInt(disp.getText().toString());
disp.setText("");
break;
case R.id.Button10:
if (!optr.equals(null)) {
if (op2 != 0) {
if (optr.equals("+")) {
disp.setText(Integer.toString(op1));
} else if (optr.equals("-")) {
disp.setText(Integer.toString(op1));
} else if (optr.equals("*")) {
disp.setText(Integer.toString(op1));
} else if (optr.equals("/")) {
disp.setText(Integer.toString(op1));
} else {
operation();
break;
}
OUTPUT
RESULT:
Exp: Implement an application that creates an alert upon
No: 7 receiving a message
Aim:
To develop a Android Application that creates an alert upon receiving a message.
Procedure:
1. Start the process.
3. Create a new project by : File ->New -> Project -> Android ( Wizard ) - > Android
Application Project .
4. In New Android Application dialog to enter the required values for creating the new
android application such as Application Name, Package name and Project Name.
6. In Under create activity wizard Add an activity to <template>, select Blank Activity and
click Next.
7. Change the Activity Name to Mainactivity then Click the Finish button to create the
project.
simpledraw/res/layout/activity_mainactivity.xml
This is the XML layout file for the activity you added when you created the project
with Android Studio.
simpledraw/src/com.exmaple.simpledraw/ Mainactivity.java
When you select the file you see the class definition for the activity you created.
simpledraw/AndroidManifest.xml
To run your app on the emulator you need to first create an Android Virtual Device (AVD).
An AVD is a device configuration for the Android emulator that allows you to model a
specific device.
Graphical Layout
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends AppCompatActivity
Button notify;
EditText e;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
e= (EditText) findViewById(R.id.editText);
notify.setOnClickListener(new View.OnClickListener()
@Override
noti.flags |= Notification.FLAG_AUTO_CANCEL;
manager.notify(0, noti);
});
OUTPUT
RESULT:
Exp: Develop a mobile application to send an email
No: 8
Aim:
To develop a mobile application to send an email.
Procedure:
1. Start the process.
3. Create a new project by : File ->New -> Project -> Android ( Wizard ) - > Android
Application Project .
4. In New Android Application dialog to enter the required values for creating the new
android application such as Application Name, Package name and Project Name.
6. In Under create activity wizard Add an activity to <template>, select Blank Activity and
click Next.
7. Change the Activity Name to Mainactivity then Click the Finish button to create the
project.
simpledraw/res/layout/activity_mainactivity.xml
This is the XML layout file for the activity you added when you created the project
with Android Studio.
simpledraw/src/com.exmaple.simpledraw/ Mainactivity.java
When you select the file you see the class definition for the activity you created.
simpledraw/AndroidManifest.xml
To run your app on the emulator you need to first create an Android Virtual Device (AVD).
An AVD is a device configuration for the Android emulator that allows you to model a
specific device.
Graphical Layout
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
startBtn.setOnClickListener(new View.OnClickListener() {
sendEmail();
});
String[] TO = {""};
String[] CC = {""};
emailIntent.setData(Uri.parse("mailto:"));
emailIntent.setType("text/plain");
emailIntent.putExtra(Intent.EXTRA_EMAIL, TO);
emailIntent.putExtra(Intent.EXTRA_CC, CC);
try {
finish();
Toast.LENGTH_SHORT).show();
OUTPUT
RESULT:
Exp: Develop an application for Web view to display website
No: 9
Aim:
To develop an mobile application for web view to display website.
Procedure:
1. Start the process.
3. Create a new project by : File ->New -> Project -> Android ( Wizard ) - > Android
Application Project .
4. In New Android Application dialog to enter the required values for creating the new
android application such as Application Name, Package name and Project Name.
6. In Under create activity wizard Add an activity to <template>, select Blank Activity and
click Next.
7. Change the Activity Name to Mainactivity then Click the Finish button to create the
project.
simpledraw/res/layout/activity_mainactivity.xml
This is the XML layout file for the activity you added when you created the project
with Android Studio.
simpledraw/src/com.exmaple.simpledraw/ Mainactivity.java
When you select the file you see the class definition for the activity you created.
simpledraw/AndroidManifest.xml
To run your app on the emulator you need to first create an Android Virtual Device (AVD).
An AVD is a device configuration for the Android emulator that allows you to model a
specific device.
Graphical Layout
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.EditText;
EditText url;
Button search;
WebView site;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
url=(EditText)findViewById(R.id.editText);
search=(Button)findViewById(R.id.button);
search.setOnClickListener(new View.OnClickListener() {
@Override
site.setWebViewClient(new WebViewClient());
site.loadUrl(web);
});
OUTPUT
RESULT:
Exp: Develop an application to display a location on Map
No: 10 using Map view
Aim:
To develop an mobile application to display a location on Map using Map view.
Procedure:
1. Start the process.
3. Create a new project by : File ->New -> Project -> Android ( Wizard ) - > Android
Application Project .
4. In New Android Application dialog to enter the required values for creating the new
android application such as Application Name, Package name and Project Name.
6. In Under create activity wizard Add an activity to <template>, select Blank Activity and
click Next.
7. Change the Activity Name to Mainactivity then Click the Finish button to create the
project.
simpledraw/res/layout/activity_mainactivity.xml
This is the XML layout file for the activity you added when you created the project
with Android Studio.
simpledraw/src/com.exmaple.simpledraw/ Mainactivity.java
When you select the file you see the class definition for the activity you created.
simpledraw/AndroidManifest.xml
To run your app on the emulator you need to first create an Android Virtual Device (AVD).
An AVD is a device configuration for the Android emulator that allows you to model a
specific device.
Graphical Layout
import android.location.Address;
import android.location.Geocoder;
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapView;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import java.io.IOException;
import java.util.List;
OnMapReadyCallback {
MapView view;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
view.onCreate(savedInstanceState);
view.getMapAsync(this);
@Override
view.onResume();
super.onResume();
@Override
mMap = googleMap;
0)).title("Marker"));
mMap.setMyLocationEnabled(true);
}
try {
} catch (IOException e) {
e.printStackTrace();
address.getLongitude());
mMap.addMarker(new
MarkerOptions().position(latLng).title(location));
mMap.animateCamera(CameraUpdateFactory.newLatLng(latLng));
}
OUTPUT
RESULT: