Passing Data to Sub Activities

Passing data to (Sub)Activities is, once again, not hard to manage. One can use so called Bundles, which are more or less ordinary HashMap's that can take only trivial data types, to carry information from one Activity to another. Just remember where we started our SubActivity in the last chapter * MySecondActivity. * Intent i new Intent( StartingSubactivities.this, MySecondActivity.class) * Send intent to the OS to make * it aware that we want to start * MySecondActivity as a SubActivity. *...

What is Android a GPhone

The weeks and months before Google released the Android SDK there had been a lot of rumors about a so called GPhone. It was said to be a mobile device manufactured by Google providing free communication by showing context-sensitive advertisements to the user on the device itself. Picture 1 Render of a potential GPhone Picture 1 Render of a potential GPhone But on November 5th 2007 Andy Rubin2 announced The Android Platform - is more significant and ambitious than a single Google within the Open...

General

A very simple AndroidManifest.xml looks like this < xml version 1.0 encoding utf-8 > < manifest < application < activity < action > < category > < intent-filter> < activity> < application> < manifest> Almost every AndroidManifest.xml (as well as many other Android XML files) will include the namespace declaration in its first element. This makes a variety of standard Android attributes available in the file, which will be used to supply most of the data for...

Android from above

Let's take a look at what the OHA emphasizes on its Android Platform Openness Android was built from the ground-up to enable developers to create compelling mobile applications that take full advantage of all a handset has to offer. It is built to be truly open. For example, an application could call upon any of the phone's core functionality such as making calls, sending text messages, or using the camera, allowing developers to create richer and more cohesive experiences for users. This is...

Installation done lets do some code

Before we can start coding we obviously have to create a new Android Project. 1. The first thing that needs to be for every Android Application is to create a new Android Project. To do that, simply open the Package Exlporer in Eclipse right-click on some blank space and choose Picture 7 First Android Application - Step 1 Picture 7 First Android Application - Step 1 Picture 8 First Android Application - Step 2 Picture 8 First Android Application - Step 2 3. Fill out the form with values fitting...

Anatomy of an Android Application

There are four building blocks to an Android application Not every application needs to have all four, but your application will be written with some combination of these. Once you have decided what components you need for your application, you should list them in a file called AndroidManifest.xml. This is an XML file where you declare the components of your application and what their capabilities and requirements are. We will discuss soon, what the AndroidManifest.xml is responsible for....

Android User Interfaces

User Interfaces (UI) in Android can be built within two ways, by defining XML-Code or by writing Java-Code. Defining the GUI structure in XML is highly preferable, because as one knows from the Model-Viewer-Control principle that the UI should always be separated from the program-logic. Additionally adapting a program from one screen-resolution to another is a lot easier. Defining a UI in XML is very similar to creating a common HTML-document, where you have i.e. such a simple file Just the...

Starting Sub Activities

An essential thing in the lifetime of an application, that is more sophisticated than a HelloWorld Application, is to start other Activities, especially SubActivitites. Let's assume the following scenario We want to have something like an InputDialog where the user can write a keyword he wants to search on Google for. So we will create a new Android Project as we already did it before. The first thing we will do is to add a second Activity we will name In the beginning the code shall look like...