android-googleapiclient

How to receive location updates every 5 minutes using the FusedLocation API

烂漫一生 提交于 2019-12-03 09:00:23
I am currently working on an app that has to check the user's location every five minutes and send the coordinates to a server. I decided to go with the FusedLocation API in Google Play Services instead of the plain old LocationManager API, mainly because I noticed the LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY priority level, which claims to offer a 100-meter accuracy level with reasonable battery usage, which is EXACTLY what I need. In my case, I have an Activity whose inheritance structure is: public class MainActivity extends AppCompatActivity implements GoogleApiClient

google maps are returning null pointer exception

点点圈 提交于 2019-12-02 12:06:01
when I am trying to show the maps on my fragment it is returning null pointer exception. I have added everything to the manifest each and every permission. I am attaching the fragment file its XML file and the log cat Chatffragment.java public class ChatFragment extends Fragment{ // Google Map private GoogleMap googleMap; public ChatFragment() { // Required empty public constructor } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View

Android : Google Sign In GoogleApiClient.connect()

久未见 提交于 2019-12-02 10:53:40
the following code is copied from www.developers.google.com i want to implement Google Sign In functionality, but unable to do so. when i click on SignIn Button it asks for permission and does some searching then Nothing happens, if i call GoogleApiClient.isConnected() it returns false. i have imported BaseGameUtils and also added line: compile project(':BaseGameUtils') app_id is generated using sha1 through: keytool -exportcert -alias androiddebugkey -keystore C:\Users\usman\.android\debug.keystore -list -v public class MenuActivity extends Activity implements GoogleApiClient

java.lang.IllegalStateException: Must not set scopes in GoogleApiClient.Builder when using Auth.GOOGLE_SIGN_IN_API

て烟熏妆下的殇ゞ 提交于 2019-12-02 10:11:30
问题 I am using drive api with authentication api. I need to login to google account first then upload files to drive. Problem is when i use only drive api without authentication is says unable to sign in. I signed in first using GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestEmail() .build(); mGoogleApiClient = new GoogleApiClient.Builder(this) .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */) .addApi(Auth

Android real-time multiplayer: onRoomCreated gets erratic STATUS_NETWORK_ERROR_NO_DATA

半城伤御伤魂 提交于 2019-12-02 08:14:55
Problem: onRoomCreated returns STATUS_NETWORK_ERROR_NO_DATA 5% of the times, for no reason that we can figure out. The game worked well for about 16 months of development (no problem of missing "permissions" in the manifest or the Google Play Console) but starting with Google Play Service 29 (that's "allegedly"... it could be unrelated), this unpredictable behaviour started, and it is blocking any further attempt to create a room (same wrong statusCode over again, even after restarting the game). The only way to make it work again is either to restart the game after 10-15 minutes or to restart

java.lang.IllegalStateException: Must not set scopes in GoogleApiClient.Builder when using Auth.GOOGLE_SIGN_IN_API

大憨熊 提交于 2019-12-02 07:18:51
I am using drive api with authentication api. I need to login to google account first then upload files to drive. Problem is when i use only drive api without authentication is says unable to sign in. I signed in first using GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestEmail() .build(); mGoogleApiClient = new GoogleApiClient.Builder(this) .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */) .addApi(Auth.GOOGLE_SIGN_IN_API, gso) .build(); Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent

Caused by: java.lang.IllegalStateException: GoogleApiClient is not connected yet

只谈情不闲聊 提交于 2019-12-01 16:15:21
I am getting this error message when trying to implement logout for Google Sign-In for Android: Caused by: java.lang.IllegalStateException: GoogleApiClient is not connected yet. The crash occurs in DrawerActivity.java (below), where I call the signOut() method. I've looked at the solutions in other posts and have tried them to no avail: java.lang.IllegalStateException: GoogleApiClient is not connected yet GoogleApiClient is not connected yet exception Fatal Exception: java.lang.IllegalStateException GoogleApiClient is not connected yet MainActivity.java: protected void onCreate(Bundle

Caused by: java.lang.IllegalStateException: GoogleApiClient is not connected yet

こ雲淡風輕ζ 提交于 2019-12-01 15:13:52
问题 I am getting this error message when trying to implement logout for Google Sign-In for Android: Caused by: java.lang.IllegalStateException: GoogleApiClient is not connected yet. The crash occurs in DrawerActivity.java (below), where I call the signOut() method. I've looked at the solutions in other posts and have tried them to no avail: java.lang.IllegalStateException: GoogleApiClient is not connected yet GoogleApiClient is not connected yet exception Fatal Exception: java.lang

GoogleApiClient is throwing “GoogleApiClient is not connected yet” AFTER onConnected function getting called

断了今生、忘了曾经 提交于 2019-11-26 20:18:40
So i found something that is not very clear for me about GoogleApiClient. GoogleApiClient has a function called onConnected which is ran when the client is connected (for sure) I got my own function called: startLocationListening which is eventually getting called on GoogleApiClient's onConnected function. So my startLocationListening function couldnt ran without a GoogleApiClient connection. Code and log: @Override public void onConnected(Bundle bundle) { log("Google_Api_Client:connected."); initLocationRequest(); startLocationListening(); //Exception caught inside this function } ... private

How to get access token after user is signed in from Gmail in Android?

做~自己de王妃 提交于 2019-11-26 18:50:42
I am following Google Sign in for Android . Now I can get the idToken but my back end server that I have used earlier is expecting access Token as I was using Google+ Login earlier. Now I don't want to alter my server side. But still how can I use Google Sign in and get the access Token in my android app so that I can validate my user to my back end server. I was using GooglePlay Service 7.5.0 previously and now I am using GooglePlay Service latest 8.3.0. For your requirements, you can use the following code: Firstly, make sure you have a valid Web OAuth 2.0 Client ID: <!-- Server Client ID.