Developing Android Applications Without Eclipse

October 29, 2010

Usually eclipse is the preferred development environment for android, but it is not requirement for development. The ADT plug-in for Eclipse provides a convenient entry point for many of the
underlying development tools for creating, debuggin,packaging,and signing Android applications.

Developers who do not want to use Eclipse or require some of the more powerful debugging features not available in the Eclipse ADT plug-in can access these underlying tools directly from the
command line.

Tools such as the following are found in the/tools directory of the Android SDK:

.android—Creates Android project files and manages AVDs.

. aapt (Android Asset Packaging Tool)—Packages Android project files into .apk files for installation on the emulator and handset.

. ddms (Dalvik Debug Monitor Service)—Has a user interface of its own, which resembles the Eclipse DDMS perspective.

.adb (Android Debug Bridge)—Has a command-line interface for interacting with the emulator and
the device.


Latest ECG-Equipped Smartphone Could Save Lives, Minimize Hospital Visits

October 28, 2010

A new German smartphone is equipped with monitoring a patient’s heart and send information directly to doctors without any hurdle, and in this way decreases risks and reduces health care costs.

Now adays most of the deaths occur due to the heart disease according to a report about 30 percent of deaths across world occur due to heart disease, so in such a situation Patients must
carefully monitor their heart health with frequent visits to the doctor. The most important test for people suffering from cardiovascular disease is the electrocardiogram (ECG), a diagnostic
tool that measures the electrical activity of the heart. Unfortunately for most patients, ECGs are expensive and, since they are taken sporadically, provide only a small snapshot of cardiovascular health.

So to overcome this problem for poor people the new smartphone, called H’andy Sana 201, contains a rapid ECG tool that measures and records heart activity then it sends text messages data directly to patients’ doctors, who can quickly respond to any concerns according to data. The smartphone measures and records the heart’s electrical impulses using three sensors .

Just like a hospital’s ECG test, the H’andy Sana 201 measures the electric pulses sent through the body by the heart. To use, a patient presses his/her fingertips to the phone’s steel frame, which contains three sensors. The phone has calibration barriers to prevent the sensors from picking up movements from the arms and shoulders. It’s also designed to ignore frequencies above the heart’s estimated 150 hertz. The phone’s processor uses algorithms to extract the heart’s rhythm, which the patient can then transmit directly to the doctor.



Facebook’s two cool features news feed and mini feed

October 27, 2010

These two useful features by facebook team are as under:

(1)News Feed

News Feed appears on user’s homepage and highlight’s what’s happening around you on Facebook. It updates a personalized list of news stories time by time, so by this you can know when Usama adds ali to his Favorites. Now, whenever you log in, you’ll get the latest headlines generated by the activity of your friends and social groups.


Mini-Feed,apppears in each person’s profile, is an addition to the profile that shows all the latest stuff someone has added on Facebook.It only facilitates one person.Each person’s Mini-Feed
shows what has changed recently in their profile and what content (notes, photos, etc.) they’ve added.

In other words these two features provide a different way of looking at the news about your friends, but they do not give out any information that wasn’t already visible. Your privacy settings remain the same – the people who couldn’t see your info before still can’t see it now.

Latest Gitube Wireless Camera

October 25, 2010

Now you can control your camera from a far distant place and this can be done by newly introduced Gitube Wireless Camera.

Its ideal for tourists & photographers. The Gigtube gives you live view display and remote control of your camera from a distance, using the latest 2.4G signal transfer technology. The 3.5″ bright color LCD protected by a screen hood, displays great quality pictures even under harsh sunlight conditions.

Components of an Android Application

October 24, 2010

It is very important to understand the components of an android
application because Your Android applications will be built from these four basic component types and these are discussed below:


Activities are pieces of executable code that come and go in time,instantiated by either the user or the operating system and running as long as they are needed. They can interact with the user and request  data or services from otheractivities or services via queries or Intents (discussed in a moment).Most of the executable code you write for Android will execute in the context of an Activity. Activities usually correspond to display screens: each
Activity shows one screen to the user. When it is not actively running, an Activity  can be killed by the operating system to conserve memory.


They are executable pieces of code that usually run in the background from the time of their instantiation until the mobile handset is shut down. They generally don’t expose a user interface.The classic example of a Service is an MP3 player.Your applicationmay need to implement Services to perform background tasks.
Broadcast and Intent Receivers

These respond to requests for service from another application. A
BroadcastReceiver responds to a system-wide announcement of an event. These announcements can come from Android itself (e.g., battery low) or from any program running on the system. An Activity or Service provides other applications with access to its functionality by executing an Intent Receiver, a small piece of
executable codethat responds to requests for data or services from other activities.
The requesting(client) activity issues an Intent, leaving it up to the Android framework to figureout which application should receive and act on it.Intents are one of the key architectural elements in Android that facilitate the creation of new applications from existing applications (mobile mashups). You will use Intents in your application to interact with other applications and services that provide information needed by your application

Content providers

These are created to share data with other activities or services. A
content provideruses a standard interface in the form of a URI to fulfill requests for data from otherapplications that may not even know which content provider they are using. For example, when an application issues a query for Contact data, it addresses thequery to a URI of the form:content://contacts/peopleThe operating system looks to see which applications have registered themselves as content providers for the given URI, and sends the request to the
appropriateapplication (starting the application if it is not already running). If there is morethan one content provider registered for the requested URI, the operating systemasks the user which one he wants to use.

Note: An application doesn’t have to use all of the Android components,
but a well-writtenapplication will make use of the mechanisms provided, rather than
reinventing functionalityor hardcoding references to other applications.


Creating a new Android project

October 20, 2010


Given below is the step by step detailed description of creating a new project in android just open eclipse and follow these steps.


1. Choose File, New, Android Project or click the Android Project creator  icon,

on the Eclipse toolbar.The first time you try to create an Android Project, you might need to choose File,New, Project and then select the Android, Android Project. After you have done this

once, it appears in the Eclipse project types and you can use the method described in Step 1.


2. Choose a project name. In this case, name the project Myactivity.


3. Choose a location for the project. Because this is a new project, select the Create New Project in Workspace radio button. Check the Use Default Location check box.If you prefer to store your project files in another location, simply uncheck the Use Default Location check box and browse to the directory of your choice.

Familiarizing Yourself with Eclipse 11

4. Select a build target for your application. For most applications, you want to select the version of Android most appropriate for the devices used by your target audience and the needs of your application. If you will be using the Google add-ons (for example, Google Maps), be sure to choose the Google APIs version for your target platform. For this example, the Android 2.1 (API

level 7) build target is sufficient.


5. Specify an application name. This name is what users will see. In this case, call the application Droid #1.


6. Specify a package name, following standard package namespace conventions for Java. Because   all code in this book falls under the com.androidbook.* namespace, use the package name com.androidbook.myactivity.


7. Check the Create Activity check box. This will instruct the wizard to create a default launch Activity class for the application. Call your activity Droid Activity.


8. Confirm that the Min SDK Version field is correct. This field will be set to the API level of the build target by default (Android 2.1 is API level 7). If you want to support older versions of the Android SDK, you need to change this field. However, in this case, we can leave it as its default value.


9. Click the Next button.


10. The Android project wizard allows you to create a test project in conjunction with your Android application. For this example, a test project is unnecessary. However, you can always add a test project later by clicking the Android Test Project creator icon, which is to the right of the Android project wizard icon (with the letter a, letter J and letter u: ) on the Eclipse toolbar. Test projects are discussed in detail in Hour 22, “Testing Android Applications.”


11. Click the Finish button.


Note: The Android Project Wizard creates all the required files for an Android application


Android Architecture

October 18, 2010

In order to develop applications in android it is necessary to understand the architecture of android so given below content and image  will help you to understand it’s structure.

Android Architecture


1  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.


2  Application Framework

These frameworks are used to create the applications in Android

By providing an open development platform, Android offers developers the ability to build extremely rich and innovative applications. Developers are free to take advantage of the device hardware, access location information, run background services, set alarms, add notifications to the status bar, and much, much more. Developers have full access to the same framework APIs used by the core applications.


3  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. Some of the core libraries are listed below

System C library – a BSD-derived implementation of the standard C system library (libc), tuned for embedded Linux-based devices

Media Libraries – based on Packet Video’sOpenCORE; the libraries support playback and recording of many popular audio and video formats, as well as static image files, including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG

Surface Manager – manages access to the display subsystem and seamlessly composites 2D and 3D graphic layers from multiple applications

LibWebCore – a modern web browser engine which powers both the Android browser and an embeddable web view

SGL – the underlying 2D graphics engine

3D libraries – an implementation based on OpenGL ES 1.0 APIs; the libraries use either hardware 3D acceleration (where available) or the included, highly optimized 3D software rasterizer

Free Type – bitmap and vector font rendering

SQLite – a powerful and lightweight relational database engine available to all applications



4  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. The Dalvik VM executes files in the Dalvik Executable (.dex) format which 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.


5  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.


The Android Emulator

October 16, 2010

An emulator is a virtual mobile phone or mobile phone in soft form.

In order to develop the applications android provides emulator which in built-in in the android SDK and installed automatically with the SDK and gives the chance to user to develop the applications easily once finished the user can install them on his/her actual physical mobile phone.

It’s technical detail is as under.

The Android emulator accomplishes its work through an open source “processor emulator”
technology called QEMU.
Machine). ARM is a 32-bit microprocessor architecture based on RISC (Reduced Instruction
Set Computer), in which design simplicity and speed is achieved through a reduced number of
instructions in an instruction set.

GPU(Graphic Processing Unit)

October 14, 2010

What is GPU?

GPU is a a single chip processor with integrated transform, lighting, triangle setup/clipping, and rendering engines that is capable of processing a minimum of 10 million polygons per second.”

Purpose of GPU

As computations are increasing day by day and there is allot of load on general purpose CPU , and further if a user does graphic processing then due to huge load the general purpose CPU gets slow down and graphics are also not displayed as per the desire of user so to make independent general purpose CPU from graphic processing and display the graphics in good form this GPU is used hence the load over CPU is decreased and also user have a good graphics which is shown by this picture .

this picture shows that you can get realism by GPU further GPU can effectively process the 3D graphics which is used mostly now adays

Android Activity Life Cycle

October 13, 2010

To develop the applications in android it is very important to understand the activity life cycle of android, basically activity is a runable peice of code to perform the user action, let see at different events of activity life cycle.

Android activity life cycle

Android activity life cyclelets talk about each function/event.



Called when your activity is first created. This is the place you normally create your views, open any persistent datafiles your activity needs to use, and in general initialize your activity. When calling onCreate, the Android framework is passed a Bundle object that contains any activity state saved from when the activity ran before.


Called just before your activity becomes visible on the screen. Once onStart completes, if your activity can become the foreground activity on the screen, control will transfer to onResume. If the activity cannot become the foreground activity for some reason, control transfers to the onStop method.


Called right after onStart if your activity is the foreground activity on the screen. At this point your activity is running and interacting with the user. You are receiving keyboard and touch inputs, and the screen is displaying your user interface. onResume is also called if your activity loses the foreground to another activity, and that activity eventually exits, popping your activity back to the foreground. This is where your activity would start (or resume) doing things that are needed to update the user interface (receiving location updates or running an animation, for example).


Called when Android is just about to resume a different activity, giving that activity the foreground. At this point your activity will no longer have access to the screen, so you should stop doing things that consume battery and CPU cycles unnecessarily. If you are running an animation, no one is going to be able to see it, so you might as well suspend it until you get the screen back. Your activity needs to take advantage of this method to store any state that you will need in case your activity gains the foreground again—and it is not guaranteed that your activity will resume. If the mobile device you are running on runs out of memory, there is no virtual memory on disk to use for expansion, so your activity may have to make way for a system process that needs memory. Once you exit this method, Android may kill your activity at any time without returning control to you.


Called when your activity is no longer visible, either because another activity has taken the foreground or because your activity is being destroyed.


The last chance for your activity to do any processing before it is destroyed. Normally you’d get to this point because the activity is done and the framework called its finish method. But as mentioned earlier, the method might be called because Android has decided it needs the resources your activity is consuming.

It is important to take advantage of these methods to provide the best user experience possible. This is the first place in this book we’ve discussed how programming for mobile devices is different from programming for desktop devices, and there will be many more such places as you go through later chapters. Your users will appreciate it if you write your activities with the activity lifecycle in mind, and you will ultimately benefit.




%d bloggers like this: