title: Android: How to call and save userID as a session from SQLite database?
body: <p>In my application, I am trying to figure out how to save userID session and use it until the user closes the app.</p>
  
  <p>I know in PHP you can just use the $_SESSION['userID'] = $user_id</p>
  
  <p>I want to run a query something like this in Android SQLite</p>
  
  <pre><code>SELECT user_id, username, password
  FROM users
  **WHERE user_id = $_SESSION[user_id]**
  </code></pre>
  
  <p>This is from php, is there some way I can do this in android? I heard about shared preferences but I am not sure how it works?</p>
  
  <p>Sorry, I just started learning about Android programming. I am a bit of a noob. I'll appreciate if you could help me out here.</p>
  
  <p><strong>EDIT</strong>: this userID is a column that I will be calling from SQLite database and saving it as a session when the user logs in. </p>