Skip to content

Instantly share code, notes, and snippets.

@nesquena
Last active August 29, 2015 14:06
Show Gist options
  • Save nesquena/67a195af43a981f3827d to your computer and use it in GitHub Desktop.
Save nesquena/67a195af43a981f3827d to your computer and use it in GitHub Desktop.
Android Project 1: Instagram Viewer Feedback Guide

Project 1: Instagram Client Feedback

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 the Activity 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 a TextView.

  • Did you use relative sp / dp for any view units? All units within XML layouts should be relative using sp for font sizes and dp for margin+padding and any other positioning. You should also use wrap_content and match_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 in JsonHttpResponseHandler to handle the failures appropriately.

Bonus

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 the getView() method is called. Imagine that you have a list with hundreds of rows, the findViewById 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment