2
votes

Hi I am new to android application development. I need to develop an application from following Scenario:

  1. Firstly i need to get direction(like north,south,east,west) of user camera viewing direction.
  2. Secondly how to i calculate camera view region/area
  3. Thirdly how do i get filter the latitude and longitude of camera view region only

If you didn't get my question, I attached the image for your understanding
enter image description here

I do not have any idea of this. Please any one help to develop the application.

Thanks in Advance

1

1 Answers

1
votes

For step 1:

You need a kind of a compass to show the user the direction:

http://sunil-android.blogspot.com/2013/02/create-our-android-compass.html

For step 2: You need to do some mathematical calculations.

For step 3:

You have to get the latitude and longitude of the current location of where you capture the image:

Implement your class like: implements 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();
        }

    }