Raja-Android Developer

I’ve been a professional Android developer for 7 years now, and the projects I’ve been involved in have ranged from simple applications to complex applications used by thousands of users every day. Most of the applications that I’ve worked on are still in use today, by companies, organizations and individuals. Whenever I’ve worked in a team with other engineers, I’ve always been one of the people that have worked the hardest, and who were responsible for making sure that the applications actually worked. That led me to help and collaborate with other people, so I got to learn various technologies.

My favorite is Android App development, I’ve researched a lot of sites that enable freelancers to find work recently I heard about Toptal. I really like freelance work, because of you will get opportunity to work on different projects so you learn a lot of new things (Latest api’s from sdk). I like Toptal for their screening process you have to pass their own phone and coding interviews before you make it to the site (Read in different sites). Any other job service I’ve seen simply lets everyone in the door who wants in so I imagine it’s pretty overwhelming for employers and very difficult to find the good ones. At Toptal they claim that only 3% of applicants make it through the process. I’m excited for the opportunities that Toptal could open up for me so I’m going to brush up my skills and get ready for that phone call for interview process at TopTal.com (to become a part of the  Mobile App Developers Group).

I worked different Android applications from last 7 years that contains social networking, chatting apps, Games, Photography apps and Industrial large scale applications. I started my applications development in Android and started publication of those app’s under PolamR apps : https://play.google.com/store/apps/developer?id=PolamR+Apps and started working as freelancer too.




Android Architecture ….?

Android Architecture: Android basicsIn our previous Android Tutorials, we have discussed quite a few concepts of Android development. However, while browsing through the articles, I discovered that we have not had a proper discussion about Android Architecture.

Because it is one of the most elementary concepts of Android development, I decided to back up a little, and take a quick walk through the Android Architecture.

If you wish to revise more basic concepts of Android, you can attend this free webinar.


Android Architecture: Layers in the Android Stack

The Android stack, as the folks over at Google call it, has a number of layers, and each layer groups together several programs. In this tutorial I’ll walk you through the various layers in Android stack and the functions they are responsible for.

Following are the different layers in the Android stack:

  • Linux Kernel Layer
  • Native Layer
  • Application Framework Layer
  • Applications layer

Kernel Layer

Android Architecture: Linux Kernel

At the bottom of the Android stack is the Linux Kernel
. It never really interacts with the users and developers, but is at the heart of the whole system. Its importance stems from the fact that it provides the following functions in the Android system:

  • Hardware Abstraction
  • Memory Management Programs
  • Security Settings
  • Power Management Software
  • Other Hardware Drivers (Drivers are programs that control hardware devices.)
  • Support for Shared Libraries
  • Network Stack

With the evolution of Android, the Linux kernels it runs on have evolved too.

Here is a Table highlighting the different Kernel versions.

Android architecture: evolution of Linux kernel versions

The Android system uses a binder framework for its Inter-Process Communication (IPC) mechanism. The binder framework was originally developed as OpenBinder and was used for IPC in BeOS.

Native Libraries Layer

Android architecture: Native Android libraries

The next layer in the Android architecture includes Android’s native libraries. Libraries carry a set of instructions to guide the device in handling different types of data. For instance, the playback and recording of various audio and video formats is guided by the Media Framework Library.

Open Source Libraries:

  • Surface Manager: composing windows on the screen
  • SGL: 2D Graphics
  • Open GL|ES: 3D Library
  • Media Framework: Supports playbacks and recording of various audio, video and picture formats.
  • Free Type: Font Rendering
  • WebKit: Browser Engine
  • libc (System C libraries)
  • SQLite
  • Open SSL

Located on the same level as the libraries layer, the Android runtime layer includes a set of core Java libraries as well. Android application programmers build their apps using the Java programming language. It also includes the Dalvik Virtual Machine.

Android architecture: Android runtime layer

What is Dalvik VM?

Dalvik is open-source software. Dan Bornstein, who named it after the fishing village of Dalvík in Eyjafjörður, Iceland, where some of his ancestors lived, originally wrote Dalvic VM. It is the software responsible for running apps on Android devices.

  • It is a Register based Virtual Machine.
  • It is optimized for low memory requirements.
  • It has been designed to allow multiple VM instances to run at once.
  • Relies on the underlying OS for process isolation, memory management and threading support.
  • Operates on DEX files.

Application Framework Layer

Applications framework layer

Our applications directly interact with these blocks of the Android architecture. These programs manage the basic functions of phone like resource management, voice call management etc.

Important blocks of Application Framework:

  • Activity Manager: Manages the activity life cycle of applications. To understand the Activity component in Android in detail click here
  • Content Providers: Manage the data sharing between applications. Our Post on Content Provider component describes this in greater detail
  • Telephony Manager: Manages all voice calls. We use telephony manager if we want to access voice calls in our application.
  • Location Manager: Location management, using GPS or cell tower
  • Resource Manager: Manage the various types of resources we use in our Application

Application Layer

Applications layer: Android architecture

The applications are at the topmost layer of the Android stack. An average user of the Android device would mostly interact with this layer (for basic functions, such as making phone calls, accessing the Web browser etc.). The layers further down are accessed mostly by developers, programmers and the likes.

Several standard applications come installed with every device, such as:

  • SMS client app
  • Dialer
  • Web browser
  • Contact manager

We hope you are clear with the basic Android architecture now! If not, please feel free to ask our experts! Stay tuned for more advanced tutorials of Android.

How To Validate Username With Regular Expression ?

Username Regular Expression Pattern



^ # Start of the line
[a-z0-9_-] # Match characters and symbols in the list, a-z, 0-9, underscore, hyphen
{3,15} # Length at least 3 characters and maximum length of 15
$ # End of the line
Whole combination is means, 3 to 15 characters with any lower case character, digit or special symbol “_-” only. This is common username pattern that’s widely use in different websites.

* Validate username with regular expression
* @param username username for validation
* @return true valid username, false invalid username
public boolean validate(final String username){

matcher = pattern.matcher(username);
return matcher.matches();


Android saving file to external storage ?

call this function to save your bitmap in SD card

private void SaveIamge(Bitmap finalBitmap) {

    String root = Environment.getExternalStorageDirectory().toString();
    File myDir = new File(root + "/saved_images");    
    Random generator = new Random();
    int n = 10000;
    n = generator.nextInt(n);
    String fname = "Image-"+ n +".jpg";
    File file = new File (myDir, fname);
    if (file.exists ()) file.delete (); 
    try {
           FileOutputStream out = new FileOutputStream(file);
           finalBitmap.compress(Bitmap.CompressFormat.JPEG, 90, out);

    } catch (Exception e) {

and add this in manifest

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 

Note : By using this line you can able to see saved images in the gallery view.

sendBroadcast(new Intent(
            Uri.parse("file://" + Environment.getExternalStorageDirectory())));