This is the feedback guide for Project 1 - Instagram Client.
-
Did you name your Java activity semantically? Your Java Activity should have a name like
PhotosActivity
with theActivity
suffix. -
Did you name your XML Layout file properly? Your XML Layout should have a name such as
activity_photos.xml
that matches the name of your Java class. -
Did you properly name your views? Every view in your layout XML file should have a proper id that semantically describes the purpose AND have a prefix indicating the view type. For example, the text field where you show the caption might be called
tvCaption
.tv
indicates this is aTextView
. -
Did you use relative sp / dp for any view units? All units within XML layouts should be relative using
sp
for font sizes anddp
for margin+padding and any other positioning. You should also usewrap_content
andmatch_parent
for width/height whenever possible. Check out this stackoverflow answer for more detail about these units. Avoid ever using px or pt in Android apps. -
Did you properly apply relative placement rules in a RelativeLayout? Learning RelativeLayout rules is one of the most important parts of learning about Android views. Switch to the XML view for your activity layout and notice the rules that are applied to position your views. Read more about this in our RelativeLayout Cliffnotes.
-
Did you use string resources for your text? In Android, you should always use string resources for your text rather than hardcoding string values in your layout files. See our using string resources for more details.
-
Did you properly handle exceptions? When making network requests, its very important to handle error cases and take appropriate actions when the network request fails. For this reason, it is always advisable to override the
onFailure
method inJsonHttpResponseHandler
to handle the failures appropriately.
In addition, consider the following bonus (optional) feedback:
-
Could you improve the UX? In all of these assignments, there are key places where you have the opportunity to improve the UI and UX of these projects. For example, it would be nice if you thought about updating the image to be displayed with the same proportions as on Instagram.
-
Could you improve the UI? Learning to improve UI is one of the most important aspect of learning about Android. It would be nice if you added proper margins, padding for your views. You may also notice the difference by formatting the text in your app. These details are technically not as challenging, but adds a lot of polish to your finished app.
-
Did you make use of the ViewHolder pattern to improve performance? ViewHolder is a pattern used for avoiding the calling of
findViewById
every time thegetView()
method is called. Imagine that you have a list with hundreds of rows, thefindViewById
will be called hundreds of times and it’s not necessary, just bad for performance. So to increase the performance try to use the ViewHolder pattern as much as possible. -
Did you implement pull-to-refresh for popular stream? Pull-to-refresh allows a user to refresh a list by pulling down and releasing from the top of the list. It makes it easier for users to load recently added items to the stream. Using SwipeRefreshLayout is the easiest and most efficient way to achieve this.