Professional Documents
Culture Documents
Lab - 1
Android powers hundreds of millions of mobile devices in more than 190 countries around
the world. It's the largest installed base of any mobile platform and growing fast—every
day another million user’s power up their Android devices for the first time and start
looking for apps, games, and other digital content. Android gives you a world -class
platform for creating apps and games for Android users everywhere, as well as an open
marketplace for distributing to them instantly
For example, you can create a single app binary that's optimized for both phone and tablet
form factors. You declare your UI in lightweight sets of XML resources, one set for parts of
the UI that are common to all form factors and other sets for optimizations specific to
phones or tablets. At runtime, Android applies the correct resource sets based on its screen
size, density, locale, and so on.
To help you develop efficiently, the Android Developer Tools offer a full Java IDE with
advanced features for developing, debugging, and packaging Android apps. Using the IDE,
you can develop on any available Android device or create virtual devices that emulate
any hardware configuration.
As an open marketplace, Google Play puts you in control of how you sell your products.
You can publish whenever you want, as often as you want, and to the customers you want.
You can distribute broadly to all markets and devices or focus on specific segments,
devices, or ranges of hardware capabilities.
You can monetize in the way that works best for your
business—priced or free, with in-app products or
subscriptions—for highest engagement and revenues. You also
have complete control of the pricing for your apps and in-app
products and can set or change prices in any supported
currency at any time.
Get Started
Everything you need to start developing apps for Android is
available here on developer.android.com. You'll find everything
from the developer SDK, API documentation, and design guidelines, to information about the
current device landscape and how you can distribute and monetize your app.
No two apps are built in the same way, but we've structured the information you need to build an
app into the following three sections that represent the general order for app devel opment.
3. Distribute
Now your app is complete. You've built it to support a variety of screen sizes and densities, and
tested it on the Android emulator and on real devices. You're ready to ship your app.
How you proceed depends on a variety of factors, such as your monetization strategy and which
types of devices your app supports.
2. Develop
Once your design is finalized, all you need are the tools to turn your app ideas into reality.
Android's framework provides you the APIs to build apps that take full advantage of device
hardware, connected accessory devices, the Internet, software features, and more. With the
power of Android, there's no limit to the power of your apps.
3. Distribute
Now your app is complete. You've built it to support a variety of screen sizes and densities, and
tested it on the Android emulator and on real devices. You're ready to ship your app.
How you proceed depends on a variety of factors, such as your monetization strategy and which
types of devices your app supports.
Android Architecture
Linux kernel
Libraries
Android Runtime
This is the third section of the architecture and available on the second layer from the bottom.
This section provides a key component called Dalvik Virtual Machine which is a kind of Java
Virtual Machine specially designed and optimized for Android. The Dalvik VM makes use of
Linux core features like memory management and multi-threading, which is intrinsic in the Java
language. The Android runtime also provides a set of core libraries which enable Android
application developers to write Android applications using standard Java programming
language.
Application Framework
The Application Framework layer provides many higher-level services to applications in the form
of Java classes. Application developers are allowed to make use of these services in their
applications.
Application
You will find all the Android application at the top layer. You will write your application to be
installed on this layer only. Examples of such applications are Contacts Books, Browser, and
Games etc.
System Requirements
Operating Systems
Eclipse IDE
Note: Eclipse 3.6 (Helios) is no longer supported with the latest version of ADT.
Note: Some Linux distributions may include JDK 1.4 or Gnu Compiler for Java, both of which
are not supported for Android development.
That's it! The IDE is already loaded with the Android Developer Tools plugin and the SDK is
ready to go. To start developing, read Building Your First App.
Caution: Do not move any of the files or directories from the adt-bundle-<os_platform>
directory. If you move the eclipse or sdk directory, ADT will not be able to locate the SDK and
you'll need to manually update the ADT preferences.
Additional information
As you continue developing apps, you may need to install additional versions of Android for the
emulator and other packages such as the library for Google Play In -app Billing. To install more
packages, use the SDK Manager.
Everything you need to develop Android apps is on this web site, including design guidelines,
developer training, API reference, and information about how you can distribute your app. For
additional resources about developing and distributing your app, see the Developer Support
Resources.
You should have already downloaded the Android SDK Tools. (If you downloaded the ADT
Bundle, you should instead read Setting Up the ADT Bundle.)
The SDK Tools package is not the complete SDK environment. It includes only the core SDK
tools, which you can use to download the rest of the SDK packages (such as the latest system
image).
Your download package is an executable file that starts an installer. The installer checks your
machine for required tools, such as the proper Java SE Development Kit (JDK) and installs it if
necessary. The installer then saves the Android SDK Tools into a default location (or you can
specify the location).
If you're using a different IDE, start the SDK Manager and read Adding Platforms and Packages.
https://dl-ssl.google.com/android/eclipse/
4. Click OK.
If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of
"https" (https is preferred for security reasons).
5. In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
6. In the next window, you'll see a list of the tools to be downloaded. Click Next.
7. Read and accept the license agreements, then click Finish.
If you get a security warning saying that the authenticity or validity of the software can't be
established, click OK.
8. When the installation completes, restart Eclipse.
Once Eclipse restarts, you must specify the location of your Android SDK directory:
1. In the "Welcome to Android Development" window that appears, select Use existing SDKs.
2. Browse and select the location of the Android SDK directory you recently downloaded and
unpacked.
3. Click Next.
Your Eclipse IDE is now set up to develop Android apps, but you need to add the latest SDK
platform tools and an Android platform to your environment. To get these packages for your
SDK, continue to Adding Platforms and Packages.
The Android SDK separates tools, platforms, and other componen ts into packages you can
download using the Android SDK Manager. The original SDK package you've downloaded
includes only the SDK Tools. To develop an Android app, you also need to download at least one
Android platform and the latest SDK Platform-tools.
If you've used the Windows installer to install the SDK tools, you should already have the
Android SDK Manager open. Otherwise, you can launch the Android SDK Manager in one of
the following ways:
• On Windows, double-click the SDK Manager.exe file at the root of the Android SDK
directory.
• On Mac or Linux, open a terminal and navigate to the tools/ directory in the Android SDK,
then execute android sdk.
2. The SDK Manager shows all the SDK packages available for you to add to your Android SDK.
As a minimum configuration for your SDK, we recommend you install the following:
o The latest Tools packages (check the Tools folder).
o The latest version of Android (check the first Android folder).
o The Android Support Library (open the Extras folder and check Android Support
Library).
o Once you've chosen your packages, click Install. The Android SDK Manager installs
the selected packages into your Android SDK environment.
Creating Android Virtual Devices (AVDs) for Use in the Android Emulator
The Android emulator, included in the Android SDK, allows you to run Android apps in a simulated
environment on your computer rather than on an actual Android device. Before running an app
in the emulator, you must create an Android Virtual Device (AVD) which defines the characteristics
of the device on which you want to test, including the screen size in pixels, the pixel density, the
physical size of the screen, size of the SD card for data storage and more.
1. Open Eclipse.
2. Select Window > AVD Manager to display the Android Virtual Device Manager window
3. Click New to display the
Create new Android Virtual
Device (AVD) window, then
configure the options as shown
and click Create AVD. These
settings simulate the primary
Android phone that we used for
testing—the original Samsung
Nexus S, which was running
Android 2.3.3 at the time of this
writing. Each AVD you create has
many other options specified in
its config.ini. You can modify this
file as described at.
Emulator
Tasks (15 marks)