
Android App Development For Dummies
Beschreibung
Weitere Details
Weitere Ausgaben
Person
Inhalt
Chapter 1
Developing Spectacular Android Applications
In This Chapter
Seeing reasons to develop Android apps
Starting with the basics of Android development
Working with the hardware
Getting familiar with the software
Google rocks! Google acquired the Android platform in 2005 (see the sidebar "The roots of Android," later in this chapter) to ensure that a mobile operating system (OS) can be created and maintained in an open platform. Google continues to pump time and resources into the Android project. Though devices have been available only since October 2008, over a billion Android devices have now been activated, and more than a million more are being added daily. In only a few years, Android has already made a huge impact.
It has never been easier for Android developers to make money by developing apps. Android users trust Google, and because your app resides in the Google Play Store, many users will be willing to trust your app, too.
Why Develop for Android?
The real question is, "Why not develop for Android?" If you want your app to be available to millions of users worldwide or if you want to publish apps as soon as you finish writing and testing them or if you like developing on an open platform, you have your answer. But in case you're still undecided, continue reading.
Market share
As a developer, you have an opportunity to develop apps for a booming market. The number of Android devices in use is greater than the number of devices on all other mobile operating systems combined. The Google Play Store puts your app directly and easily into a user's hands. Users don't have to search the Internet to find an app to install - they can simply go to the preinstalled Google Play Store on their devices and have access to all your apps. Because the Google Play Store comes preinstalled on most Android devices (see Chapter 19 for some exceptions), users typically search the Google Play Store for all their application needs. It isn't unusual to see an app's number of downloads soar in only a few days.
Time to market
Because of all the application programming interfaces (APIs) packed into Android, you can easily develop full-featured applications in a relatively short time frame. After you register as a developer at the Google Play Store, simply upload your apps and publish them. Unlike other mobile marketplaces, the Google Play Store has no app approval process. All you have to do is write apps and publish them.
Though anyone can publish almost any type of app, maintain your good karma - and your compliance with the Google terms of service - by producing family-friendly apps. Android has a diverse set of users from all over the world and of all ages.
Open platform
The Android operating system is an open platform: Any hardware manufacturer or provider can make or sell Android devices. As you can imagine, the openness of Android has allowed it to gain market share quickly. Feel free to dig into the Android source code to see how it works, by visiting . By using open source code, manufacturers can create custom user interfaces (UIs) and even add new features to certain devices.https://source.android.com
Device compatibility
Android can run on devices of many different screen sizes and resolutions, including watches, phones, tablets, televisions, and more. Android comes supplied with tools to help you develop applications that support multiple types of devices. If your app requires a front-facing camera, for example, only devices with front-facing cameras can "see" your app in the Google Play Store - an arrangement known as feature detection. (For more information on publishing your apps to the Google Play Store, see Chapter 8.)
The roots of Android
Though most people aren't aware of it, Google didn't start the Android project. The first version of the Android operating system was created by Android, Inc., a small start-up company in Silicon Valley that was purchased by Google in August 2005. The founders (who worked for various Internet technology companies, such as Danger, Wildfire Communications, T-Mobile, and WebTV) became part of the Google team that helped create what is now the full-fledged Android mobile operating system.
Mashup capability
A mashup combines two or more services to create an application. You can create a mashup by using the camera and the Android location services, for example, to take a photo with the exact location displayed on the image. Or you can use the Map API with the Contacts list to show all contacts on a map. You can easily make apps by combining services or libraries in countless new and exciting ways. A few other types of mashups that can help your brain juices start pumping out ideas include the following:
- Geolocation and social networking: Suppose that you want to write an app that tweets a user's current location every ten minutes throughout the day. Using the Android location services and a third-party Twitter API (such as iTwitter), you can do it easily.
- Geolocation and gaming: Location-based gaming, which is increasingly popular, is a helpful way to inject players into the thick of a game. A game might run a background service to check a player's current location and compare it with other players' locations in the same area. If a second player is within a specified distance, the first one could be notified to challenge her to a battle. All this is possible because of GPS technology on a strong platform such as Android. If you're interested in developing games for Android, check out
for more information about Google Play Games services.https://developers.google.com/games/services/ - Contacts and Internet: With all the useful APIs at your disposal, you can easily make full-featured apps by combining the functionality of two or more APIs. You can combine the Internet and names from the Contacts list to create a greeting-card app, for example. Or you may simply want to add an easy way for users to contact you from an app or enable them to send your app to their friends. (See "Google APIs," later in this chapter, for more information on the APIs.)
Developers can make Android do almost anything they want, so use your best judgment when creating and publishing apps for mass consumption. Just because you want live wallpaper to highlight your version of the hula in your birthday suit doesn't mean that anyone else wants to see it.
Android Development Basics
Thank goodness you don't have to be a member of Mensa to develop Android applications! Developing in Android is simple because its default language is Java. Though writing Android applications is fairly easy, writing code in general is no easy feat.
If you've never developed applications before, this book may not be the best place to start. Pick up a copy of Beginning Programming with Java For Dummies, by Barry Burd (John Wiley & Sons, Inc.) to learn the ropes. After you have a basic understanding of Java under your belt, you should be ready to tackle this book.
Although the Android operating system consists primarily of Java code, some of the framework isn't written in Java. Android apps use small amounts of XML in addition to Java. You need to cement your basic understanding of XML before delving into this book.
If you need an introduction to XML, check out XML For Dummies, by Lucinda Dykes and Ed Tittel (John Wiley & Sons, Inc.).
If you already know how to use Java and XML, then congratulations - you're ahead of the curve.
Java: Your Android programming language
Android applications are written in Java - not the full-blown version of Java that's familiar to developers using Java Platform, Enterprise Edition (JEE), but a subset of the Java libraries that are most useful on Android. This smaller subset of Java excludes classes that aren't suitable for mobile devices. If you have experience in Java, you should feel right at home developing apps in Android.
Even with a Java reference book on hand, you can always search at or www.google.com to find information about topics you don't understand. Because Java isn't a new language, you can find plenty of examples on the web that demonstrate how to do virtually anything.www.stackoverflow.com
Not every class that's available to Java programmers is also available on Android. Verify that it's available to you before you start trying to use it. If it's not, an alternative is probably bundled with Android that can work for your needs.
Activities
An Android application can consist of one or more activities. An activity serves as a container for both the user interface and the code that runs it. You can think of activities as pages of your app - one page in your app...
Systemvoraussetzungen
Dateiformat: ePUB
Kopierschutz: Adobe-DRM (Digital Rights Management)
Systemvoraussetzungen:
- Computer (Windows; MacOS X; Linux): Installieren Sie bereits vor dem Download die kostenlose Software Adobe Digital Editions (siehe E-Book Hilfe).
- Tablet/Smartphone (Android; iOS): Installieren Sie bereits vor dem Download die kostenlose App Adobe Digital Editions oder die App PocketBook (siehe E-Book Hilfe).
- E-Book-Reader: Bookeen, Kobo, Pocketbook, Sony, Tolino u.v.a.m. (nicht Kindle)
Das Dateiformat ePUB ist sehr gut für Romane und Sachbücher geeignet – also für „fließenden” Text ohne komplexes Layout. Bei E-Readern oder Smartphones passt sich der Zeilen- und Seitenumbruch automatisch den kleinen Displays an.
Mit Adobe-DRM wird hier ein „harter” Kopierschutz verwendet. Wenn die notwendigen Voraussetzungen nicht vorliegen, können Sie das E-Book leider nicht öffnen. Daher müssen Sie bereits vor dem Download Ihre Lese-Hardware vorbereiten.
Bitte beachten Sie: Wir empfehlen Ihnen unbedingt nach Installation der Lese-Software diese mit Ihrer persönlichen Adobe-ID zu autorisieren!
Weitere Informationen finden Sie in unserer E-Book Hilfe.