Saturday, October 16, 2010

Class 4 -Layouts


Concept: Tips on Layouts within Layouts
Tip: Make one change at a time, then check if it make sense? Does it do what I think it'll do?
Use background colors to check if layouts are acting appropriately with its properties; fill_parent, wrap_content.
The image on the left is two LinearLayouts (each with two buttons) within one LinearLayout (with vertical orientation). Notice Outline setup.


My thoughts on Android vs. iPhone vs Windows platforms:
There's currently three 'new' platforms for smart phone development; the iPhone, Windows, and Android.
  • The iPhone market is popular, but already saturated. As an indie developer, I wouldn't have the manpower to compete against thousands of experienced full time programmers.
  • Windows has a history of failure. There was a rumor that went around class that during the unveiling of the new Windows smart phones, the presenter attempted dialing a number only to have the 'blue screen of death' appear.
  • Google looks promising and has been gaining market share very rapidly, yet the Android Market is not (currently) saturated. It's also Google; you know a company's made it big when the name is being used as a common verb. I'm going to put my money on Android.

Monday, October 11, 2010

Class 3 -Moarrr Android!

Learned to create/navigate across multiple Activities, the Activity lifecycle, how to modify the XML using the GUI, and how to interact with the user.

Multiple Activities - The different 'pages' of the program. Each time a new page appears, its a new activity.

Modifying the XML using the GUI - Simple drag and drop interface.

Activity lifecycle - Need to read the state of the program. For example, if the program is still running while onPause(), the phone's battery will needlessly drain very quickly.

Interesting tidbit, the whole program re-renders itself every time the landscape is changed. We figured this out by setting up a count on our emulator, rotating the screen, and the count returned back to 0.

I like the humor of some of the Android creators. There's a public static int wtf(string, string) function, which stands for "What a Terrible Failure" and is used to report for an exception that should never occur.

Monday, October 4, 2010

Class 2 - Terminal Commands and my first App!

Learned some useful terminal commands, got into the basic GUI layout, created my first app, and uploaded it onto my phone. I'm picking up on concepts much quicker than I thought I would thanks to a very talented professor.

Terminal Commands:
  • android - Opens Android Standard Development Kit (SDK) and Android Virtual Device (AVD) Manager
  • emulator - Run emulator for devices
  • adb - Android Debug Bridge allows debugging, view logs, and shell commands
Flashlight App:
(I improved on the code by calling the screenBrightness function to increase the phone's brightness to max in case it's not. I've been browsing around the reference materials on developer.android.com and through stackoverflow.com; there is so much information/code. I'm just starting to realize the vastness and potential of open source)

package com.demo.android.flashlight;

import android.app.Activity;

import android.graphics.Color;

import android.os.Bundle;

import android.view.View;

import android.view.Window;

import android.view.WindowManager;

public class FlashLightActivity extends Activity {

//Tag testing: private static final String TAG = "Flashlight";

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

View view = new View(this);

view.setBackgroundColor(Color.WHITE);

// Get rid of title bar

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

//New - Added to increase phone's brightness levels to max brightness

WindowManager.LayoutParams lp = getWindow().getAttributes();

lp.screenBrightness = 1;

getWindow().setAttributes(lp);

setContentView(view);

}

}


Tuesday, September 28, 2010

Class 1 - Intro to Android

I finally found the classroom. Taped across the door was a plain white paper sheet with the word "Android" typed in small black font.

The class started at 9:00 am. I glanced at my phone's clock and reminiscent of my college days, I arrived 40 minutes late. Punctuality was never one of my strengths. As I entered the room, I was relieved to see that the class was still in the middle of introductions.

The course itself is a quick introduction to the mobile platform Android, an open source project popularly used in many of today's "smart phones". It attracted the crowd that you would typically expect when you hear terms like 'modified Linux kernels' or 'debugging'. With the exception of a 13 year old programming prodigy, the class was predominately middle aged software engineers working with big technology companies.

One of my concerns with the class is whether I can keep up; I haven't really programmed in years and the course recommended that I know Java. Also as pitiful as it sounds, I'm really hoping to make some new friends! (I feel like I'm in high school again hoping people will like me) I dread working alone, but I'm also really picky about the people that I spend my time with. I'd love to find someone that's on the same wavelength, that I can code with and bounce ideas off of.

Today we setup our programming environments. It's a tedious setup process. We did the following:
  • Download and install the latest Sun Java Release
  • Download and install the Eclipse Integrated Development Environment with the Android Development Tools plugin
  • Download and install Android Software Development Kit (SDK)

Sunday, September 12, 2010

Tuesday, September 7, 2010

Mix CD

Had a fun time making a mixed cd for someone. Here's the song list with some of my comments in italics.

1.) 'Little Boxes' song by Death Cab for Cutie (Intro from Weeds)
I can't believe Malvina Reynolds made this in 1962 and how the social commentary is still (or even more) relevant in 2010. The TV show 'Weeds' did a lot of variations on this song and while there's better covers, I think Death Cab's version really changed the song into their style.

2.) 'Single Ladies' cover by Pomplamoose from their 'Tribute to Famouse People' album
Pomplamoose actually modifies part of the song and sings "Don't make me sing this part of the song, the lyrics are so bad, so I'm gonna skip ahead to the Single Ladies part instead". I like this version more than Beyonce's.

3.) 'My Freeze Ray' by Neil Patrick Harris from the 'Dr. Horrible's Sing-Along Blog' soundtrack
Neil Patrick Harris + Sing Along = Awesome.

4.) 'Home' by Edward Sharpe & The Magnetic Zeroes
Right on fellow hippies! "Home is wherever I'm with you"

5.) 'The World at Large' by Modest Mouse from their 'Good News for People Who Love Bad News' album

6.) 'Marching Bands of Manhattan' by Death Cab for Cutie

7.) 'Californication' by Red Hot Chili Peppers
Thought this was a witty line, "Cobain can you hear the Spears singing station to station"

8.) 'Lawyers, Guns and Money' by Warren Zevon

9.) 'Fake Plastic Trees' by Radiohead

10.) 'Angel' by Jack Johnson
I listened to this song after a bad breakup and it gave me hope. "She gives me presents with her presence alone" I know it may sound a little cheesy, but it sounds more like genuine love.

11.) 'Please, Please, Please Let Me Get What I want' by The Smiths

12.) 'Might Have Ben Hur' by Switchfoot
Used to listen to this song when I had my first crush on a girl back during middle school

13.) 'Streets of Philadelphia' by Bruce Springsteen

14.) 'Heart of Gold' by Neil Young

15.) 'Neon Bible' by Arcade Fire

16.) 'Be Yourself' by Audioslave
Like the message that we could only be ourselves, including our mistakes. Also has rad effects on the guitar.

17.) 'The Authority Song' by Jimmy Eat World
Used to listen to Jimmy Eat World during college and it brought back good memories.

18.) 'I'd Rather Dance with You' by Kings of Convenience

19.) 'Moondance' by Van Morrison
They don't make music like they used to. Probably one of my top songs that I'd love to hear live.

20.) 'I'm Hoping You'll Stay Around' by Flight of the Conchords
Girlfriends from the Past: "He doesn't cook or clean, he's not good boyfriend material...."
Boyfriend: "Oooooh, we can eat cereal"

Friday, September 3, 2010

Heard it somewhere...

Old men speak about what they did, young men speak about what they're currently doing, and foolish men speak about what they're going to do.