Mark Murphy - Beginning Android

Здесь есть возможность читать онлайн «Mark Murphy - Beginning Android» весь текст электронной книги совершенно бесплатно (целиком полную версию без сокращений). В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Город: New York, Год выпуска: 2009, ISBN: 2009, Издательство: Apress, Жанр: Программирование, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

Beginning Android: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Beginning Android»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

Master Android from first principles and begin the journey toward your own successful Android applications!
Dear Reader,
First, welcome to the world of Android! We’re entering a new era of mobile application development, one marked by open platforms and open source, to take ‘walled gardens’ and make them green houses for any and all to participate in. Android is relatively easy for developers, and I believe that this innovation will help generate a large ecosystem of developers and consumers within a very short time. This means that budding developers such as yourself will have many opportunities to design and build your own applications and you’ll have a huge and hungry customer base.
Second, welcome to the book! Its purpose is to start you on your way with building Android applications, and to help you master the learning curve. Android is already a rich framework, comparable in many ways to the richness Android of desktop Java environments. This means that there is a lot of cool stuff for you to pick up along your journey in order to create the slickest, most useful apps Android you can imagine.
The source code for the code samples in this book is all available from the Apress site, so you can stay as hands-on and practical as you like while I introduce you to the core of Android, and invite you to experiment with the various classes and APIs we’ll be looking at. By the time you’ve finished this book, you’ll be creating your own Android applications and asking yourself what your next great application will be…!
Enjoy! Mark Murphy

Beginning Android — читать онлайн бесплатно полную книгу (весь текст) целиком

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Beginning Android», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Enter AsyncTask.

AsyncTaskmanages a work queue with a thread pool, so you do not need to implement that yourself. Moreover, all of the communication between foreground and background threads are handled for you. All you need to do is override a few methods to describe what you want done in the background or in the foreground.

To create an AsyncTask, simply extend one anonymously, like you might do to create a Runnable. You can then override whatever methods you need to for the pattern you want:

• Override onPreExecute()to specify something that should be done on the UI thread when the task is started

• Override doInBackground()to indicate the work that should be done in the background thread

• Override onProgressUpdate()to update your progress on the UI thread when doInBackground()calls publishProgress()(e.g., update a ProgressBar)

• Override onPostExecute()to do whatever work needs to be done on the UI thread after the background work is complete

Using your custom AsyncTaskis then a matter of calling execute()on one of its instances, such as one might call run()on a Runnable.

Now, the Rest of the Story

Of course, there are many, many more things added to Android 1.5 beyond what is covered earlier. Here is a quick recap of other capabilities you will be able to take advantage of in Android 1.5.

Speech Recognition

Android 1.1 debuted Google Voice Search, where you could tap on a microphone icon text to the search field on the home screen, speak your search request, and have the search conducted on what you said.

Android 1.5 opens this up to be available to all applications. You can start an activity using an Intent using the RecognizerIntent.ACTION_RECOGNIZE_SPEECHaction and have the converted text supplied to you in response via onActivityResult().

IntentService

A common pattern, particularly when using AlarmManagerfor scheduling periodic background work, is to have a service that implements onStart()and forks a background thread to do the desired work. This runs the risk of forking too many threads, though, and managing your own work queue and thread pool can be annoying.

The IntentServiceclass wraps that pattern up for you. All you do is implement onHandleIntent(), and Android will process all inbound Intents via a work queue on a background thread. Android will also automatically stop the service when the work queue becomes empty, to help minimize the memory footprint of your application.

Audio Playback Options

The SoundPoolclass, largely undocumented in Android 1.1, is now ready for widespread use in Android 1.5. The SoundPoolis designed to play back multiple overlapping sounds, particularly useful for games. Moreover, you can specify priorities for these audio streams and a maximum number of streams, so your application can simply play back clips as needed (e.g., based on game events), and Android will ensure the maximum number of streams is not exceeded. That way, you can minimize the amount of CPU power audio playback requires.

Android 1.5 also offers AudioTrack, whereby the device can play back audio that your code converts, perhaps from a streaming source, into PCM data. So, for example, should you want to implement a Voice-Over-IP (VOIP) application, you might use AudioTrackto handle playback of the audio coming off of, say, the SIP connection.

Android 1.5 also introduces the JetPlayer, designed to play back JET interactive music filesJET interactive music files.

Media Recording

Android 1.1 offered a MediaRecorderclass, but it would only record audio. Now, with Android 1.5, you can record video as well. You control the frame rate and size, along with the encoding (e.g., H.264) and output format (e.g., MP4). Android will then, on demand, record video off of the device’s camera to a file you specify.

Примечания

1

http://www.icon-king.com/?p=15

2

http://code.google.com/android/index.html

3

http://www.apress.com/book/view/1430224193

4

http://www.apache.org/licenses/LICENSE-2.0.html

5

http://ant.apache.org/

6

http://commonsware.com/Android/

7

http://code.google.com/android/reference/packages.html

8

http://droiddraw.org/

9

http://windowssdk.msdn.microsoft.com/en-us/library/ms752059.aspx

10

http://www.adobe.com/products/flex/

11

http://www.mozilla.org/projects/xul/

12

http://www.zkoss.org/

13

http://www.onjava.com/pub/a/onjava/2002/09/18/relativelayout.html

14

http://www.ascendercorp.com/oha.html

15

http://moorstation.org/typoasis/designers/klein07/text01/handmade.htm

16

http://en.wikipedia.org/wiki/Nuvola

17

http://www.xmlpull.org/v1/doc/api/org/xmlpull/v1/package-summary.html

18

http://en.wikipedia.org/wiki/ISO_639-1

19

http://code.google.com/android/devel/resources-i18n.html#AlternateResources

20

http://www.sqlite.org

21

http://www.amazon.com/Definitive-Guide-SQLite/dp/1590596730

22

http://www.sqlite.org/different.html

23

https://addons.mozilla.org/en-US/firefox/addon/5817

24

http://www.sqlite.org/cvstrac/wiki?p=SqliteTools

25

http://www.sqlite.org

26

http://beanshell.org

27

http://beanshell.org/developer.html

28

http://hc.apache.org/

29

http://commonsware.com/Android/

30

http://openid.net/

31

http://oauth.net/

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Beginning Android»

Представляем Вашему вниманию похожие книги на «Beginning Android» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «Beginning Android»

Обсуждение, отзывы о книге «Beginning Android» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x