Android 在安卓系统中,如何获取摄像机视图区域纬度和经度以及摄像机视图的用户方向

Android 在安卓系统中,如何获取摄像机视图区域纬度和经度以及摄像机视图的用户方向,android,geolocation,android-camera,latitude-longitude,Android,Geolocation,Android Camera,Latitude Longitude,嗨,我是android应用程序开发新手。我需要从以下场景开发应用程序: 首先,我需要获得用户相机观看方向的方向(如北、南、东、西) 第二,我如何计算相机视图区域/面积 第三,如何只过滤摄像机观察区域的经纬度 如果您没有收到我的问题,我附上了图片供您理解 我对此一无所知。请任何人帮助开发应用程序 请提前感谢第1步: 您需要一种指南针来向用户指示方向: 第二步:你需要做一些数学计算 对于步骤3: 您必须获得当前拍摄图像位置的经纬度: 像这样实现类:实现LocationListener Locat

嗨,我是android应用程序开发新手。我需要从以下场景开发应用程序:

  • 首先,我需要获得用户相机观看方向的方向(如北、南、东、西)
  • 第二,我如何计算相机视图区域/面积
  • 第三,如何只过滤摄像机观察区域的经纬度
  • 如果您没有收到我的问题,我附上了图片供您理解

    我对此一无所知。请任何人帮助开发应用程序

    请提前感谢第1步:

    您需要一种指南针来向用户指示方向:

    第二步:你需要做一些数学计算

    对于步骤3:

    您必须获得当前拍摄图像位置的经纬度:

    像这样实现类:实现LocationListener

    LocationManager mLocationManager;
    
    mLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    
            Location location = mLocationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
            if(location != null) {
                lat = location.getLatitude();
                lng = location.getLongitude();
                getWeatherInfo();
            }
            else {
                mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);
                Toast.makeText(ClimateInfo.this,"GPS / Internet not available, please check the connections and retry!",Toast.LENGTH_LONG).show();
            }
    
    @Override
        public void onLocationChanged(Location location) {
            if (location != null) {
                Log.v("Location Changed", location.getLatitude() + " and " + location.getLongitude());
                lat = location.getLatitude();
                lng = location.getLongitude();
            }
    
        }