Main navigation

Reader Interactions

Comments

  1. My partner and I absolutely love your blog and find nearly all of your post’s to be just what I’m looking for. Would you offer guest writers to write content available for you? I wouldn’t mind publishing a post or elaborating on a lot of the subjects you write related to here. Again, awesome web site!

  2. Hi there it’s me, I am also visiting this site daily, this web site is in fact pleasant and the people are really sharing pleasant thoughts.

  3. When some one searches for his essential thing, thus he/she needs to be available that in detail, therefore that thing is maintained over here.

  4. This is very interesting, You are a very skilled blogger. I’ve joined your rss feed and look forward to seeking more of your great post. Also, I have shared your site in my social networks!

  5. I was recommended this blog by my cousin. I’m not sure whether this post is written by him as nobody else know such detailed about my problem. You’re wonderful! Thanks!

  6. Hi there everyone, it’s my first pay a quick visit at this web page, and paragraph is really fruitful designed for me, keep up posting these types of articles or reviews.

  7. Hi there to every one, the contents existing at this web page are genuinely remarkable for people experience, well, keep up the good work fellows.

  8. Just wish to say your article is as amazing. The clearness in your post is just cool and i could assume you’re an expert on this subject. Well with your permission let me to grab your feed to keep up to date with forthcoming post. Thanks a million and please carry on the rewarding work.

  9. Its not my first time to pay a quick visit this web site, i am visiting this web site dailly and take pleasant facts from here daily.

  10. Ahaa, its fastidious discussion on the topic of this article here at this website, I have read all that, so at this time me also commenting at this place.

  11. Hi, I wish for to subscribe for this weblog to take most up-to-date updates, thus where can i do it please help.

  12. Hi, I’m using Android Studio and have been following your tutorial. I’m currently at “Add Login with Google” however I receive an error:

    plugin with id ‘com.google.gms.google-services’ not found

    Can you advise on how to fix?

    Also in the project-level build.gradle: it says “dont place application dependencies here. they belong in individual module build.gradle files.

    Many thanks

    • //In the fragment GPlusFragment

      private void updateUI(boolean signedIn) {
      if (signedIn) {
      signInButton.setVisibility(View.GONE);

      //calling my new activity

      Intent signInToMain = new Intent(this.getActivity(),MainActivity.class);
      startActivity(signInToMain);//i can go to sign out button from this activity by…
      //adding a sign out button in MainActivity

      //signOutButton.setVisibility(View.VISIBLE);
      } else {
      mStatusTextView.setText(R.string.signed_out);
      Bitmap icon = BitmapFactory.decodeResource(getContext().getResources(),R.drawable.user_default);
      imgProfilePic.setImageBitmap(ImageHelper.getRoundedCornerBitmap(getContext(),icon, 200, 200, 200, false, false, false, false));
      signInButton.setVisibility(View.VISIBLE);
      signOutButton.setVisibility(View.GONE);
      }
      }

      //in The activity i want to call,i add the following code and a button to log out

      // in my case its called MainActivity

      public class MainActivity extends AppCompatActivity implements GoogleApiClient.OnConnectionFailedListener {
      WebView browser;
      Button myReload,signout;

      private GoogleApiClient mGoogleApiClient;//initialized mGoogleApiClient

      @Override
      protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      browser=(WebView)findViewById(R.id.webkit);
      signout=(Button) findViewById(R.id.sign_out_button);
      browser.loadUrl(“http://elearning.daystar.ac.ke/”);
      browser.getSettings().setJavaScriptEnabled(true);

      myReload= (Button) findViewById(R.id.reload);

      myReload.setOnClickListener(new View.OnClickListener(){
      public void onClick(View v){
      browser.loadUrl(“http://elearning.daystar.ac.ke/”);
      }
      });

      //signout button , it will take you to initial loginActivity
      signout.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
      Auth.GoogleSignInApi.signOut(mGoogleApiClient).setResultCallback(
      new ResultCallback() {
      @Override
      public void onResult(Status status) {
      // …
      Toast.makeText(getApplicationContext(),”Logged Out”, Toast.LENGTH_SHORT).show();
      Intent i=new Intent(getApplicationContext(),LoginActivity.class);
      startActivity(i);
      }
      });
      }
      });

      }

      //add this method
      @Override
      protected void onStart() {
      GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
      .requestEmail()
      .build();
      mGoogleApiClient = new GoogleApiClient.Builder(this)
      .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
      .build();
      mGoogleApiClient.connect();
      super.onStart();
      }

      @Override
      public void onConnectionFailed(ConnectionResult connectionResult) {

      }
      }

  13. Can someone further explain the section about creating a GPlus Fragment? Sorry, I’m a little new to AS and I’m trying to grasp how this is done and what steps are required.

Leave a Reply

Advertisment ad adsense adlogger