Hi, today i’ll explain a simple way to load Google maps. But there is a limitation with this method as this way you can only view the data already available with the Google maps. Here you can just use the Activity class of android.jar. If you want to add additional locations you have to use the classes comes with the Google APIs by Google Inc.
This method let you find any location on the Google maps by street, city and country. You can use an instance of the Intent class in this case. Intent class is usually uses to launch an Activity from another Activity. Here you can pass a String of the location details as data to the Intent instance, via Uri.parse(). Now when you start the Activity, it starts searching the address we specified in the String by street, city and country.
First of all you can create a form which takes three texts as inputs with a button in the layout file (.xml). Then in your Activity class set the name of the xml file you created in the setContentView() method as follows.
public class navigationApp extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}}
Next create instances of each UI component by giving their id inside the onCreate() as follows.
final EditText input1 = (EditText) findViewById(R.id.blank1);
final EditText input2 = (EditText) findViewById(R.id.blank2);
final EditText input3 = (EditText) findViewById(R.id.blank3);
Button b=(Button)findViewById(R.id.Button1);
When you run this application on the emulator and click on the button the Google map will be loaded at the location you specified as follows.