What you need to do is probably discussed here (for Android Studio, not AI2)
https://developers.google.com/sheets/api/quickstart/android
It might not be possible to have your app's user create a spreadsheet using AI2 (which is intended as a compiler for educational purposes)
With AI2, the spreadsheet needs to already exist to access it, as understand it The User can create a spreadsheet using a PC. They then need to enter their security link in the url you use to talk to the spreadsheet and allow sharing using the spreadsheet dashboard. They could save the link in a TinyDB etc.
Others may have different opinions a more knowledge about the Google API possibilities.
Regards,
Steve