Steps To Generate android Hash Key for Facebook:

  • Download OpenSSL for Windows
  • Extract your Open SSL zip in root directory or any where in your drive
  • Open %extracted folder%\openssl-0.9.8k_WIN32\bin there you can see openssl.exe
  • From Shift + Right mouse click to open Command prompt
  • Now start from here
    • paste below text in cmd
    • keytool -exportcert -alias androiddebugkey -keystore C:\Users\%user%\.android\debug.keystore | openssl sha1 -binary | openssl base64
  • Then enter keystore password
  • You are ready to get Hash Key :)
Shrink Bitmap:

 public Bitmap ShrinkBitmap(String file, int width, int height){  
  BitmapFactory.Options bmpFactoryOptions = new BitmapFactory.Options();  
      bmpFactoryOptions.inJustDecodeBounds = true;  
      Bitmap bitmap = BitmapFactory.decodeFile(file, bmpFactoryOptions);  
      int heightRatio = (int)Math.ceil(bmpFactoryOptions.outHeight/(float)height);  
      int widthRatio = (int)Math.ceil(bmpFactoryOptions.outWidth/(float)width);  
      if (heightRatio > 1 || widthRatio > 1)  
      {  
       if (heightRatio > widthRatio)  
       {  
       bmpFactoryOptions.inSampleSize = heightRatio;  
       } else {  
       bmpFactoryOptions.inSampleSize = widthRatio;  
       }  
      }  
      bmpFactoryOptions.inJustDecodeBounds = false;  
      bitmap = BitmapFactory.decodeFile(file, bmpFactoryOptions);  
  return bitmap;  
 }  

Cropped Bitmap:

 public Bitmap getCroppedBitmap(Bitmap bitmap) {  
      Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),  
                bitmap.getHeight(), Config.ARGB_8888);  
      Canvas canvas = new Canvas(output);  
      final int color = 0xff424242;  
      final Paint paint = new Paint();  
      final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());  
      paint.setAntiAlias(true);  
      canvas.drawARGB(0, 0, 0, 0);  
      paint.setColor(color);  
      // canvas.drawRoundRect(rectF, roundPx, roundPx, paint);  
      canvas.drawCircle(bitmap.getWidth() / 2, bitmap.getHeight() / 2,  
                bitmap.getWidth() / 2, paint);  
      paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));  
      canvas.drawBitmap(bitmap, rect, rect, paint);  
      //Bitmap _bmp = Bitmap.createScaledBitmap(output, 60, 60, false);  
      //return _bmp;  
      return output;  
 }  

      public void appendLogger(String text)  
      {      
        File logFile = new File("/mnt/sdcard/log.file");  
        if (!logFile.exists())  
        {  
         try  
         {  
           logFile.createNewFile();  
         }   
         catch (IOException e)  
         {  
           // TODO Auto-generated catch block  
           e.printStackTrace();  
         }  
        }  
        try  
        {  
         //BufferedWriter for performance, true to set append to file flag  
         BufferedWriter buf = new BufferedWriter(new FileWriter(logFile, true));   
         buf.append(text);  
         buf.newLine();  
         buf.close();  
        }  
        catch (IOException e)  
        {  
         // TODO Auto-generated catch block  
         e.printStackTrace();  
        }  
      }  
CamelCase (camel case, camel caps or medial capitals) is the practice of writing compound words or phrases such that each next word or abbreviation begins with a capital letter. Camel case may start with a capital or, especially in programming languages, with a lowercase letter.



      public static String UppercaseFirstLetters(String str) {  
           boolean prevWasWhiteSp = true;  
           char[] chars = str.toCharArray();  
           for (int i = 0; i < chars.length; i++) {  
                if (Character.isLetter(chars[i])) {  
                     if (prevWasWhiteSp) {  
                          chars[i] = Character.toUpperCase(chars[i]);  
                     }  
                     prevWasWhiteSp = false;  
                } else {  
                     prevWasWhiteSp = Character.isWhitespace(chars[i]);  
                }  
           }  
           return new String(chars);  
      }  
Introduction 
                         POJO (Plain Old Java Object), basically a class with attributes and it’s getters and setters. The name is used to emphasise that a given object is an ordinary Java Object, not a special object.

Why used in android?
                         POJO is mainly used to denote a Java object which does not follow any of the major Java object models, conventions, or frameworks. Mainly used in Restful API web-services.

Example 
Initialize : 
 public Test(String id, String name) {  
           this.name = name;
           this.id = id; 
      }  
Getter : 
 public String getName() {  
           return name;  
      }  
Setter : 
 public void setName(String name) {  
           this.name = name;  
      }  
Calling from Activity : 
 Test pojo = new Test("001" , "Kumar"};  


Introduction 
                Android is an Operating System for mobile devices developed by Google, which is built upon Linux kernel. Android was developed by the Open Handset Alliance, led by Google, and other companies.


Needs
  • Windows / Mac OS / Linux
  • Intermediate knowledge in Java Programming
  • Java JDK (Download from here)
  • Android SDK
  • Eclipse

Development Environment
              The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language. Download SDK bundle from here. The ADT Bundle includes below things:
  • Eclipse + ADT plugin
  • Android SDK Tools
  • Android Platform tools
  • Latest Android platform
  • Latest Android image for the emulator
Android online programming classes starts from today. Beginners, Experienced and Job-seekers all will get benefit from this classes.

All Classes will contain intro,programming logic,examples and exercises. All classes in separate label named Android Lessons.