26 Desember 2012

2.Android Basics, Android Project, and Android Structure

Android Basics, Android Project, and Android Structure


Introduction to Android Basics, Android Project, and Android Structure

In this introduction to Android tutorial, we will talk about the basic Android Structure in Eclipse.  We will discuss what the different folders of an Android project are used for, and we will cover all of the Android basics for app development.  This video is pretty slow and boring, so feel free to just skip through the video tutorial, and just read the description.  I think it was like 4 AM when I made this tutorial, my apologies.

Video Walkthrough




Description

In this Android basics tutorial, we will learn about the structure and folder layout of an Android project. We will first start out by creating an Android project within Eclipse, then we will learn about all the folders within an Android project and what their purpose is are.  Lastly, we will put an image (which you can find in the Resources section of this post. Here is a quick run down of what each folder does:
  • The “Base” folder (I called TheBasics) houses your whole android project, resources, code, and everything else. It is the Android structure.
  • The “src” folder holds your package. A package will hold your Android Classes, which is your actual code.
  • The “gen” folder will hold your R.java file which is a way for Android to make references to things like resources. You will never need to make adjustments to this file, Android automatically takes care of this for you.
  • The Android x.x jar will be all of the methods you will need to have access to for developing Android apps, and the version of the jar, will allow you to use different functions as the Android SDK evolves. This jar is the only think that allows us to develop for Android.
  • The “assets” folder will can hold assets, such as images, sounds, etc. We won’t focus on this way of housing resources, but instead focus on doing that within the res folder.
  • The “res” folder, is pretty much like the assets folder, but it helps us organize our different resources, and we will access these resources a little bit differently than we would if we used the ‘assets’ folder.
  • The “drawable” folder will hold all of our images. Hdpi is for high density pixel images, mdpi is medium density pixel, and ldpi is low density pixel images. You can have the same image name (image.png) of different resolutions for each folder, and Android will determine which picture to use according to the resolution of the device that the app is installed on.
  • The “layout” folder will hold the xml layouts or the GUI of an Activity.
  • The “values” folder will hold strings values, such as the Android app name, and other labels used within the app.
  • The “AndroidManifest.xml” will be the ‘boss’ file for our application. If we need our app to access the internet, send a text, access the user photo album, get the gps location, etc, we will have to ask permission within the Android Manifest, and we will also have to define all of our activities within the Manifest so our application know the Android structure.
That should cover the Android basics of the Android Project, and Android Structure. Please check out the next tutorial to learn the Android basics of developing your own apps and selling them on the market.
Please help our site succeed by sharing it with everyone, all social networks, etc..

Outro

Sorry I still have that nasty cold, so please forgive my sniffing noises, my strange nasally voice, and other distractions. Please subscribe and thumbs up the video and you will be a pro in no time.
This video is the 2 in a web series that I am creating to help you learn Android programming so you can create apps and eventually how to learn to write games for android phones. I want to explain things in a way that everyone can understand, even if you have no experience with Java, XML, C, OpenGL, or as a matter of fact, any other programming language. If you do have a lot of experience with programming, these first videos will be really slow for you, but my goal is to get everyone sprinting, but for now we have learn to crawl.

Tidak ada komentar:

Posting Komentar