Trying to Learn Android (Part 1)

So apparently, I got really lucky last semester, and got into a lab at Lawrence Berkeley National Laboratory that is making a mobile application that tracks a driver’s driving pattern and then recommends the most energy efficient electric vehicle for them. And to be perfectly honest, I got here with virtually no experience in programming except for CS61A and half a semester of CS61B. So here I am, a person who took her first CS class less than 8 months ago that is barely proficient in how to use a terminal and text editor, and now I have the job of making an Android App. They wanted me to do iOS first, but to be honest, the thought of trying to learn objective C made me want to cry out of stress. Except now, I kind of regret not joining iOS because I don’t have an android phone, but it’s alright, I love java.

Lucky for me, Bucky at theNewBoston has some pretty cool tutorials and I’m forever grateful, because I’ve learned a lot so far. Today, I got through a tutorial about adding widgets to a layout.

Adding Widgets to a Layout

Learning Grid Layout Tutorial

I know posting this on my blog will probably end my aspirations to become a designer, but I just want to clarify, I made these for practicing the Grid Layout in his tutorial, and It’s totally just for fun. I paid no attention to what anything looked like from a designer’s point of view. I also think I’ll resort to Bohemian Sketch and Illustrator for mockups in the future because they are much more user friendly. (Refer to my design portfolio @ behance.net/ziqiziqiziqi for actual work)

Event Handling

2 Steps

  1. Event Listener, make button wait for something to happen.
  2. After click occurs, make something happen, or a callback method.
Before and After Clicking the Button!
Code Behind it with Event Listener and Callback Method

Multiple Event Listeners and Buttons

Added Reset Button, Click function and Click and Hold Function
Source Code for Multiple Event Listeners and CallBack Methods

Gestures

Gesture is a special type of touch event. Includes scrolling (finger on screen tap down and drag), fling(fast scroll, fling up and release finger like turning a page), double tap(new interface, entirely different interface).

In this tutorial, we built an app that changes the text to reflect what kind of gesture was done. there’s too many screens to show, so I’m not gonna post them, but here’s the source code. Bucky also assigned a homework assignment to make a button that gets tapped and a scrolling gesture on the side that changes the text, so I will implement that next time.

Okay, all in all, this was a productive day, I got through quite a few tutorials, and my macbook is just about out of battery, so I will continue with more tomorrow, including Bucky’s homework Assignment. Until then, stay tuned! XOXO Ziqi