Android for Beginners: Coursera

Coursera is one of those absolute gem that I have found indispensible for new android programmers. The courses there are given free of charge by various universities which contribute through making MOOC (Massive Online Open Courses) available to the world so anyone, anywhere, can learn. Coursera really does a wonderful job in making education freely assessible. 

Coursera courses come with video lectures that are dished out on a weekly basis. Watching these videos can take about 1 – 2 hours, depending on the level of proficiency / knowledge you have on the subject. After watching the videos, there are quick quizzes and assignments you can do to test your knowledge. These quizzes and coding assignments which are both graded automatically by the Coursera system. All you need to do is to upload your code onto the site, it grades it for you, and within a few minutes, the system comes back with your marks.

There is also a massive support community on Coursera forums consisting of both students who are doing the course, teaching assistant (TAs) and of course, the lecturer. You can post a question on the forum and within a day, you are almost certain to have your answer. Don’t be scared to ask a question there  – people there are available and willing to help you with your problem and most importantly, people understand where you are coming from as a beginner as they are also in the same boat as you.

I’m currently watching the videos for Programming Cloud Services for Android Handheld System (https://class.coursera.org/mobilecloud-001). Dr Jules White does an excellent job at explaining the basics of HTTP and the communications between the app and the cloud. It is definitely worth a look at.

 

Beginners: How-To Guide for ImageView’s setSelected() method

In this post I will discuss with the setSelected method from the ImageView class. Documentation for this class can be found here: .http://developer.android.com/reference/android/widget/ImageView.html#setSelected(boolean)

In the WordPress android app, we see setSelected method in action as each time you touch the comment button to leave a comment in a post, the comment button turns from blue to orange. If you click on the orange comment button, it becomes blue again. 

This transition from one colour to another is actually completed using a very simple piece of android code. Firstly, we need to gets a references to the imgBtnComment (which is the blue comment button).

final ImageView imgBtnComment = (ImageView) getView().findViewById(R.id.image_comment_btn);

Once you have that, you can use the line below to switch from the blue comment button to orange comment button once an event has occurred, such as a touch on the button, typically detected through the use of a listener. We use the following setSelected method code for the ImageView:

imgBtnComment.setSelected(true);

This will then tell android to use the orange comment button image as we are setting the setSelected to true and so it will look for the associated drawable with the attribute called “state_selected” . See xml for the drawable below:

<?xml version=”1.0″ encoding=”utf-8″?>
<selector xmlns:android=”http://schemas.android.com/apk/res/android”&gt;

<item android:drawable=”@drawable/ic_comment_active” android:state_pressed=”true”/>
<item android:drawable=”@drawable/ic_comment_active” android:state_selected=”true”/>
<item android:drawable=”@drawable/ic_comment”/>

</selector>

From the above, you can see that there are two drawables defined. One is for either “state_pressed” and “state_selected” and the other is the normal blue comment button / the one that is displayed when no one has touched it – therefore it is not “active”.

If you want it the imageView to appear as a blue comment button, you can use the following setSelected code:

imgBtnComment.setSelected(false);

Your comment button should now be blue.

 

Android for Beginners

If you browse the internet for android coding stuff, you will find a ton of documentation written in high-level gobblegobble that sometimes doesn’t make a lot of sense.

That’s probably because android docs and tutorials, for example, even on the authoritative site http://developer.android.com/, are more targeted at seasoned coders and not really for our mild beginners. Sometimes, you just need someone to do some translation for you on some of the methods android offers so that a beginner, like yourself (and myself, to an extent), can understand.

In the last 8 months where I have been learning android myself, I have made a lot of headway in understanding the code. I have also completed a coursera course on Programming Mobile Applications on Android Handheld Systems which ended in April 2014 and passed that with flying colours.

In the next few posts, I want to share my discoveries with the rest of the world and with all you lovely readers 🙂 – on what I have discovered on my Android Adventures. These posts will be written at a basic level so that beginners can gain a basic understanding of the concepts inside the vast system of Android.

Stay tuned for my Beginners: How-To Guide to Android.

 

Open-Sourced Android

Exploring what you can do with android has becoming quite a hobby for me. I love seeing how developers program android apps and how all the classes pull together to generate that polished finish product.

As a tech guru from another blog recently said, to code well you need to first read and understand good code. I think I have taken that to heart and I have been trolling the internet on the beast that is google, constantly on the lookout for open-sourced code.

For all your beginner android programmers / hobbyist and the seasoned android veterans, one indispensible resource to have is http://www.f-droid.org where open-source developers develop their apps and then upload for people to evaluate. There are some great example apps there and a would-be programmer can definitely learn a lot.

A quick flip through the categories of open-sourced apps on f-droid reveals some real gems hiding away in between the mass of apps. There are open-sourced apps for messaging (“Telegram” which bears a striking resemblance to Whatsapp), for internet browsing (“Lightning”) and even blogging (“WordPress”). These apps are professionally developed and feels like something one would actually pay for – thank goodness for open-source!:)

Do you know of any other great open-sourced apps which are great for learning how to code for android? Let us know by leaving a comment below.

Living in a place you plan on leaving

All I need is a suitcase.

Sucks to be Sam

If people divided up their life stories into chapters, all they would need is a suitcase. Skip the narrative and just dig through the contents. Forget the setting and the characters and the scenes. Look at the baggage tags, the corny tourist t-shirts, the souvenirs and the different kinds of sand, dirt and dust that collects in the edges of the suitcase.

You can gather a lot about a person’s life and what they’re about based on the things they jammed in the suitcase to bring back to loved ones and the places they’ve been. But that’s mostly with vacations, semesters abroad or internships in a different city.

Suitcases that plan on making a return home are very different than the ones that don’t. These suitcases are the real chapters in people’s lives. These suitcases are less about where their owner has been and more about where they’re going. Because…

View original post 660 more words

Hot Sweet Eats of the Week: HaHaHa Cupcakes Review

love

180 Tales of Summer

Ha Ha Ha cupcakes is a sweet-tooth having person dream come true. The place of business is adorable and has a relaxing atmosphere for wrapping up your busy day.

The cupcakes are absolutely amazing and there are tons to choose from. My

Ha Ha Ha infamous cupcakes. Ha Ha Ha infamous cupcakes.

favorite would have to be the chocolate cupcake with the oreo-mixed icing on top(found to the left) it was delicious and fresh. However do not expect it to be fluffy like the cupcakes we are used to back in the states. It is a little bit more dense.

If you are looking for a quick, treat in a comfy atmosphere this is the place to go. You can expect to pay 3-en (yen) for one cupcake, they also do parties and have cupcake related items within the store.

Hours: hey are open 7 days a week from 10:00 a.m. until 7:00 p.m.

Phone:

View original post 34 more words