Open jaytolentino opened 10 years ago
So, you have a unique column called remoteId
in your model classes that is never set to any value.
When you save the model object, every time just one record gets saved and replaced since all tweets in your list have the same value for remoteId
and also because of this constraint - onUniqueConflict = Column.ConflictAction.REPLACE
.
The unique column for Tweet
should be tweetId
and the unique column for User
should be uid
.
Also, in FeedsActivity.java
the following line requires that the thread be run on the uiThread.
aTweets.addAll(savedTweets);
So you may want to update your logic around that.
Hope that fixes all the issues. Let me know if you have any questions.
:+1: Overall great work on the assignment. A few notes after checking out the code:
Here's a detailed Feedback Guide 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 me 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.
@nidhi1608 thanks!! that fixed it :cat:
Hi @nidhi1608 and @nesquena :hand: I've completed the first Twitter assignment. I had some trouble with the SQLite story. I was able to save and load tweets; however, I only get back 1 tweet from the database. Below is the ActiveAndroid log messages:
And the result looks like this:
I thought maybe my Tweet.getAll() query was wrong, so I added "LIMIT 20" (see ActiveAndroid queries above), but it seems that while querying the Tweets table, ActiveAndroid generates a query for one user. I'm thinking of looking into it more, but it does sort of work? Haha
Anyway, also planning to fragment out some things from my activities and refactor!
Let me know what you think! :bow: