• 18Mar

    One cool feature of Android is that one application can share its features with other applications. But this can be done if it was allowed to share. For example, if your application needs to display a scrolling list of images and another application has developed a suitable scroller and made it available to others, you can call upon that scroller to do the work, rather than develop your own. Your application doesn’t incorporate the code of the other application or link to it; rather, it simply starts up that piece of the other application when the need arises.

    This can only be done if the system is able to start an application process when any part of it is needed by another application. Whenever such a request arise system will instantiate the java object for that part.

    Therefore, unlikely applications on most other systems, Android applications don’t have a single entry point. Such as a main() method, for example. Rather, applications have essential components that the system can instantiate and run as needed. There are four types of components as follows;

    1. Activities

    An activity presents a visual user interface for one focused task the user can undertake. For example it may present some input boxes or menu items where user can work with.

    2. Services

    A service doesn’t have a visual user interface. This type of a component runs in the background for an indefinite period of time. Each service extends the Service base class.

    3. Broadcast Receivers

    A broadcast receiver basically does nothing, but receives and reacts to broadcast announcements. Generally broadcasts originate in the system; for example, announcements that the battery is low, that a picture has been taken or the time zone has changed. Although we can also initiate broadcasts within our application, all receivers extend the BroadcastReceiver base class.

    4. Content Providers

    A content provider makes a specific set of application’s data available to other applications. The data can be stored in the file system, in a SQLite Database or in any other manner that makes sense. The content provider extends the ContentProvider base class. However applications don’t call methods implemented by content providers directly. Instead they use a ContentResolver instant to communicate with any content provider.

    Whenever there’s a request that should be handled by a particular component, Android makes sure that the application process of the component is running or starting it if necessary, and that an appropriate instance of the component is available or creating the instance if necessary.

  • 16Mar

    All the Android Applications are written in Java programming language. One Android package (an application) contains the compiled Java code, data and resources files for that application. The Android package generated by the aapt tool which outputs a .apk file. Once you publish your application, the users will download your application.apk to their mobile device and install it. All the code in a single .apk file is considered to be one application.

    Each Android application lives in its own world.

    • By default, every application runs in its own Linux process. Processes are fully managed by the Android Framework so you don’t have to consider much about it.
    • Each process has its own Java virtual machine (VM), so application code runs in isolation from the codes of all other applications.
    • By default, each application is assigned a unique Linux user ID and permissions are set so that the application’s files are visible only to the application itself. But there are ways where other applications also can use your application files.

    It’s possible to arrange for two applications to share the same user ID, in which case they will be able to see each others’ files. It is also possible to arrange the applications with the same ID to be run in same Linux process, sharing the same VM.

  • 21Jan
    Android Architecture

    Android Architecture

    What is Android?

    First of all Android is not a mobile phone brand. It’s a software stack for mobile devices that includes an operating system, middleware and key applications. The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.

    It’s very easy to handle events on Android SDK. It’s just like you are doing a Java Swing application.

    Features

    • Application framework enabling reuse and replacement of components
    • Dalvik virtual machine optimized for mobile devices
    • Integrated browser based on the open source WebKit engine
    • Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional)
    • SQLite for structured data storage
    • Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)
    • GSM Telephony (hardware dependent)
    • Bluetooth, EDGE, 3G, and WiFi (hardware dependent)
    • Camera, GPS, compass, and accelerometer (hardware dependent)
    • Rich development environment including a device emulator, tools for debugging, memory and performance profiling, and a plugin for the Eclipse IDE

    Applications

    Android will ship with a set of core applications including an email client, SMS program, calendar, maps, browser, contacts, and others. All applications are written using the Java programming language.

    Application Framework

    The open development platform provides the ability for developers to build extremely rich and innovative applications. Developers are free to take advantage of the device hardware, access location information, run background services, and add notifications to the status bar and much more.

    Developers have full access to the same framework APIs used by the core applications. The application architecture is designed to simplify the reuse of components; any application can publish its capabilities and any other application may then make use of those capabilities (subject to security constraints enforced by the framework).

    Libraries

    Android includes a set of C/C++ libraries used by various components of the Android system. These capabilities are exposed to developers through the Android application framework.

    Android Runtime

    Android includes a set of core libraries that provides most of the functionality available in the core libraries of the Java programming language.

    Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so that a device can run multiple VMs efficiently. Dalvik is optimized for minimal memory footprint. The VM is register-based, and runs classes compiled by a Java language compiler that have been transformed into the .dex format by the included “dx” tool.

    The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level memory management.

    Linux Kernel

    Android relies on Linux version 2.6 for core system services such as security, memory management, process management, network stack, and driver model. The kernel also acts as an abstraction layer between the hardware and the rest of the software stack.

Recent Comments