Using this demo app, you will learn how to send app data (feedback) to a web spreadsheet (Google Sheets).
- Create a Google Form for receiving feedback
- Import the demo app
- Investigate the spreadsheet to find the input hooks
- Post the user data from app to the spreadsheet using Retrofit
-
Download/Clone this demo app
-
Create a google form with the questions as follows
- Feedback
- Name
- Now click on the "eye" button in your Google Form
When the form preview opens, right click and select ‘view page source’. You can now see the HTML for the page. Use your browser search function (CMD+F) and search for “<form”
(1), this will get you to the html for your form. The action of the form is the url we will be posting to (2). You then need to look for the tags that have an id starting with entry. each one of these is the ID for one of your spreadsheet columns (3/4). This screenshot shows the finding of the second ID
From this we have:
- Spreadsheet url: https://docs.google.com/forms/d/e/1FAIpQLSd9jl6cAH5h8wmwFok8xh-ECLLpXWTqUopgzmNBQM5_xt3VMw/formResponse
- The id of the feedback column: entry.1942285924
- The id of the name column: entry.1133595447
- The id of the email column: entry.414154651
- Now Import the demo app in Android Studio
- Head over to app/java/com/sadiqrazasyed/spreadsheetinput/"SpreadsheetWebService"
- Paste your URL ID, and Entry ID's
- Now run the app & write your feedback, name, email and click on send button
- Your data will be sent to Google form's response section which can be viewed in Spreadhseet
- Happy coding ;)