First Android project

From D3xt3r01.tk
Revision as of 13:25, 30 May 2010 by Admin (talk | contribs) (→‎HOW)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

WHY

I started documenting the whole process because the last time I started working on my project ... I kinda' lost it ... and since I'm not a java developer or android developer .. I think I need it documented somewhere ..

WHAT

What I'm gonna do is make something show up on the screen. I won't be using the emulator ( or show the steps to use/create AVDs .. ) because my computer is just to slow for the emulator ..

HOW

File -> New -> Android Project .

Give the project a name, I named it "Hello World" .

Check the box that best describes the phone/android version you'll be working on .. Since I got a G1 running CyanogenMod 5 ( Android Eclair 2.1 ) I'll be checking the Android 2.1-update 1 box.

I also recommend _NOT_ using the default project location since when you'll back up or want to format ... you'll forget about it ( just like I did ... but then again .. I'm no regular Android/Java developer ).

Application Name "Hello World".

Package Name "tk.d3xt3r01" . It's usually something like a directory ... "com.google.blablabl" spelled from the other end, since I own d3xt3r01.tk -> tk.d3xt3r01

It would also be nice to specify a min API version so you don't get warnings when running the project.

Create Activity: "helloworld" and click Finish.

You should now have a working project. If you click run, you should see it showing up on your phone !

The string "Hello World, helloworld!" is defined in res/values/strings.xml , so is the app_name. You'll soon see that the actual design of the page the text shows up in is in res/layout/main.xml .

Edit "AndroidManifest.xml" and add 'android:debuggable="true"' to the <application> tag to be sure it starts on your phone. On the phone do this: MENU, select Applications > Development, then enable USB debugging.

Step 1, done...

Links

Developing on a Device