• No se han encontrado resultados

C ONVERSANDO CON D IOS

In document Las Aventuras Matematicas de Daniel (página 39-45)

In the early releases of Android, documentation was a bit wanting in places. Android source code could be used to fill the gaps.

The details of the Android source distribution are published at

http://source.android.com. The code was made available as open source around October 2008 (read the announcement at

http://source.android.com/posts/opensource). One of the Open Handset Alliance’s goals was to make Android a free and fully customizable mobile platform. The announcement strongly suggests that the Android platform is a fully capable mobile computing platform with no gaps. The open source model allows contributions from public communities.

As indicated, Android is a platform and not just one project. You can see the scope and the number of projects at http://source.android.com/projects.

The source code for Android and all its projects is managed by the Git source code control system. Git (http://git.or.cz/) is an open-source source-control system designed to handle large and small projects with speed and convenience. The Linux kernel and Ruby on Rails projects also rely on Git for version control. The complete list of Android projects in the Git repository appears at http://android.git.kernel.org/. You can download any of these projects using the tools provided by Git and described at the product’s web site. Some of the primary projects include Dalvik, frameworks/base (the android.jar file), the Linux kernel, and a number of external libraries such as Apache HTTP libraries (apache-http). The core Android applications are also hosted here. Some of these core applications include: AlarmClock, Browser, Calculator, Calendar, Camera, Contacts, Email, GoogleSearch, HTML Viewer, IM, Launcher, Mms, Music, PackageInstaller, Phone, Settings, SoundRecorder, Stk, Sync, Updater, and VoiceDialer.

The Android projects also include the Provider projects. Provider projects are like databases in Android that wrap their data into RESTful services. These projects are CalendarProvider, ContactsProvider, DownloadProvider, DrmProvider,

GoogleContactsProvider, GoogleSubscribedFeedsProvider, ImProvider, MediaProvider, SettingsProvider, Subscribed FeedsProvider, and TelephonyProvider.

As a programmer, you will be most interested in the source code that makes up the android.jar file. (If you’d rather download the entire platform and build it yourself, refer to the documentation available at http://source.android.com/download.) You can download the source for this .jar file by typing in the following URL:

http://git.source.android.com/?p=platform/frameworks/base.git;a=snapshot;h=HEAD ;sf=tgz.

This is a general-purpose URL you can use to download Git projects. On Windows, you can unzip this file using pkzip. Although you can download and unzip the source, it might be more convenient to just look at these files online, if you don’t need to debug the source code through your IDE. Git also allows you to do this. For example, you can

browse through android.jar source files by visiting this URL:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=summary. However, you have to do some work after you visit this page. Pick grep from the drop- down list and enter some text in the search box. Click one of the resulting file names to open that source file in your browser. This facility is convenient for a quick look-up of source code.

At times, the file you are looking for might not be in the frameworks/base directory or project. In that case, you need to find the list of projects and search each one step by step. The URL for this list is here: http://android.git.kernel.org/.

You cannot grep across all projects, so you will need to know which project belongs to which facility in Android. For example, the graphics-related libraries in the Skia project are available here:

http://android.git.kernel.org/?p=platform/external/skia.git;a=summary. The SkMatrix.cpp file contains the source code for a transformational matrix, which is useful in animation:

http://android.git.kernel.org/?p=platform/external/skia.git;a=blob;f=src/core/S kMatrix.cpp.

Summary

In this chapter, we wanted to pique your curiosity about Android. You learned that Android programming is done in Java and that the Open Handset Alliance is propelling the Android effort. You saw how handhelds are becoming general-purpose computing devices, and you got an overview of the Dalvik VM, which makes it possible to run a complex framework on a constrained handset.

You also saw how Android’s approach compares to that of Java ME. You explored Android’s software stack and got a taste of its programming concepts, which we’ll cover in subsequent chapters. You saw some sample code and learned where to find and download Android source code.

We hope this chapter has convinced you that you can program productively for the Android platform without hurdles. We welcome you to journey through the rest of the book for an in-depth understanding of the Android SDK.

25

Chapter

In document Las Aventuras Matematicas de Daniel (página 39-45)