Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBen Jakuben
Treehouse TeacherForum Contest: Android Animations
EDIT: This contest has ended! Congratulations to Liam Peters for the winning entry! Our next contest on creating a Compass extension is up!
Hey Android developers! I'm excited to bring you another Android Forum Contest!
This week's challenge is fun: use any kind of animation to cycle through a small set of quotes:
After you've watched the video, please read the details below carefully. We're looking forward to your entries!
Contests Rules:
This contest is pretty open ended. The main objective is to loop through the set of quotes (download quotes as a string array), animating each onto the screen. Your animations can be simple and elegant, fun and creative, or over the top and crazy. It's totally up to you! Create your app as a native app; i.e. the app must be installable on Android devices (web apps are not permitted).
Help:
Here is a Forum post with a few examples of some simple animations: Android Animations. For more help, check out the developer documentation (with sample code).
How to Enter:
Post a link as an answer to this post. It can be a link to downloadable project files or a GitHub repo. If you want to submit a link to an app on Google Play (you're encouraged to publish your entries!), then also provide a link to the source code. Source code is required for this contest.
Due Date:
All entries must be submitted by August 3rd at 11:59pm ET. Here's a timezone chart so you can see what time that is for your locale.
Prize:
The entries will be judged by Treehouse teachers based on both design and code. One winner will receive a free month of Treehouse Pro (formerly called "Gold") on us! We'll announce the winner on August 4th and reveal the next contest.
19 Answers
J T
10,091 PointsOnly 1 month?
Alexandre Juca
Courses Plus Student 3,222 PointsHi Ratik Sharma, I gather that we can use any version of android. He mentioned the rules above already. There are no constraints on the Android version you use,
Nicholas Olsen
Front End Web Development Techdegree Student 19,342 Points"Collaboration is more important than competition"—I love that!
This contest is not in my area of expertise but I would love to collaborate on a contest project with someone in the future! :D
Ben Jakuben
Treehouse TeacherIt's such a great way to learn and produce. Hopefully we can offer more structured tools for collaboration in the future.
Joannie Huang
6,195 PointsIt sounds very interesting contest! I will try it!
Shane Desouza
3,523 PointsSounds like a good contest! I think I might try it!
Alexandre Juca
Courses Plus Student 3,222 Points Anyone want to collaborate? Would be great!
Joannie Huang
6,195 PointsI would love to! :)
Shane Desouza
3,523 PointsSame! I would be interested in a collaboration!
Liam Peters
8,792 PointsI take it the use of third part libraries is a no-no? Specifically Android View Animations, which is a pretty nifty library!
Ben Jakuben
Treehouse TeacherAnything that makes your job easier counts positively to your rating. :) I am a huge proponent of using open source and 3rd party libraries whenever it helps. I plan on covering more here by the end of the year.
The goal with a 3rd party library should be to use them well, not just as a grab bag of tools. Good luck!
Liam Peters
8,792 PointsFirst thrown together attempt (YouTube Video). In the spirits of collaboration, any thoughts? I'll obviously polish it a bit before submitting source etc. It's a bit similar to the example video at the minute I think!
Ben Jakuben
Treehouse TeacherThat is so fantastic. I love these contests because it's so inspiring to see what everyone comes up with.
Rachit Agarwal
6,235 PointsAwesometacular! That's actually really cool, especially with the color transitions and smooth animations. Is it on GitHub?
Alexandre Juca
Courses Plus Student 3,222 Pointsany collabs please email me: corextechnologies@gmail.com, would be nice to work some of you guys and possibly become friends! Thanks to TreeHouse. Due dates coming.
Shane Desouza
3,523 PointsAnyone want to collaborate on this project? Email me: shanedesouza657@gmail.com. Thanks!
Ratik Sharma
32,885 PointsHi! Quick question for the people participating: is there a way one can infinitely loop through the quotes? I'm currently using a button to switch the text and I want to avoid it. Any help is appreciated!
Liam Peters
8,792 PointsI Guess you'd use a timer. Timers in Java (and subsequently Android) have a method called "scheduleAtFixedRate"
class MyTimerTask extends TimerTask
{
public void run()
{
//Here you would increment a counter.
//Then check that your counter isn't larger than
//the number of quotes. If it is, reset it to 0
//Then change your quote based on what value
//your counter holds!
}
}
TimerTask task = new MyTimerTask();
timer.scheduleAtFixedRate(task, delay, period);
Without obviously doing it for you (as this is a competition :P) this should set you off in a workable direction! Google the method name if you need help using it!
Edit: Also, please bear in mind that the times above are in milliseconds! (1000 milliseconds is 1 second)!
Ratik Sharma
32,885 PointsLiam Peters, thanks! That's actually more than what I needed :p
Liam Peters
8,792 PointsHere's my entry. Github Repo. It's not the finest thing I've ever done. Runs as intended on the android L preview (I only did styles for v21). It will compile for older versions if you change the build.gradle file). Not had a great deal of time to add much polish.
Good luck everyone! Remember, it's not the winning that matters. It's about getting the creative and problem solving juices flowing!
Leonardo Vidal
14,603 PointsHi , here's my entry ForumChallengeApp
Good luck to all!
Ratik Sharma
32,885 PointsHere's my entry: entry! I could have done so much more if I had time but I'm fairly proud of what I'm submitting. Cheers!
Note: The project contains a DreamService so anyone trying the app should give it a go!
Kurt Kandora
5,312 PointsI did something, all the animation in a random mode, sometimes looks good, depends on luck... github I don't like very much how it looks, but was a nice thing to try. Good luck to all!
Ben Jakuben
Treehouse TeacherWow, this was really tough! As usual, I am so impressed by your work. Thanks for participating!
After a bit of debate, I've decided to crown Liam Peters as our champion this week. Congratulations, Liam! Liam's submission (video has a really sharp, simple design with animations that focus on key words in each quote. It's delightful! His code is really solid, too. Some highlights:
- Elegant and simple Material design example
- Themed ActionBar, which is encouraged for Material Design
- Animation used for emphasis
- Neat info dialog about the current fragment. It's a good practice to extend DialogFragment like he did,
- Great color transition on swipes instead of a simple instant change
- Good use of SpannableStringBuilder to emphasize key words
- Good use of the powerful AndroidViewAnimations library
One negative is that you must swipe through the quotes, whereas the objective of the contest was to automatically loop through them. Simple enough to change. :)
I also want to commend Ratik Sharma as a really close runner up. Ratik's code is superb and his design was solid. Ratik won the previous contest, but I didn't want that to count against him! Because it was so close, I am going to follow-up with our community manager about getting you some sort of consolation prize, Ratik. :)
Some highlights of Ratik's submission:
- Great use of Daydream and immersive modes
- Has a settings Settings screen with custom slide in and out transitions. It also extends PreferencesActivity, which is a good practice.
- Uses onPause() and onResume() to manage the lifecycle
- Another good use of the powerful AndroidViewAnimations library
- It does currently have a bug: I get an ArrayOutOfBoundsException at this line:
mQuotesTextView.setText(quotes[counter]);
. Easily fixable! - Good color choice in the design
I'd highly recommend checking out the code of all these submissions to see some good practices and examples. Thanks again for participating, and stay tuned for this week's contest, which should be announced shortly!
Liam Peters
8,792 PointsThis is quite a shock. I personally thought Ratik Sharma's was better than mine. Especially loved the use of immersion mode and daydream. Would love to see this cycle through my twitter feed or something! Look forward to the next Android forum contest!! :)
Alexandre Juca
Courses Plus Student 3,222 PointsGreat job Liam, Ratik and everyone who participated. Unfortuntaley I could'nt participate because of health issues. Great seeing the creativity you guys put into this! Can't wait for the next one!
Ratik Sharma
32,885 PointsHaha, I actually thought Liam Peters would win and he did! Congrats, mate! And thanks, Ben Jakuben for the mention! I seriously appreciate it!
See you in the contest, guys!
Ben Jakuben
Treehouse TeacherBen Jakuben
Treehouse TeacherYes, that's our standard prize for Forum contests.