Sunday, December 8, 2013

Junit Testing Introdcution

Testing:
Testing is the process of checking the functionality of the application as per requirements.

JunitTesting:
-JUnit is a unit testing framework for the Java Programming Language
-It is a process of checking the functionality of the application at the developer level .
-Main use of junit testing is programmer productivity and stability of program code that reduces programmer stress and the time spent on debugging.

Features :
*JUnit is an open source framework used for writing & running tests.
*Provides Annotation to identify the test methods.
*Provides Assertions for testing expected results.
*Provides Test runners for running tests.
*JUnit tests allow you to write code faster which increasing quality
*JUnit is elegantly simple. It is less complex & takes less time.
*JUnit tests can be run automatically and they check their own results and provide
immediate feedback. There's no need to manually comb through a report of test results.
*JUnit tests can be organized into test suites containing test cases and even other test
suites.

UnitTest case:
*A Unit Test Case is a part of code which ensures that the another part of code (method) works as
expected.
*JUnit is perfect unit test framework for java programming language.






Saturday, November 23, 2013

Facebook Android integration java.lang.NullPointerException: Argument 'applicationId' cannot be null

You may face the following error when integrating facebook sdk with Android :

                java.lang.NullPointerException: Argument 'applicationId' cannot be null.

If you are getting the above error even though you specified the facebook applicationId in manifest file as follows: 

          <meta-data android:name="com.facebook.sdk.ApplicationId"   android:value="123456785678" />


Reason:
Reason for the above error is due to the ApplicationId is mentioned as Integer , as we specified directly in manifest . But facebook SDK needs ApplicationId value as String. So if we pass ApplicationId as above, inside facebook SDK 'ClassCastException' occurs and considers  ApplicationId value as null. 

Solution:
Declare APP_ID value in strings.xml as follows:
 <string name="APP_ID">123456785678</string>

And then refer this APP_ID as ApplicationId value in manifest file:

<meta-data  android:name="com.facebook.sdk.ApplicationId" android:value="@string/APP_ID" />

Please share your comments on this , if it is helped ...




Thursday, May 23, 2013

Android Inc History and Development

Brief History - Android :

  • Android Inc  was founded at Palo Alto in oct-2003 by Andy Rubin, Rich Miner , Nick Sears and Chris White to develop Operating System for Digital Cameras.
  • Later they diverted their efforts towards produce a smart phone operating system due to less market for digital cameras.
  • Google acquired 'Android Inc' on August-2005 .
  • On 2007 Google established a 'Open Handset Alliance (OHA)' , is a association of hardware , software, telecommunication companies to develop open standards for mobile operating system.
  • First commercially available phone to run on Android was 'HTC Dream' on 2008.

=========================================================

Environment - Android:

  • Android SDK 
  • Eclipse IDE 
  • Java SDK 

Android SDK setup : 

 

Sunday, May 19, 2013

Android Operating System Introduction and Architecture

Android Operating System:

  1. Android is a software stack for mobile devices which includes operating system , middle-ware and key applications.
  2. Android applications are written in Java Language.
  3. Android SDK has build in tools and libraries which necessary for Android development.
  4. Android operating system is Multi User Linux system. By default Linux assigns unique user id for each application. So one application data can't be shared to other application directly(i.e Isolated).
  5. Each application runs on his own process.

Android System Architecture:

Architecture consists of four layers .
  • Linux Kernel
  • Libraries - Android Runtime
  • Application Framework
  • Applications 
Now I am going to explain each and every layer in details :
Linux Kernel
  • Android architecture is based on Linux kernel 2.6.
  • Linux kernel provides Memory management, power management , process management , security model , networking etc...
Libraries and Android Runtime
  • Libraries are written in C and C++.
  • Surface Manager is responsible for composing different drawing surfaces on to the screen.
  • OpenGL/ES is a 3D graphics library.
  • SGL is for 2D graphics. Most of the application drawing is based on this library only.
  • Media Framework contains the entire codex that make up the core media experiences.
  • Free Type is to render fonts .This is a free , high-quality , portable font engine.
  • SQLite is for core data storage.
  • WebKit is a open source browser engine.(Same as safari on Apple)
  • Android Runtime includes core libraries that provides the most of the functionality available in the core libraries of Java.
  • Dalvik Virtual Machine is extremely low memory based virtual machine, designed for Android tow work well in low power situations.
  • Core Libraries contains all the collection classes, utilities , tools .
Application Framework:
  • Application framework written in java .
  • It is like a toolkit that all applications can use.
  • It has several components like Activity manager, Package Manager , Window manager , Telephony Manager , Content Provider , Location Manager, View System , Notification System.
Applications:
  • At the top of the architecture we have all the applications which are used by final user.
  • Apps developed by us also sits on this layer.