title: Checking if the user is logged in every Activity and Fragment onCreate callback?
body: <p>I was advised to do, in each Activity and Fragment <code>onCreate</code> callback, an <code>if(signed_user_id == null) { showErrorPopIn(); startSplashScreenActivity(); return; }</code> (a check that the user is not logged in, in which case we display an error and redirect the user from the Android app to the splash screen, and we don't execute the rest of the Activity and Fragment code). This code would be used in all activities (except SplashScreen of course) and in all Fragments, in the <code>onCreate</code> method. Cf. another SO question (<a href="https://stackoverflow.com/questions/53519544/check-if-user-is-logged-in-on-every-activity-or-only-at-the-beginning">Check if user is logged in on every activity, or only at the beginning?</a>).</p>
  
  <p><strong>But I find it makes the code a lot heavier, and it seems to be useless.</strong> Indeed:</p>
  
  <ul>
  <li><p>A hacker can change the activity code and the fragment code and therefore remove this condition, right?</p></li>
  <li><p>And most importantly: checking that the user is logged in is only useful on the server side, not on the Android app side. Indeed, the critical points are the read and write accesses to the databases. But I don't give a damn if the not-connected user can see the graphical part of a Fragment or an Activity if this part doesn't display anything from a database or doesn't allow any modification in a database after a click on a button for example. Right?
  So in the end I can remove all those <code>if(signed_user_id == null)</code> conditions I've put in all my Fragments and Activities?</p></li>
  </ul>
  
  <p><strong>PS 1 :</strong> <code>signed_user_id</code> is just <code>FirebaseAuth::getInstance().getUser().getUId()</code> roughly.</p>
  
  <p><strong>PS 2 :</strong> if I'm right, it means the first answer of the above linked SO question should be edited to indicate to the original poster that it's useless to do these checks in Android app side.</p>