December 2013 | Arrogance Gizmo

Getting Started with Android

Friday, 6 December 2013


This is our first Tutorial on Android Programming
Ø  In this tutorial I am going to explain “How to Get Started With Android”
Dont you need some knowledge about Android?
As you think (beginners), Android is an Operating System.  Android is an Open Source Operating System based on Linux Kernal.  Android is developed primarily for touchscreen mobile devices such as smartphones and tablet computers . Android is the world’s most  widely used mobile platform.

Let’s Begin without much Intro

First you need to set up development environment.
What all things you need
  1.     Java Development Kit JDK (no need of netbeans) Link
  2.     Install the ADT plugin for Eclipse (if you’ll use the Eclipse IDE). Link
  3.     Download the latest SDK tools and platforms using the SDK Manager.


Now You Need to Familier with some Terms
  1. 1.   SDK - The Android SDK provides you the API libraries and developer tools necessary to build, test, and debug apps for Android.
  2.     AVD - An Android Virtual Device (AVD) is an emulator configuration that lets you model an actual device by defining hardware and software options to be emulated by the Android Emulator.
  3.     Application Name is the name of application that appears to users. Let it be "First App."
  4.     Project Name is the name of your project directory and the name visible in Eclipse.
  5.     Package Name is the package namespace for your app (following the same rules as packages in the Java programming language). Your package name must be unique across all packages installed on the Android system. For this reason, it's generally best if you use a name that begins with the reverse domain name of your organization or publisher entity.
  6.     Minimum Required SDK is the lowest version of Android that your app supports, indicated using the API level. To support as many devices as possible, you should set this to the lowest version available that allows your app to provide its core feature set.
  7.     Target SDK indicates the highest version of Android (also using the API level) with which you have tested with your application.
  8.    Compile With is the platform version against which you will compile your app. By default, this is set to the latest version of Android available in your SDK.


  Get you Hands Dirty


I assume that you have installed all the Preqs mentioned above, and unzipped Android ADT+SDK+Eclipse

Follow the steps

1.   Open Eclipse IDE from where you unzipped it.
2.   File->New->Android Project
Getting-Started-With-Android-image1

                          
3.   Application Name - First App, Package Name - blog.arrogancetutorials.firstapp (see image 1)
4.   Next
5.   Next
6.   If you want to change icon, do it here -> Next
7.   Check ‘Create Activity’, select Blank Activity-> Next
8.   No change -> Finish

Now your Hello World App is ready, this is auto generated by the Eclipse.


Important Folders in an Android Project



1.   SRC – Where the source files are placed.
2.   Res -> Layout – Where the Layouts(What We See) are placed.
Getting-Started-With-Android-image2



Explore this folders, you can see
“MainActivity.java” inside SRC ->Package (marked 2 in Image).
 “activity_main.xml” inside Res -> Layout (marked 3 in image).

Image explanation (should remember this in coming tutorials too)

  1.    AVD Mentioned above
  2.    SRC Mentioned above
  3.    Layout Mentioned above
  4.   Palette -> You will get the necessary GUI controls from here.
  5.   Workspace -> You are designing in this space, your app will look like what you see here
  6.   Graphical Layout -> It is selected in the image as default, that is why you are able to see the GUI of the layout
  7.    Activity_main.xml -> This is the XML file of the GUI layout
  8.    Run button -> hit this button after development  to run you app *
  9.   Structure -> You can see all elements present in the Layout and you can elect it from here.
  10.        Properties ->Here you can change properties of all the controls in layout.




*You have to setup AVD to run the app.

Talking About “First App”


Open “activity_main.xml”
Click on ‘TextView’ in Structure, you can see the properties of the textView now. The text view is displaying “Hello World”. In properties window ->Text you can change the text displayed by the TextView (It is not the right way)

Now our application is ready to Run, before Running you need to setup AVD

Continue to Getting Started with Android Part 2

Setting up Android Virtual Device


Setting up Android Virtual Device



For running an Android application on PC you need an Android Emulator on PC, this is called as Android Virtual Device. You need to setup a Virtual Device According to your specification. Follow this tutorial to setup a Android Virtual Device.
Android-Settingup-AVD-Tutorial-Image1


Open Android Virtual Device Manager(AVD) from Eclipse(marked 1 in image1) or from Folder.

Android-settingup-AVD-image2

 Let me say something about the image



  1.            New Button – For creating new Virtual Device
  2.           Device Name – Name for the Vitual Device
  3.        Device – Here the screen Size and Resolution is specified (You can see come   popular devices in this combobox and you can select them)
  4.           Target – Android Version of your Device
  5.      Keyboard, Skin – Specifies whether Hardware Keyboard is present in your device,  Skin specifies whether your device comes with hardware controls
  6.    Back camera – For developing camera based application you can emulate camera   using web cams.
  7.     Memory Options – Specifies the RAM, Internal Storage, SD Card (I hope You are familier with this terms)

 Follow this steps to Set Up Android Virtual Device


  1. 1.     Open Android Virtual Device Manager(AVD) from Eclipse(marked 1 in image1) or  from Folder.
  2. 2.     Click New
  3. 3.     Give a Name for your Android Virtual Device
  4. 4.    Select your device
  5. 5.    Select the Target of your Virtual Device (If you dont find yor version, download it using SDK manager)
  6. 6.    Provide the Desired Memory options
  7. 7.    Click OK
  8. 8.     Click Start (Below to New marked 1)
  9. 9.     It may take some time to boot up your Virtual Device
   Hope your Virtual Device is Ready to Use.
   I also hope that you application in the Previous Tutorial is Ready.
   Lets Run our new Application,
    See The portion Marked 8 in the image1, click on the black Downward arrow.
    You can See  ‘Run Configurations’
    Clicking on it, a window opens

Android-settingup-AVD-image3



  1. 1.     Select New Configuration
  2. 2.    From Browse Select Your Application “FirstApp”.
  3. 3.    Click Targret

Android-settingup-AVD-image4


See the Marked Portions


  1. 1.    Lunch all Compatable Devices /AVD (Selecting this option it will automatically picks up compatable AVD/Device). You can use your Android phone connected to PC with Enabled USB debugging the Option for Phone is ‘Device’
  2. 2.    Or you can select an AVD you created from here.
  3. 3.    Click RUN
  4. 4.    Your  Application will be installed in the AVD soon. (hope the AVD is still open).


       Are you happy watching your First Android Application Runs?
   
       Hope you all had a good time, see you in the next tutorial.

Copyright @ 2013 Arrogance Gizmo |

Follow Us On Facebook

Labels

.Net (2) 1 KM Range Wireless (1) 16x2 Character LCD (9) 2 UART (1) 4x3 Keypad (1) 4x4 keypad (1) 8051 (5) 8051 Project (2) 8051 Projects (1) 8051 Tutorial (3) 89C51 (4) 89C51 Project (2) 89S51 (1) 89S52 (1) Additional UART (1) Android (3) Android AVD (1) Android Programming Tutorial (1) Android Tutorial (2) Arduino Board (1) ARM Projects (1) Atiny (1) Atmega8 (1) AVR (5) AVR Projects (1) Build From Scratch (1) C# (1) C# Serial Port (2) C# serial Terminal (1) C# Voltmeter (1) Camera (1) Clock (1) Digital Voltmeter (2) Digital watch (1) DIY (2) EEPROM (2) Electronic code lock (1) Embedded (16) Embedded Project (9) Embedded Projects (2) Embedded Tutorial (12) Embeded (4) Extra UART (1) Flutter (1) Getting Started With Android (2) Home Security (1) Internet Based Device Control (1) Java of Things (1) Keypad (1) Keypad Tutorial (1) LCD (6) LCD Tutorial (4) Linux (1) Lock (1) LPG Sensor (1) MAX232 (3) Microcontroller (14) Microcontroller generates sound (1) Microcontroller Interrupt (1) Microcontroller Project (5) Microcontroller Tutorial (11) Microcontroller Tutorial. 8051 Tutorial (1) Mikoc 4 Bit LCD (3) MikroC (14) MikroC AVR (3) MikroC AVR Tutorial (3) MikroC EEPROM (2) MikroC for 8051 (4) MikroC Getting Started (1) MikroC PIC Tutorial (6) MikroC Tutorial (3) Motor Control (1) NETMF (1) New Embedded Boards (2) Optical Mouse (1) Optical Mouse To Camera (1) Password Lock (1) PC Based Voltmeter (1) PIC (7) PIC Based Electronic Lock (1) PIC 12F629 (1) PIC ADC (2) pic interrupt (1) PIC Music (1) pic project (1) PIC Projects (1) PIC sound melody (1) PIC Tutorial (3) PIC UART (1) PIC Voltmeter (2) Project (8) Quadcopter (1) Real Time Monitoring (1) RF (1) Robotic Projects (1) RS 232 (1) Run Android On PC (1) Security System (1) Serial Communication (3) Single Bord Computer (1) Smart home (1) Smart Home Project (1) STM32 (4) STM32F4 (3) STM32F4 Discovery (3) STM32F4 Project (1) STM32F4 Tutorials (3) STMicroelectronics (1) Temperature Sensor (2) Timer (1) Tutorial (8) UART (6) Udoo (1) USB (1) USB to RS 232 (1) USB to UART (1) VISUAL STUDIO (1) Water Level Control (1) WiFi (1)

Search This Blog

Popular Posts