Salaam! I am, Shah Hussain Bangash Represent Online Soft Teach Company while here I will share step-by-step coding programming languages. We Invite those students who want to learn programming languages then should join us of the following links. Thanks Contact Us: +923025593765 Email: onlinesoftteach@gmail.com .

Thursday, April 18, 2019

/


1 Add Library

2 Create XML  + Create Google Console API

<string name="map_key" translatable="false">
  AIzaSyBOac3YAZEtsJaUHLeajuzs1awQJk2qnbY

2 Manifest Permissions

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>

<uses-permission android:name="android.permission.INTERNET"/>

<meta-data

    android:name="com.google.android.geo.API_KEY"

    android:value="@string/map_key" />
 

3 Create Fragment in XML

<fragment

    android:id="@+id/map"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:name="com.google.android.gms.maps.SupportMapFragment">

</fragment>
 

4 Java File Coding

public class MainActivity extends FragmentActivity implements OnMapReadyCallback {

GoogleMap map;
 
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()

        .findFragmentById(R.id.map);

mapFragment.getMapAsync(this);

@Override

    public void onMapReady(GoogleMap googleMap) {

        map =  googleMap;

        LatLng Pakistan =  new LatLng(-33.852, 151.211);

        map.addMarker(new MarkerOptions().position(Pakistan).title("Pakistan"));

        map.moveCamera(CameraUpdateFactory.newLatLng(Pakistan));
    }
}

Google Map Types 
- Nomal Type + Hybrid Type + Terrin & Satellite

0 comments:

Post a Comment

Popular Posts

Who I am?

Software Engg Shah Hussain Bangash represents onlinesoftteach.com. Furthermore, where I will share advanced level technologies solutions. Shah Hussain basically belongs to District Hangu in Peshawar Pakistan. As a software engineer, I have worked on different technologies and platforms in software companies. First of all, my objective is to practice my knowledge to build my professional career by learning from experts. I developed many projects for Freelancer & UpWork clients. Hence various programming language, which I will explain below and write the project names.