Open tulitv opened 9 years ago
I had couple of short nights. And it is done. As far as checking the boxes goes. But I could work indefinitely on it, until "perfectly" done.
Since next assignment is building on top of this one and extending twitter further, I'd encourage you to do cleanup and do some of the extra polish along with the week 4 project which we will be reviewing tomorrow in session.
Absolutely. One thing which I always miss is to cleanup and restructure the code within the big hurry to finish on time.
Thank you for you comment.
/cc @codepathreview @codepath
:+1: Great work! Good to see you put in the effort to turn in a polished assignment.. A few notes after checking out the code:
SwipeRefreshLayout
for easy timeline refreshesHere'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.
Please review my week 4 assignment.
Here are a few things I would like to comment/ask: 1.) It was a problem during my week 3 assignment, and now continues through week 4 assignment: I cannot set the size of the Dialog Fragment to be reflected on the emulator (it just shows a very narrow dialog). On my phone looks nice. It seems layout sizing works different on Dialog Fragment than Activities. Is this true? Is there something specific I need to pay attention using Dialog Fragments? 2.) I added progress bar following your instructions. I couldn't make it yet seeing anything different. I switched preferred network to be Edge to slow down the data transfer. Maybe I missed something. Can you please let me know if you find something unfinished on my side? 3.) Compose activity crashes on the emulator, when it comes to update the HomeTimeline, then loads back the updated HomeTimeline. It works very nice without any crash on my phone. I was trying out a few ways to let both HomeTimeline and MentionsTimeline know that refresh is needed after Compose submitted. What is a good way to do this? 4.) For data persistency, I decided to limit it to HomeTimeline only. It was a bit tricky because all other timelines (Mentions and User) reuse the same Tweet and User class. So the solution was to pass a boolean value which was indicating to save or not to save to db. 5.) For network check, I applied on 2 situations: a.) just before async http request to be submitted, b.) just before a new activity or fragment is started. What is a good rule of thumb for network check?
/cc @codepathreview @codepath
1.) It was a problem during my week 3 assignment, and now continues through week 4 assignment: I cannot set the size of the Dialog Fragment to be reflected on the emulator (it just shows a very narrow dialog). On my phone looks nice. It seems layout sizing works different on Dialog Fragment than Activities. Is this true? Is there something specific I need to pay attention using Dialog Fragments?
Are you using genymotion emulator? If this is the official emulator, there are known bugs with this issue that I have heard of in the past.
2.) I added progress bar following your instructions. I couldn't make it yet seeing anything different. I switched preferred network to be Edge to slow down the data transfer. Maybe I missed something. Can you please let me know if you find something unfinished on my side?
ActionBar progress bar was recently removed. Now you would need to add the progress bar to your actionbar manually using a custom actionview.
3.) Compose activity crashes on the emulator, when it comes to update the HomeTimeline, then loads back the updated HomeTimeline. It works very nice without any crash on my phone. I was trying out a few ways to let both HomeTimeline and MentionsTimeline know that refresh is needed after Compose submitted. What is a good way to do this?
What is the error that you see when it crashes? Have you tried with genymotion?
4.) For data persistency, I decided to limit it to HomeTimeline only. It was a bit tricky because all other timelines (Mentions and User) reuse the same Tweet and User class. So the solution was to pass a boolean value which was indicating to save or not to save to db.
Yes that's fine for our purposes since it's just a cache.
5.) For network check, I applied on 2 situations: a.) just before async http request to be submitted, b.) just before a new activity or fragment is started. What is a good rule of thumb for network check?
Good rule of thumb is what you've already done. When a network request is about to be sent out to check then.
Are you using genymotion emulator?
No. I had some issue installing it, then gave up to move forward with my tasks. I give it a try to it again, and see if same issues come up.
What is the error that you see when it crashes?
Here is attached the exact error description I see. Errors are very confusing when related to code inside onActivityResult function. /cc @codepathreview @codepath
03-01 22:03:38.703 2175-2175/com.codepath.apps.restclienttemplate E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.codepath.apps.restclienttemplate, PID: 2175 java.lang.RuntimeException: Unable to resume activity {com.codepath.apps.restclienttemplate/com.codepath.apps.simpletwitterclient.TimelineActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=10, result=-1, data=null} to activity {com.codepath.apps.restclienttemplate/com.codepath.apps.simpletwitterclient.TimelineActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.content.Context.getSystemService(java.lang.String)' on a null object reference at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2951) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2982) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365) at android.app.ActivityThread.access$800(ActivityThread.java:144) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5221) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=10, result=-1, data=null} to activity {com.codepath.apps.restclienttemplate/com.codepath.apps.simpletwitterclient.TimelineActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.content.Context.getSystemService(java.lang.String)' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:3539) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2937) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2982) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365) at android.app.ActivityThread.access$800(ActivityThread.java:144) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5221) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.content.Context.getSystemService(java.lang.String)' on a null object reference at com.codepath.apps.simpletwitterclient.Utility.isNetworkAvailable(Utility.java:19) at com.codepath.apps.simpletwitterclient.fragments.HomeTimelineFragment.populateTimeline(HomeTimelineFragment.java:38) at com.codepath.apps.simpletwitterclient.fragments.HomeTimelineFragment.reloadTimeline(HomeTimelineFragment.java:106) at com.codepath.apps.simpletwitterclient.TimelineActivity.onActivityResult(TimelineActivity.java:80) at android.app.Activity.dispatchActivityResult(Activity.java:6135) at android.app.ActivityThread.deliverResults(ActivityThread.java:3535) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2937) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2982) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365) at android.app.ActivityThread.access$800(ActivityThread.java:144) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5221) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
/cc @codepathreview @codepath
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.content.Context.getSystemService(java.lang.String)' on a null object reference
I think this is just an emulator specific issue. Better to use the device or use genymotion
:+1: nice work overall. A few notes after checking out the code:
Here's a detailed Project 4 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 might be able to improve your submission.
This week (Week 5), we are going to cover the last major piece to the Android puzzle and that is using the hardware and SDK components such as the camera, photo gallery, location, maps, etc. After that, Week 6 and week 7 we will be covering a few important intermediate topics such as more about styling and animation as well as testing.
Following the bootcamp, we are going to have a public demo day to celebrate the progress you've all made with our next batch of Android students and multiple companies attending to see the group projects that you all have built. We are going to help however we can over the next few weeks to get the team project apps in shape for that.
Please review my Week3 Assignment.
As a note, the Tweeter API documentation and the actual JSON returned are very much out of sync: 1.) favourites_count vs favorite_count 2.) retweeted always false, but it is embedded into the body as "RT @..." 3.) I got screwed extracting the media as well. Not even part of the home timeline JSON example.
...anyway. I had couple of short nights figuring it out. And it is done. As far as checking the boxes goes. But I could work indefinitely on it, until "perfectly" done.
/cc @codepathreview @codepath