Using Google Spread sheet as DataBase Part -2 | Posting ( Insert ) data into sheets from Android App.

We have seen about fetching data from Google spread sheet in Part 1. Here I am going to explain about Posting data into Google Sheets from your android device.


Here It Consists of 2 Parts

  1. Creating app script (Google Script) that inserts data into Spread Sheet and publishing it as web app.
  2. Using the url send Http Post request and pass the parameter from Android App.                                                    Download Source Code

1. Creating App Script

Note : create your own script or you can use the script I have published.


Step 1 :  Go to App script console and create new project in app script .

Step 2 : Insert the below Code which inserts data to Spread sheet.


Step 3 : Now Publish (Deploy) it as web App with Access to anyone.

Step 4 : Copy the link and save it for further use in Step


you can use post man tool to verify doGet and doPost activities.


2.  Android Part

Note : Since I am enhancing previous project. You can refer previous part before reading further.

and I have renamed and main.xml files. Everything else remains same.


Step 1 : Create form.xml to take inputs from user.


Step 2 : Create class to handle input and post it into server using deployed web app. Thats it with the requirement.


But to give UI to select Inserion and View I am adding one more xml and class


Step 3 : Create main_page.xml to add 2 buttons to choose.


Step 4 : Create to handle buttons. Use Intent objects to Navigate to respective activities.


Step 5 : Then Modify in manifest file as below by including newly added Classes and change Launching Activity.


Final output :


Download Source Code