mercredi 14 novembre 2007

Android Hello World


Android on Mac OS


Android is now available for Mac x86 (Intel), not yet for ppc.

Installing SDK

  1. Download the SDK for Mac, unpack the .zip archive to a suitable location on your machine.
  2. On a Mac, edit file .bash_profile in your home directory by adding export PATH=$PATH:{your SDK DIR/tools}. Create .bash_profile if you do not have it yet.

Installing the Eclipse Plugin (ADT)

  1. Download and unzip Eclipse if you don't have one.
  2. Start Eclipse, then select Help > Software Updates > Find and Install. In the dialog that appears, select Search for new features to install and press Next. Press New Remote Site, enter a name for the remote site as "Android Plugin" and enter URL as: https://dl-ssl.google.com/android/eclipse/. Press OK and Finish.
  3. In the Search Results dialog box, select the checkbox for Android Plugin > Eclipse Integration > Android Development Tools and press Next. Select Accept terms of the license agreement. Press Next. and Finish. The ADT plugin is not signed, you can accept the installation anyway by pressing Install All.
  4. Restart Eclipse. Select Eclipse > Preferences... to open the Preferences panel. Select Android from the left panel. For the SDK Location, press Browse... and find the SDK directory. Press Apply and OK

Creating Your First Android Project

  1. Select File > New > Project. Select Android > Android Project, and press Next.
  2. Select Create project from existing source to start a project from existing sample code. Use this option if you want to build and run any of the sample applications included with the SDK. The sample applications are located in the samples/ directory in the SDK.
  3. Browse to the directory containing the existing source code (HelloAdroid) and click OK. If the directory contains a valid Android manifest file, the ADT plugin fills in the package, activity, and application names for you. Press Finish.

Running Your Application

  1. Before you can run and debug your application in Eclipse, you must create a launch configuration for it. Select Run > Open Run Dialog.
  2. In the project type list on the left, right-click Android Application and select New. Enter a name for your configuration. On the Android tab, browse for the project and Activity to start. On the Emulator tab, set the desired screen and network properties. Press Apply to save the launch configuration and press Run

Android - a definition


Android is a software platform for mobile devices that includes an operating system, middleware and key applications supported by Google.
Everybody can develop applications on the Android platform using the Java programming language and Android SDK.

Features

  • Application framework enabling reuse and replacement of components
  • Dalvik virtual machine optimized for mobile devices
  • Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional)
  • SQLite for structured data storage
  • Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)
  • GSM Telephony (hardware dependent)
  • Bluetooth, EDGE, 3G, and WiFi (hardware dependent)
  • Camera, GPS, compass, and accelerometer (hardware dependent)
  • Rich development environment including a device emulator, tools for debugging, memory and performance profiling, and a plugin for the Eclipse IDE

Android includes a set of core libraries that provides most of the functionality available in the core libraries of the Java programming language. Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level memory management. Android relies on Linux version 2.6 for core system services such as security, memory management, process management, network stack, and driver model.

Source: http://code.google.com/android/what-is-android.html