Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android

Pablo Rocha
Pablo Rocha
10,142 Points

Using the login template activity for the Ribbit project causing errors when looking for GooglePlayServicesClient

I added an activity and selected Login Activity from the wizard. It looks like it is going to use the user's Google Plus account to login. It creates a PlusBaseActivity.java file and in that file there are some imports referencing GooglePlayServicesClient and PlusClient. Those cannot be resolved. I have added everything I need from the SDK Manager and the gradle file has the play-services dependency.

I also looked on the developer reference website and see no GooglePlayServicesClient class in the common section. Here is where I looked: https://developer.android.com/reference/com/google/android/gms/common/package-summary.html

I am at a loss here, any help would be appreciated.

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesClient;
import com.google.android.gms.common.Scopes;
import com.google.android.gms.plus.PlusClient;


/**
 * A base class to wrap communication with the Google Play Services PlusClient.
 */
public abstract class PlusBaseActivity extends Activity
        implements GooglePlayServicesClient.ConnectionCallbacks,
        GooglePlayServicesClient.OnConnectionFailedListener {
Pablo Rocha
Pablo Rocha
10,142 Points

I found something saying that GooglePlayServicesClient is deprecated and to use GoogleApiClient instead. Is that a bug in ADT that the services client is still being used?

1 Answer

Murat Hasdemir
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Murat Hasdemir
Front End Web Development Techdegree Graduate 20,968 Points

Google login template for google account logins as fas as I know it wont work with parse, you can build a custom login screen from blank activity or use parseLoginUI (its cool in some ways but you wont have the power of custom login screen. Some times short cuts and templates not the best answers for a fast build :)

Pablo Rocha
Pablo Rocha
10,142 Points

Yeah I was not trying to use parse with the android studio template. One of the extra credits before the parse videos said to create a login screen using the template. But the template would not compile due to the issues I mentioned.

I agree though, we get more control when building from scratch. It has its good and bad qualities.