要在Android手机上显示Google地图位置,首先需要确保你的设备已经安装了Google Play服务。然后,你可以使用Google Maps API来集成地图到你的应用程序中。
以下是一个简单的示例代码,演示如何在Android应用程序中显示Google地图位置:
AndroidManifest.xml文件中添加以下权限: 
 
 
 
build.gradle文件中添加Google Play服务依赖:implementation 'com.google.android.gms:play-services-maps:17.0.0'
MapView元素来显示地图: 
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;
public class YourActivity extends AppCompatActivity implements OnMapReadyCallback {
    private MapView mapView;
    private GoogleMap googleMap;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.your_activity_layout);
        mapView = findViewById(R.id.mapView);
        mapView.onCreate(savedInstanceState);
        mapView.getMapAsync(this);
    }
    @Override
    public void onMapReady(GoogleMap map) {
        googleMap = map;
        // 在地图上添加标记
        LatLng location = new LatLng(37.7749, -122.4194);
        googleMap.addMarker(new MarkerOptions().position(location).title("San Francisco"));
        // 将地图视图移动到指定位置
        googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(location, 12f));
    }
    @Override
    public void onResume() {
        super.onResume();
        mapView.onResume();
    }
    @Override
    public void onPause() {
        super.onPause();
        mapView.onPause();
    }
    @Override
    public void onDestroy() {
        super.onDestroy();
        mapView.onDestroy();
    }
    @Override
    public void onLowMemory() {
        super.onLowMemory();
        mapView.onLowMemory();
    }
}
这样,当你运行应用程序时,你应该能够在Android手机上显示Google地图位置了。请确保你的设备已经连接到互联网,并且已经启用了Google Play服务。