yayaa / LocationManager

Simplify getting user's location for Android
806 stars 187 forks source link

GoogleApiClient Not Connected yet #85

Closed abusarahrc closed 6 years ago

abusarahrc commented 6 years ago

java.lang.IllegalStateException: GoogleApiClient is not connected yet. at com.google.android.gms.internal.zzaar.zzb(Unknown Source) at com.google.android.gms.internal.zzaav.zzb(Unknown Source) at com.google.android.gms.internal.zzaat.zzb(Unknown Source) at com.google.android.gms.internal.zzary.requestLocationUpdates(Unknown Source) at com.abusarah.taxinowdriver.Welcome.startLocationUpdates(Welcome.java:220) at com.abusarah.taxinowdriver.Welcome.onConnected(Welcome.java:267) at com.google.android.gms.common.internal.zzm.zzq(Unknown Source) at com.google.android.gms.internal.zzaat.zzo(Unknown Source) at com.google.android.gms.internal.zzaar.zzwi(Unknown Source) at com.google.android.gms.internal.zzaar.onConnected(Unknown Source) at com.google.android.gms.internal.zzaav.onConnected(Unknown Source) at com.google.android.gms.internal.zzaag.onConnected(Unknown Source) at com.google.android.gms.common.internal.zzl$1.onConnected(Unknown Source) at com.google.android.gms.common.internal.zzf$zzj.zzxG(Unknown Source) at com.google.android.gms.common.internal.zzf$zza.zzb(Unknown Source) at com.google.android.gms.common.internal.zzf$zza.zzu(Unknown Source) at com.google.android.gms.common.internal.zzf$zze.zzxH(Unknown Source) at com.google.android.gms.common.internal.zzf$zzd.handleMessage(Unknown Source) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:163) at android.app.ActivityThread.main(ActivityThread.java:6221) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)

Configuration

package com.abusarah.taxinowdriver;

import android.Manifest; import android.content.pm.PackageManager; import android.location.Location; import android.os.Bundle; import android.os.Handler; import android.os.SystemClock; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.design.widget.Snackbar; import android.support.v4.app.ActivityCompat; import android.support.v4.app.FragmentActivity; import android.util.Log; import android.view.animation.LinearInterpolator; import android.widget.Toast;

import com.firebase.geofire.GeoFire; import com.firebase.geofire.GeoLocation;

import com.github.glomadrian.materialanimatedswitch.MaterialAnimatedSwitch;

import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesUtil; import com.google.android.gms.common.api.GoogleApiClient;

import com.google.android.gms.location.LocationListener; import com.google.android.gms.location.LocationRequest; import com.google.android.gms.location.LocationServices;

import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions;

import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase;

public class Welcome extends FragmentActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {

private GoogleMap mMap;

//Play Service
private static final int MY_PERMISSION_REQUEST_CODE = 7000;
private static final int PLAY_SERVICE_RES_REQUEST = 7001;

private LocationRequest mLocationRequest;
private GoogleApiClient mGoogleApiClient;
private Location mLastLocation;

private static int UPDATE_INTERVAL = 5000;
private static int FASTEST_INTERVAL = 3000;
private static int DISPLACEMENT = 10;

DatabaseReference drivers;
GeoFire geoFire;
Marker mCurrent;
MaterialAnimatedSwitch location_switch;
SupportMapFragment mapFragment;

//--------->
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_welcome);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);

    //init view
    location_switch = (MaterialAnimatedSwitch)findViewById(R.id.location_switch);
    location_switch.setOnCheckedChangeListener(new MaterialAnimatedSwitch.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(boolean isOnline) {
            if (isOnline) {
                startLocationUpdates();
                displayLocation();
                Snackbar.make(mapFragment.getView(), "Anda Sedang Online", Snackbar.LENGTH_SHORT)
                        .show();
            } else {
                stopLocationUpdate();
                mCurrent.remove();
                Snackbar.make(mapFragment.getView(), "Anda Sedang Offline", Snackbar.LENGTH_SHORT)
                        .show();
            }
        }
    });
    // Geo Fire
    drivers = FirebaseDatabase.getInstance().getReference("Drivers");
    geoFire = new GeoFire(drivers);
    setUpLocation();
}

private void createLocationRequest() {
    mLocationRequest = new LocationRequest();
    mLocationRequest.setInterval(UPDATE_INTERVAL);
    mLocationRequest.setFastestInterval(FASTEST_INTERVAL);
    mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
    mLocationRequest.setSmallestDisplacement(DISPLACEMENT);
}

private void buildGoogleApiClient() {
    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(LocationServices.API)
            .build();
    mGoogleApiClient.connect();
}

private boolean checkPlayServices() {
    int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
    if (resultCode != ConnectionResult.SUCCESS) {
        if (GooglePlayServicesUtil.isUserRecoverableError(resultCode))
            GooglePlayServicesUtil.getErrorDialog(resultCode, this, PLAY_SERVICE_RES_REQUEST).show();
        else {
            Toast.makeText(this, "Device ini tidak di Support", Toast.LENGTH_SHORT).show();
            finish();
        }
        return false;
    }
    return true;
}

private void stopLocationUpdate() {
    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
            ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED)
    {
        return;
    }
    LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, this);
}

private void displayLocation() {
    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
            ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED )
    {
        return;
    }
    mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
    if (mLastLocation != null)
    {
        if (location_switch.isChecked())
        {
            final double latitude = mLastLocation.getLatitude();
            final double longitude = mLastLocation.getLongitude();

            //update to Firebase
            geoFire.setLocation(FirebaseAuth.getInstance().getCurrentUser().getUid(), new GeoLocation(latitude, longitude), new GeoFire.CompletionListener() {
                @Override
                public void onComplete(String key, DatabaseError error) {
                    //add marker
                    if (mCurrent != null)
                        mCurrent.remove(); //remove already marker
                    mCurrent = mMap.addMarker(new MarkerOptions()
                            .icon(BitmapDescriptorFactory.fromResource(R.drawable.car))
                            .position(new LatLng(latitude, longitude))
                            .title("Anda"));
                    // Pindahkan fucus ke posisi ini
                    mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitude, longitude), 15.0f));
                    //draw animated rotate marker
                    rotateMarker(mCurrent, -360, mMap);
                }
            });
        }
    }
    else
    {
        Log.d("ERROR", "Tidak dapat Menemukan Lokasi anda");
    }
    //Geo Fire
    drivers = FirebaseDatabase.getInstance().getReference("Drivers");
    geoFire = new GeoFire(drivers);

    setUpLocation();
}

// Turn marker mobil di map
private void rotateMarker(final Marker mCurrent, final float i, GoogleMap mMap) {
    final Handler handler = new Handler();
    final long start = SystemClock.uptimeMillis();
    final float startRotation = mCurrent.getRotation();
    final long duration = 1500;

    final LinearInterpolator interpolator = new LinearInterpolator();

    handler.post(new Runnable() {
        @Override
        public void run() {
            long elapsed = SystemClock.uptimeMillis() - start;
            float t = interpolator.getInterpolation((float)elapsed/duration);
            float rot = i*t +(1-t)*startRotation;
            mCurrent.setRotation(-rot > 180?rot/2:rot);
            if (t<1.0) {
                handler.postDelayed(this, 16);
            }

        }
    });
}

private void startLocationUpdates() {

    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
            ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED )
    {
        return;
    }
    LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
}

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
    switch (requestCode) {
        case MY_PERMISSION_REQUEST_CODE:
            if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                if (checkPlayServices()) {
                    buildGoogleApiClient();
                    createLocationRequest();
                    if (location_switch.isChecked())
                        displayLocation();
                }
            }
    }
}

private void setUpLocation() {
    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
            ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
            ) {
        // meminta izin runtime
        ActivityCompat.requestPermissions(this, new String[] {
                Manifest.permission.ACCESS_COARSE_LOCATION,
                Manifest.permission.ACCESS_FINE_LOCATION
        }, MY_PERMISSION_REQUEST_CODE);
    }
    else
    {
        if (checkPlayServices()) {
            buildGoogleApiClient();
            createLocationRequest();
            if (location_switch.isChecked())
                displayLocation();
        }
    }
}

@Override
public void onMapReady(GoogleMap googleMap) {
    mMap = googleMap;
}

@Override
public void onConnected(@Nullable Bundle bundle) {
    displayLocation();
    startLocationUpdates();
}

@Override
public void onConnectionSuspended(int i) {
    mGoogleApiClient.connect();
}

@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
}

@Override
public void onLocationChanged(Location location) {
    mLastLocation = location;
    displayLocation();
}

}

Logs

06-26 14:55:38.584 13016-14462/? V/FA: Inactivity, disconnecting from the service 06-26 14:55:43.430 13016-14462/? V/FA: Session started, time: 72982935 06-26 15:06:05.419 13016-15402/? V/FA: Recording user engagement, ms: 631752 06-26 15:06:05.448 13016-15402/? V/FA: Connecting to remote service 06-26 15:06:05.483 13016-15402/? V/FA: Activity paused, time: 73604814 06-26 15:06:05.801 13016-13016/? W/IInputConnectionWrapper: reportFullscreenMode on inexistent InputConnection 06-26 15:06:05.827 13016-15402/? D/FA: Connected to remote service 06-26 15:06:05.828 13016-15402/? V/FA: Processing queued up service tasks: 1 06-26 15:06:05.846 15328-15328/? I/FA: App measurement is starting up, version: 11400 To enable debug logging run: adb shell setprop log.tag.FA VERBOSE 06-26 15:06:05.854 15328-15328/? V/FA: Collection enabled App package, google app id: com.google.android.apps.tachyon, 1:206908507205:android:167bd0ff59cd7d44 06-26 15:06:05.871 15328-15328/? I/FA: To enable faster debug mode event logging run: adb shell setprop debug.firebase.analytics.app com.google.android.apps.tachyon 06-26 15:06:05.871 15328-15328/? D/FA: Debug-level message logging enabled 06-26 15:06:05.902 15328-15328/? V/FA: Cancelling job. JobID: -1716274347 06-26 15:06:05.904 15328-15328/? V/FA: Registered activity lifecycle callback 06-26 15:06:05.932 15328-15420/? V/FA: Using measurement service Connecting to remote service 06-26 15:06:05.947 15328-15420/? V/FA: Using measurement service Connection attempt already in progress 06-26 15:06:06.211 15328-15420/? D/FA: Connected to remote service 06-26 15:06:06.211 15328-15420/? V/FA: Processing queued up service tasks: 2 06-26 15:06:07.306 24225-15457/? V/FA: Connecting to remote service 06-26 15:06:07.319 24225-15457/? V/FA: Activity resumed, time: 73606802 06-26 15:06:07.744 24225-15457/? D/FA: Connected to remote service 06-26 15:06:07.745 24225-15457/? V/FA: Processing queued up service tasks: 1 06-26 15:06:09.659 24225-15457/? V/FA: Recording user engagement, ms: 2362 06-26 15:06:09.671 24225-15457/? V/FA: Activity paused, time: 73609163 06-26 15:06:09.719 24225-24225/? V/FA: onActivityCreated 06-26 15:06:09.734 24225-15457/? D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=2362, firebase_screen_class(_sc)=HomeActivity, firebase_screen_id(_si)=842981199495140518}] 06-26 15:06:09.913 2895-15419/? V/FA-SVC: Logging event: origin=auto,name=user_engagement(_e),params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=2362, firebase_screen_class(_sc)=HomeActivity, firebase_screen_id(_si)=842981199495140518}] 06-26 15:06:09.925 24225-15457/? V/FA: Activity resumed, time: 73609424 06-26 15:06:09.935 24225-15457/? D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=HomeActivity, firebase_previous_id(_pi)=842981199495140518, firebase_screen_class(_sc)=Conversation, firebase_screen_id(_si)=842981199495140523}] 06-26 15:06:10.101 2895-15419/? V/FA-SVC: Saving event, name, data size: user_engagement(_e), 67 06-26 15:06:10.106 2895-15419/? V/FA-SVC: Event recorded: Event{appId='com.whatsapp', name='user_engagement(_e)', params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=2362, firebase_screen_class(_sc)=HomeActivity, firebase_screen_id(_si)=842981199495140518}]} 06-26 15:06:10.110 2895-15419/? V/FA-SVC: Upload scheduled in approximately ms: 2069482 06-26 15:06:10.112 2895-15419/? V/FA-SVC: Cancelling job. JobID: 812057698 06-26 15:06:10.121 2895-15419/? V/FA-SVC: Scheduling upload with GcmTaskService Scheduling task with Gcm. time: 2069482 06-26 15:06:10.128 2895-15419/? V/FA-SVC: Background event processing time, ms: 216 06-26 15:06:10.748 2895-15419/? V/FA-SVC: Logging event: origin=auto,name=screen_view(_vs),params=Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=HomeActivity, firebase_previous_id(_pi)=842981199495140518, firebase_screen_class(_sc)=Conversation, firebase_screen_id(_si)=842981199495140523}] 06-26 15:06:10.773 2895-15419/? V/FA-SVC: Saving event, name, data size: screen_view(_vs), 95 Event recorded: Event{appId='com.whatsapp', name='screen_view(_vs)', params=Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=HomeActivity, firebase_previous_id(_pi)=842981199495140518, firebase_screen_class(_sc)=Conversation, firebase_screen_id(_si)=842981199495140523}]} 06-26 15:06:10.787 2895-15419/? V/FA-SVC: Upload scheduled in approximately ms: 2068805 06-26 15:06:10.790 2895-15419/? V/FA-SVC: Cancelling job. JobID: 812057698 06-26 15:06:10.797 2895-15419/? V/FA-SVC: Scheduling upload with GcmTaskService Scheduling task with Gcm. time: 2068805 06-26 15:06:10.811 2895-15419/? V/FA-SVC: Background event processing time, ms: 63 06-26 15:06:10.838 13016-15402/? V/FA: Inactivity, disconnecting from the service 06-26 15:06:11.341 15328-15420/? V/FA: Inactivity, disconnecting from the service 06-26 15:06:14.607 24225-15457/? V/FA: Recording user engagement, ms: 4688 06-26 15:06:14.609 24225-15457/? V/FA: Activity paused, time: 73614112 06-26 15:06:14.611 24225-15457/? D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=4688, firebase_screen_class(_sc)=Conversation, firebase_screen_id(_si)=842981199495140523}] 06-26 15:06:14.660 24225-15457/? V/FA: Activity resumed, time: 73614130 06-26 15:06:14.663 2895-15419/? V/FA-SVC: Logging event: origin=auto,name=user_engagement(_e),params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=4688, firebase_screen_class(_sc)=Conversation, firebase_screen_id(_si)=842981199495140523}] 06-26 15:06:14.664 24225-15457/? D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=Conversation, firebase_previous_id(_pi)=842981199495140523, firebase_screen_class(_sc)=HomeActivity, firebase_screen_id(_si)=842981199495140518}] 06-26 15:06:14.686 2895-15419/? V/FA-SVC: Saving event, name, data size: user_engagement(_e), 67 Event recorded: Event{appId='com.whatsapp', name='user_engagement(_e)', params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=4688, firebase_screen_class(_sc)=Conversation, firebase_screen_id(_si)=842981199495140523}]} 06-26 15:06:14.720 2895-15419/? V/FA-SVC: Upload scheduled in approximately ms: 2064872 06-26 15:06:14.722 2895-15419/? V/FA-SVC: Cancelling job. JobID: 812057698 06-26 15:06:14.738 2895-15419/? V/FA-SVC: Scheduling upload with GcmTaskService Scheduling task with Gcm. time: 2064872 06-26 15:06:14.747 2895-15419/? V/FA-SVC: Background event processing time, ms: 84 06-26 15:06:14.773 2895-15419/? V/FA-SVC: Logging event: origin=auto,name=screen_view(_vs),params=Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=Conversation, firebase_previous_id(_pi)=842981199495140523, firebase_screen_class(_sc)=HomeActivity, firebase_screen_id(_si)=842981199495140518}] 06-26 15:06:14.781 2895-15419/? V/FA-SVC: Saving event, name, data size: screen_view(_vs), 95 06-26 15:06:14.782 2895-15419/? V/FA-SVC: Event recorded: Event{appId='com.whatsapp', name='screen_view(_vs)', params=Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=Conversation, firebase_previous_id(_pi)=842981199495140523, firebase_screen_class(_sc)=HomeActivity, firebase_screen_id(_si)=842981199495140518}]} 06-26 15:06:14.785 2895-15419/? V/FA-SVC: Upload scheduled in approximately ms: 2064807 06-26 15:06:14.786 2895-15419/? V/FA-SVC: Cancelling job. JobID: 812057698 06-26 15:06:14.791 2895-15419/? V/FA-SVC: Scheduling upload with GcmTaskService Scheduling task with Gcm. time: 2064807 06-26 15:06:14.797 2895-15419/? V/FA-SVC: Background event processing time, ms: 24 06-26 15:06:19.782 24225-15457/? V/FA: Inactivity, disconnecting from the service 06-26 15:06:20.916 24225-15457/? V/FA: Recording user engagement, ms: 6288 06-26 15:06:20.917 24225-15457/? V/FA: Connecting to remote service 06-26 15:06:20.922 24225-15457/? V/FA: Activity paused, time: 73620417 06-26 15:06:20.932 24225-15457/? D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=6288, firebase_screen_class(_sc)=HomeActivity, firebase_screen_id(_si)=842981199495140518}] 06-26 15:06:20.959 24225-24225/? V/FA: onActivityCreated 06-26 15:06:21.115 24225-15457/? V/FA: Connection attempt already in progress 06-26 15:06:21.116 24225-15457/? V/FA: Connection attempt already in progress Activity resumed, time: 73620568 06-26 15:06:21.117 24225-15457/? D/FA: Connected to remote service 06-26 15:06:21.117 24225-15457/? V/FA: Processing queued up service tasks: 3 06-26 15:06:21.141 24225-15457/? D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=HomeActivity, firebase_previous_id(_pi)=842981199495140518, firebase_screen_class(_sc)=Conversation, firebase_screen_id(_si)=842981199495140524}] 06-26 15:06:21.143 2895-15419/? V/FA-SVC: Logging event: origin=auto,name=user_engagement(_e),params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=6288, firebase_screen_class(_sc)=HomeActivity, firebase_screen_id(_si)=842981199495140518}] 06-26 15:06:21.227 2895-15419/? V/FA-SVC: Saving event, name, data size: user_engagement(_e), 67 06-26 15:06:21.228 2895-15419/? V/FA-SVC: Event recorded: Event{appId='com.whatsapp', name='user_engagement(_e)', params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=6288, firebase_screen_class(_sc)=HomeActivity, firebase_screen_id(_si)=842981199495140518}]} 06-26 15:06:21.234 2895-15419/? V/FA-SVC: Upload scheduled in approximately ms: 2058358 06-26 15:06:21.237 2895-15419/? V/FA-SVC: Cancelling job. JobID: 812057698 06-26 15:06:21.243 2895-15419/? V/FA-SVC: Scheduling upload with GcmTaskService Scheduling task with Gcm. time: 2058358 06-26 15:06:21.259 2895-15419/? V/FA-SVC: Background event processing time, ms: 117 06-26 15:06:21.295 2895-15419/? V/FA-SVC: Logging event: origin=auto,name=screen_view(_vs),params=Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=HomeActivity, firebase_previous_id(_pi)=842981199495140518, firebase_screen_class(_sc)=Conversation, firebase_screen_id(_si)=842981199495140524}] 06-26 15:06:21.304 2895-15419/? V/FA-SVC: Saving event, name, data size: screen_view(_vs), 95 06-26 15:06:21.305 2895-15419/? V/FA-SVC: Event recorded: Event{appId='com.whatsapp', name='screen_view(_vs)', params=Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=HomeActivity, firebase_previous_id(_pi)=842981199495140518, firebase_screen_class(_sc)=Conversation, firebase_screen_id(_si)=842981199495140524}]} 06-26 15:06:21.310 2895-15419/? V/FA-SVC: Upload scheduled in approximately ms: 2058282 06-26 15:06:21.312 2895-15419/? V/FA-SVC: Cancelling job. JobID: 812057698 06-26 15:06:21.317 2895-15419/? V/FA-SVC: Scheduling upload with GcmTaskService Scheduling task with Gcm. time: 2058282 06-26 15:06:21.329 2895-15419/? V/FA-SVC: Background event processing time, ms: 35 06-26 15:06:26.237 24225-15457/? V/FA: Inactivity, disconnecting from the service 06-26 15:06:36.147 24225-15457/? V/FA: Recording user engagement, ms: 15084 Connecting to remote service 06-26 15:06:36.152 24225-15457/? V/FA: Activity paused, time: 73635651 06-26 15:06:36.154 24225-15457/? D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=15084, firebase_screen_class(_sc)=Conversation, firebase_screen_id(_si)=842981199495140524}] 06-26 15:06:36.180 24225-15457/? V/FA: Connection attempt already in progress Connection attempt already in progress Activity resumed, time: 73635672 06-26 15:06:36.182 24225-15457/? D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=Conversation, firebase_previous_id(_pi)=842981199495140524, firebase_screen_class(_sc)=HomeActivity, firebase_screen_id(_si)=842981199495140518}] 06-26 15:06:36.227 24225-15457/? V/FA: Connection attempt already in progress 06-26 15:06:36.227 24225-15457/? D/FA: Connected to remote service 06-26 15:06:36.227 24225-15457/? V/FA: Processing queued up service tasks: 4 06-26 15:06:36.248 2895-15419/? V/FA-SVC: Logging event: origin=auto,name=user_engagement(_e),params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=15084, firebase_screen_class(_sc)=Conversation, firebase_screen_id(_si)=842981199495140524}] 06-26 15:06:36.284 2895-15419/? V/FA-SVC: Saving event, name, data size: user_engagement(_e), 67 Event recorded: Event{appId='com.whatsapp', name='user_engagement(_e)', params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=15084, firebase_screen_class(_sc)=Conversation, firebase_screen_id(_si)=842981199495140524}]} 06-26 15:06:36.292 2895-15419/? V/FA-SVC: Upload scheduled in approximately ms: 2043300 06-26 15:06:36.294 2895-15419/? V/FA-SVC: Cancelling job. JobID: 812057698 06-26 15:06:36.305 2895-15419/? V/FA-SVC: Scheduling upload with GcmTaskService Scheduling task with Gcm. time: 2043300 06-26 15:06:36.315 2895-15419/? V/FA-SVC: Background event processing time, ms: 67 06-26 15:06:36.329 2895-15419/? V/FA-SVC: Logging event: origin=auto,name=screen_view(_vs),params=Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=Conversation, firebase_previous_id(_pi)=842981199495140524, firebase_screen_class(_sc)=HomeActivity, firebase_screen_id(_si)=842981199495140518}] 06-26 15:06:36.336 2895-15419/? V/FA-SVC: Saving event, name, data size: screen_view(_vs), 95 Event recorded: Event{appId='com.whatsapp', name='screen_view(_vs)', params=Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=Conversation, firebase_previous_id(_pi)=842981199495140524, firebase_screen_class(_sc)=HomeActivity, firebase_screen_id(_si)=842981199495140518}]} 06-26 15:06:36.339 2895-15419/? V/FA-SVC: Upload scheduled in approximately ms: 2043253 06-26 15:06:36.341 2895-15419/? V/FA-SVC: Cancelling job. JobID: 812057698 06-26 15:06:36.345 2895-15419/? V/FA-SVC: Scheduling upload with GcmTaskService Scheduling task with Gcm. time: 2043253 06-26 15:06:36.352 2895-15419/? V/FA-SVC: Background event processing time, ms: 23 06-26 15:06:41.253 24225-15457/? V/FA: Inactivity, disconnecting from the service 06-26 15:06:43.852 24225-15457/? V/FA: Recording user engagement, ms: 7686 06-26 15:06:43.853 24225-15457/? V/FA: Connecting to remote service 06-26 15:06:43.856 24225-15457/? V/FA: Activity paused, time: 73643357 06-26 15:06:43.858 24225-15457/? D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=7686, firebase_screen_class(_sc)=HomeActivity, firebase_screen_id(_si)=842981199495140518}] 06-26 15:06:43.879 24225-15457/? V/FA: Connection attempt already in progress 06-26 15:06:44.158 24225-15457/? D/FA: Connected to remote service 06-26 15:06:44.158 24225-15457/? V/FA: Processing queued up service tasks: 2 06-26 15:06:44.159 24225-24225/? W/IInputConnectionWrapper: reportFullscreenMode on inexistent InputConnection 06-26 15:06:44.195 2895-15419/? V/FA-SVC: Logging event: origin=auto,name=user_engagement(_e),params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=7686, firebase_screen_class(_sc)=HomeActivity, firebase_screen_id(_si)=842981199495140518}] 06-26 15:06:44.204 2895-15419/? V/FA-SVC: Saving event, name, data size: user_engagement(_e), 67 06-26 15:06:44.205 2895-15419/? V/FA-SVC: Event recorded: Event{appId='com.whatsapp', name='user_engagement(_e)', params=Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=7686, firebase_screen_class(_sc)=HomeActivity, firebase_screen_id(_si)=842981199495140518}]} 06-26 15:06:44.208 2895-15419/? V/FA-SVC: Upload scheduled in approximately ms: 2035384 06-26 15:06:44.210 2895-15419/? V/FA-SVC: Cancelling job. JobID: 812057698 06-26 15:06:44.215 2895-15419/? V/FA-SVC: Scheduling upload with GcmTaskService Scheduling task with Gcm. time: 2035384 06-26 15:06:44.221 2895-15419/? V/FA-SVC: Background event processing time, ms: 26 06-26 15:06:49.194 24225-15457/? V/FA: Inactivity, disconnecting from the service 06-26 15:12:48.614 16509-16509/com.abusarah.taxinowdriver I/FA: App measurement is starting up, version: 10298 To enable debug logging run: adb shell setprop log.tag.FA VERBOSE

abusarahrc commented 6 years ago

i tried to follow tutorial from youtube, but i get this problem, can anyone help me?

yayaa commented 6 years ago

All of these connection issues are handled within the library, feel free to use and ask if any question you still have. But this one is not related to library, sorry.