0

I am new in android,I have getting two day error in GEoFencing class googlemap. so kindly provide better solution

 public class GeoFencingeg extends Activity implements ConnectionCallbacks,OnConnectionFailedListener,LocationListener{

    LocationRequest lr;
    GoogleApiClient mclient;
    TextView txt;
    Location mLastLocation;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_geo_fencingeg);
        txt=(TextView)findViewById(R.id.tv);
        lr=LocationRequest.create();
        mLastLocation=new Location("");

        Toast.makeText(getApplicationContext(), "Google API"+GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext()), Toast.LENGTH_LONG).show();
        try{
            mclient=new GoogleApiClient.Builder(this).addConnectionCallbacks(this)
                    .addOnConnectionFailedListener(this)
                    .addApi(Plus.API,new Plus.PlusOptions.Builder().build())
                    .addScope(Plus.SCOPE_PLUS_LOGIN).build();
            mclient.connect();
        }
        catch(Exception e){
            Log.i("Exception", e.getMessage());
        }

    }


    @Override
    protected void onStart() {
        // TODO Auto-generated method stub
        super.onStart();

    }


    @Override
    protected void onDestroy() {
        // TODO Auto-generated method stub
        super.onDestroy();
        if(mclient.isConnected())
            mclient.disconnect();
    }


    @Override
    public void onLocationChanged(Location location) {
        // TODO Auto-generated method stub
        txt.setText("Current Location"+location.toString());
    }

    @Override
    public void onConnectionFailed(ConnectionResult arg0) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onConnected(Bundle arg0) {
        // TODO Auto-generated method stub
        lr.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
        lr.setInterval(1000);
        LocationServices.FusedLocationApi.requestLocationUpdates(mclient, lr, this);
    }

    @Override
    public void onConnectionSuspended(int arg0) {
        // TODO Auto-generated method stu
        }
    }

while compiling the error come unknown source found in GoogleApiClient.Builder().Build().

enter image description here

best solution

Hemina
  • 375
  • 1
  • 11
  • see following post http://stackoverflow.com/questions/16621476/package-android-support-v4-util-does-not-exist – ρяσѕρєя K Nov 30 '15 at 06:20
  • i had already add android.support.v4.util package – Hemina Nov 30 '15 at 06:24
  • make sure you have the same support-v4 of app-v7 project with ,google play service lib and your current project .Just keep the same v4 of app-v7inside all the project mention above. – Radhey Nov 30 '15 at 07:39

0 Answers0