I’m completely new to Android development and would like to find out if the following is at all possible, and the best way to approach it:
- User logs into Google account – NOT stored on the phone (OAuth??)
- App displays their GMail emails – does not need to send, only receive/read
- App can access their calendar and display events – again read only
That’s all for the Google side of things! I’ve only ever used Facebook auth – so am unsure as to how Google works. I can’t seem to find any definitive answers on the web.
You can register a web application that uses OAuth to log onto google.
https://developers.google.com/accounts/docs/OAuth
then you can use GMail API’s to use the OAuth token to access user’s email
https://developers.google.com/google-apps/gmail/oauth_overview
then for calendar you have the Google Calendar API’s also accessed using OAuth.
https://developers.google.com/google-apps/calendar/
You can create a web app and use your android app to access your web server database via API’s you create. Using this data you provide a nice GUI for your android users and provide user interactions.
Another method would be to use only the android client without a web app as mentioned by Jan Gerlinger.
You can also check out the source code for k-9 mail app for ideas here:
https://github.com/k9mail/k-9
It’s a full-featured, open source android email client that supports many protocols including IMAP, SMTP and Microsoft Exchange accounts too. You can dig through the source code to find out how they do it.