Monday, September 7, 2015

Folder Structure or Directory Structure of an Android Project

      Any Android project contain things such as application source code and resource files. Some are generated for you by default, while others should be created if required. Lets have a look at android eclipse project directory structure below :
Android Folder Structure
src - User specified java source code files will be available here.

gen  - The gen directory in an Android project contains auto generated files. You can see R.java inside this folder which is a generated class which contains references to certain resources of the project. R.java is automatically created by the Eclipse IDE and any manual changes are not necessary. 

res - Android supports resources like images and certain XML configuration files, these can be keep separate from the source code. All these resources should be placed inside the res folder. This res folder will be having sub-folders to keep the resources based on its type.

 /res/values - Used to define strings, colors, dimensions, styles and static arrays of strings or integers. By convention each type is stored in a separate file, e.g. strings are defined in the res/values/strings.xml file.

/res/values-v11 is the values of the API version 11, and /res/values-v14 is the values of the API version 14

/res/animator - This folder contains animations in XML for the property animation API which allows to animate arbitrary properties of objects over time

/res/layout - This folder contains the layouts to be used in the application.A layout resource defines the architecture for the UI in an Activity or a component of a UI. These are resource directories in an application that provides different layout designs for different screen sizes

/res/layout - layout for normal screen size or default

/res/layout-small - layout for small screen size

/res/layout-large - layout for large screen size

/res/layout-xlarge -layout for extra-large screen size

/res/layout-xlarge-land - layout for extra-large in landscape orientation

/res/layout-sw600dp - layout for tablets or layout for 7” tablets (600dp wide and bigger)

/res/layout-sw720dp - layout for 10” tablets (720dp wide and bigger)

/res/layout-w600dp - layout for Multi-pane (any screen with 600dp available width or more)

/res/menu - This folder contains menu resources to be used in the application (Options Menu, Context Menu, or submenu)

/res/raw - This folder contains raw resources that can be looked up by their resource IDs. These resources can be referenced from other resources all of the same way we do with other resources.

/res/drawable - Drawable folders are resource directories in an application that provides different l bitmap drawables for medium, high, and extra high density screens.

/res/drawable-mdpi - bitmap for medium density

/res/drawable-hdpi - bitmap for high density

/res/drawable-xhdpi - bitmap for extra high density

/res/drawable-nodpi - bitmap with no pre-scaling

libs - External library files will be placed in this folder. If you want to any external library in your project place the library jar inside this folder and it will be added to the classpath automatically.

assets - This folder contains raw hierarchy of files and directories, with no other capabilities. It is just an unstructured hierarchy of files, allowing you to put anything you want there and later retrieve as raw byte streams.

bin - Bin folder is the area used by the compiler to prepare the files to be finally packaged to the application’s APK file. This includes

·         Compiling your Java code into class files

·         Putting your resources (including images) into a structure to be zipped into the APK

This is the output directory of the build. This is where you can find the final .apk file and other compiled resources.

AndroidManifest.xml - All the android applications will have an AndroidManifest.xml file in the root directory. This file will contain essential information about the application to the Android system, information the system must have before it can run any of the application's code. This control file describes the nature of the application and each of its components.

ic_launcher-web.png - This is an icon to be used in Google play. Applications on Google Play require a high fidelity version of the application icon. It is not used in your actual app or the launcher, so it is not packaged in the APK.. The specifications for the high-resolution icon are:

32-bit PNG with an alpha channel

512 x 512 pixels

Maximum size of 1024KB.

proguard-project.txt - Everything in the proguard-project.txt file will be in commented out state, because in general most people don't have any project specific needs, just to run ProGuard tool with standard settings.

The ProGuard tool shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names. The result is a smaller sized .apk file that is more difficult to reverse engineer.

project.properties - project.properties is the main project’s properties file containing information such as the build platform target and the library dependencies has been renamed from default.properties in older SDK versions. This file is integral to the project.



Tuesday, July 28, 2015

Android Architecture

   Android operating system is a stack of software components.Android architecture or Android software stack is categorized into five parts:
  1. linux kernel
  2. native libraries (middleware),
  3. Android Runtime
  4. Application Framework
  5. Applications

Linux kernel


  At the bottom of the layers is Linux - Linux 2.6 with approximately 115 patches. This provides basic system functionality like process management, memory management, device management like camera, keypad, display etc. Also, the kernel handles all the things that Linux is really good at such as networking and a vast array of device drivers, which take the pain out of interfacing to peripheral hardware.

Libraries


  On top of Linux kernel there is a set of libraries including open-source Web browser engine WebKit, well known library libc, SQLite database which is a useful repository for storage and sharing of application data, libraries to play and record audio and video, SSL libraries responsible for Internet security etc.

Android Runtime


  This is the third section of the architecture and available on the second layer from the bottom. This section provides a key component called Dalvik Virtual Machine which is a kind of Java Virtual Machine specially designed and optimized for Android.
  The Dalvik VM makes use of Linux core features like memory management and multi-threading, which is intrinsic in the Java language. The Dalvik VM enables every Android application to run in its own process, with its own instance of the Dalvik virtual machine.
  The Android runtime also provides a set of core libraries which enable Android application developers to write Android applications using standard Java programming language.

Application Framework


  The Application Framework layer provides many higher-level services to applications in the form of Java classes. Application developers are allowed to make use of these services in their applications.

Applications


  You will find all the Android application at the top layer. You will write your application to be installed on this layer only. Examples of such applications are Contacts Books, Browser, Games etc.

Android Overview

Hi....... Now a days Android Application development has high demand on software market. As a Android application developer from past 2 years I wanna share my knowledge on android app development with some enthusiastic learners as you, that's why I started this blog.. ALL THE BEST for your journey in Android App Development.

The content from this blog is gathered from my experience and as well as from different websites.....Thanks to all.


Android is an open source operating system based on the Linux-Kernel. This is used for different mobile devices such as smartphones, tablets, watches,...etc.


Android Inc was founded in Oct 2003 by Andy Rubin, Rich Miner, Nick Sears and Chris White.

Google acquired Android Inc. on Aug, 2005.,  The Open Handset Alliance unleived on Nov 2007 led by Google.The first commercially available running Android was the HTC Dream, released on Oct 2008.

Android Versions:

YearVersionCodenameAPI Level
2009, Apr 301.5Cupcake3
2009, Sep 151.6Donut4
2009, Oct 262.0 - 2.1Eclair7
2010, Mar 202.2Froyo8
2010, Dec 62.3 - 2.3.2Ginderbread9
2.3.3 - 2.3.710
2011, Feb 223.0Honeycomb11
3.112
3.213
2011, Oct 194.0 - 4.0.2Ice Cream Sandwich14
4.0.3 - 4.0.415
2012, Jun 284.1Jelly Bean16
4.217
4.318
2013, Oct 314.4KitKat19



Android SDK:

Applications ("apps"), that extend the functionality of devices, are developed primarily in the Java programming language using the Android software development kit (SDK). The SDK includes a comprehensive set of development tools including a debugger, software libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials.

 The officially supported integrated development environment (IDE) is Eclipse using the Android Development Tools (ADT) plugin. Other development tools are available, including a Native Development Kit for applications or extensions in C or C++, Google App Inventor, a visual environment for novice programmers, and various cross platform mobile web applications frameworks.