Open smacgregor opened 8 years ago
:+1: nice work. A few notes after checking out the code:
Tweet
and User
. See the persistence guide and this other guide for more details.Here's a detailed Project 3 Feedback Guide here which covers the most common issues with this submitted project. Read through the feedback guide point-by-point to determine how you could improve your submission.
Let us know if you have any other thoughts or questions about this assignment. Hopefully by now you feel pretty comfortable with all the major pieces to basic Android apps (Views, Controllers, ActionBar, Navigation, Models, Authentication, API Communication, Persistence, et al) and see how they all fit together. We are close now to a turning point in the course where you should be hitting a "critical mass" towards your knowledge of Android.
Consider including a check to see if internet is available to detect any network failures. Show an appropriate message in case of failure.
That was actually in there :).
Also here's a screen cap of offline support powered by ActiveAndroid. You can see that media was cached using Glide as well so many of the tweets have their media intact as well.
https://github.com/smacgregor/SimpleTwitterClient/tree/active_android
My app is complete, please review. /cc @codepathreview @codepath
Another fun project. I was butting my head for a while trying to get the relationships set up correctly using ActiveAndroid. It was particularly challenging because of the model class hierarchies GSON is generating on my behalf. I almost got ActiveAndroid working well when offline - so close but not in time for the 10pm deadline. The work can be found here and I plan on wrapping that up tomorrow.
Interesting Notes
This got a little verbose on the activity side as every method call but I liked how it allowed the activity to deal with Tweet and User objects and not worry about whether those objects are coming from the server or from the database. Does that pattern look ok to you?
Open Questions
For ActiveAndroid - I had to write some pretty squirrely (maybe even smelly?) code to get the many to one relationships working given the GSON generated model classes. In the following example an Entities model contains an array of media associated with a tweet.
When saving a tweet I have a cascading save method which calls Entities.cascadeSave. In order to get the relationships set correctly - I saved the current entities object first. Then to set up the many to one relationship - enumerated over all the tweet media objects - setting the current entitites object on each tweet media model then saving the media object in the media table.
From the if I had more time department