ipince / codepath

Repo to hold codepath bootcamp code.
0 stars 0 forks source link

[Android Bootcamp] Review TwitterClient #4

Open ipince opened 10 years ago

ipince commented 10 years ago

Hey,

Here's the twitter client... was holding off on submission to finish persistence, but I keep hitting a foreign key constraint violation problem. So, submitting now.

/cc @nesquena

nesquena commented 10 years ago

I keep hitting a foreign key constraint violation problem. So, submitting now.

Happy to help you debug that issue, should definitely get it working. I will review this for the time being. Thanks!

ipince commented 10 years ago

I added what I have so far on the "persistence-layer" branch.

ipince commented 10 years ago

Seems like sometimes, when I call user.save(), the id returned is -1 (maybe it failed to save?). After that, calling tweet.save() makes it crash, reasonably.

nesquena commented 10 years ago

:+1: nice work overall. A few notes after checking out the code:

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, Models, Authentication, API Communication, Preferences, ActionBar, et al) and see how they all fit together. We are close to a turning point in the course where you should be hitting a "critical mass" for your Android knowledge.

nesquena commented 10 years ago

Seems like sometimes, when I call user.save(), the id returned is -1 (maybe it failed to save?). After that, calling tweet.save() makes it crash, reasonably.

If you were to simply skip saving the tweet if the user didn't save (just to test) does it run fine otherwise?

ipince commented 10 years ago

Yes.. I'm now skipping tweet.save() if user.save() returns -1.

Also, when loading from db, sometimes the tweet comes back with a null User. So I'm also skipping tweets that have a null User when I populate the list view in TweetAdapter.

With those two changes, the app runs with no errors. It works offline too, but it ends up having a bunch of "empty" items in the list view corresponding to the failed tweets.

nesquena commented 10 years ago

With those two changes, the app runs with no errors. It works offline too, but it ends up having a bunch of "empty" items in the list view corresponding to the failed tweets.

Curious what could be causing the users save to fail...seems kind of odd. Maybe I can help you debug this more if you can't get it working.

ipince commented 10 years ago

I've been kinda stuck for a while now, so I'll let it rest. Maybe you can take a look tomorrow if I can't get it to work by then.

Thanks!