title: How to send data from an android application (client) to a python flask (backend) remote server
body: <p>First of all bear with me as I'm new to both android applications and python flask.</p>
  
  <p>I found sample code (java) on the web, which sends json data from an android application to a php web page (<a href="http://hmkcode.com/android-send-json-data-to-server/" rel="nofollow noreferrer">http://hmkcode.com/android-send-json-data-to-server/</a>). What I want to do is to use this sample android code to send the data to a remote VPS server and use python flask as backend to receive and save the data .</p>
  
  <p>As far as I understand the first thing that I have to replace is the php-address <a href="http://hmkcode.appspot.com/jsonservlet" rel="nofollow noreferrer">http://hmkcode.appspot.com/jsonservlet</a> with my server's IP address (99.99.999.99) in the java code,</p>
  
  <pre><code>    switch(view.getId()){
          case R.id.btnPost:
              if(!validate())
                  Toast.makeText(getBaseContext(), "Enter some data!", Toast.LENGTH_LONG).show();
                  // call AsynTask to perform network operation on separate thread
                  //new HttpAsyncTask().execute("http://hmkcode.appspot.com/jsonservlet");
                  new HttpAsyncTask().execute(99.99.999.99);
          break;
      }
  </code></pre>
  
  <p>Then I have to add the python flask code which will receive the data. </p>
  
  <p>Concerning flask I found the following code which might apply to my issue,
  <a href="https://github.com/javierchavez/Android-with-flask-backend/blob/master/Backend/wsgi.py" rel="nofollow noreferrer">https://github.com/javierchavez/Android-with-flask-backend/blob/master/Backend/wsgi.py</a>.</p>
  
  <p>Thus my questions are :</p>
  
  <p><strong>1st</strong> Is it correct to only replace the php-address with my VPS IP address, or do I also have to add the path to the flask file in my remote's server home directory.</p>
  
  <p><strong>2nd</strong> what would be the actual flask code, which will receive the data from the application and save it to the remote server (as far as I understand the python flask file will be saved in the VPS's home directory)</p>
  
  <p><strong>3rd</strong> do I also have to take into consideration the password required to access my VPS remote server when modifying the android and flask code?</p>
  
  <p>Thank you in advance</p>