Archive for category Android

Android Tutorial (8) – How to add a menu, programmatic vs. declarative solution

How to add an Android menuAndroid mobile applications have the advantage of being deployed on mobile devices that have touch displays. This enhance the user experience and allows developers to design the user interface so it will be dynamic, easy to use and efficient. Despite this advantage, the display size and usability concepts (one golden rule is to have all the window controls visible on the display) limit the number of buttons and visual controls that can be placed on a single window/form. So, application wide options and functions can be made available using a menu, leaving the display for particular and contextual options.

A menu is a group of options (items) that are accessed using the device Menu key. The menu items are represented by single options or by groups of options, which are organized in submenus.

In this article, we will see how to add a menu to the Android application. The solution is implemented using both the programmatic and the declarative solution that uses menu.xml files. For the declarative solution we will use also the Android visual editor for menus.

Read the rest of this entry »

,

9 Comments

Android Tutorial (7) – How to debug the Android mobile application with LogCat

In computer science and especially in programming, things can go wrong easily. Even simple things, that you have done it before, can generate runtime exceptions that crash the application. Most of the time, the reason is the inability to think to all aspects every time you do something. And because this will not happen, the programmer best friend is the debugger.

In this article we will see how to debug the Android mobile application using the Android LogCat. Despite this Android SDK tool, the application can be debugged in Eclipse like any other Java application (i.e using breakpoints).

Read the rest of this entry »

,

3 Comments

Android Tutorial (6) – How to create and display a new form, window or activity

In this post we will see what are the basics for developing an Android mobile application that has multiple windows or activities. To do that, we need to know how to create and display a new form, window or activity (for the rest of the post we will use the Android vocabulary and call it just activity).

We have seen in the previous parts of the Android Tutorial which are the fundamentals of an Android application and its components. Also we have seen that behind a window there is an Activity type instance that has a lifecycle and a display.

Read the rest of this entry »

,

11 Comments

Android Tutorial (5) – How to create a new Activity class with the Manifest editor or without it

Behind any window or form in the Android mobile application there is an Activity instance. In order to develop a mobile application with multiple windows you must create, for each display, a new class that extends Activity class.

In this post we will see how to create a new Activity programmatically or using the Manifest WYSIWYG graphical editor that comes with the Android ADT Plugin for Eclipse.

Read the rest of this entry »

,

7 Comments

Android Tutorial (4) – Procedural vs. Declarative Design of User Interfaces

Android mobile applications are relying on user interfaces composed on dialog windows, visual controls, 2D graphics and other multimedia elements for efficiency and usability. The Android platforms allows programmers to use two methods to design user interfaces: procedural or declarative.

In this post we develop a simple Android mobile applications that will help to make an analysis on procedural vs. declarative design of user interfaces.

Procedural means to use only Java code to design the user interface. This is something usual in designing Swing interfaces on JSE platform or designing user interfaces in J2ME MIDlets. Because every element of the user interface is managed by different classes instance, designing means to create them and to manage them.

Declarative means to use a descriptive markup language, as XHTML or XML, to describe the user interface. This is similar to how simple HTML pages are done. The designer describes the page look and the browser interprets and generates the user interface.

Read the rest of this entry »

,

3 Comments

Android Tutorial – Overview and contents

android tutorialThe Android tutorial covers all important concepts that will allow a new programmer to learn how to develop mobile applications for the Android platform. The tutorial is written  from a programmer perspective and dives after few topics into simple and do-by-example applications which are easy to follow. Despite the apparently simplicity, each topic highlights important aspect of the Android platform and synthetize aspects described in detail on the developer.android.com portal.

Topics posted until now:

Read the rest of this entry »

,

10 Comments

Android Tutorial (3) – How to create, run and read your first application, Hello World

In this article we will see how to use the Eclipse IDE and the ADT (Android Development Toolkit) Plugin for Eclipse to create a very simple Android mobile application, the classic Hello World !. Despite its simplicity, the application just prints a message on the screen, its is very important to understand it, because its structure represents the core for any other Android mobile application.

Other topics highlighted in this article will help you to:

  • create an Android mobile application project using Eclipse and ADT (Android Development Toolkit) Plugin;
  • run the mobile application using different mobile Android emulators;
  • understand and read the structure of the Android project.

Read the rest of this entry »

,

3 Comments

Android Tutorial (2) – Applications key concepts, activities and resources

In order to understand the Android application architecture you need some basic knowledge regarding Android applications key concepts. Understanding these elements will allow you to control:

  • application components
  • application lifecycle
  • application resources

In this post are described all these key concepts  in order to highlight their role, utility and importance. Other posts will describe in more detail how are used in order to develop an Android mobile application.

The main characteristics of an Android application (more detailed information on developer.android.com) are:
Read the rest of this entry »

,

7 Comments

Android Tutorial (01) – Setting the development environment

Android is an open source software toolkit created by Google and Open Handset Alliance. Initially developed for mobile phones, it has become a major application platform for a wide range of mobile devices.

The scope of this post is to summarize the steps needed to set the development environment and to start learning and developing Android applications.

Read the rest of this entry »

,

6 Comments

How to Consume Web Services from Android Applications Using kSOAP2

Android API does not provide support for Web services. Thus, Web services are consumed using a third-party libraries. One example is kSOAP2 (http://ksoap2.sourceforge.net/), optimized for Android.
Read the rest of this entry »

,

13 Comments