Sunday, May 11, 2014

Creating a Project and an Activity


  1. In Eclipse, choose File New Android Project.This displays a New Android Project creation screen.
  2. Fill in the Project name, such as SimpleActivityExample.
  3. Select a Build Target from the choices provided.These choices are based on the Software Development Kit (SDK) versions that are installed on the development computer.
  4. Fill in the Application name, such as Example of Basic Activity.
  5. Fill in the Package name, such as com.example.simple_activity.
  6. To create the main activity in the same step, be sure Create Activity is checked and fill in an Activity name, such as SimpleActivity. 

Android OS Emulator Controls


Key                                     Emulated Function 

Escape                          Back button

Home                           Home button
F2, PageUp                  Menu button
Shift-F2,                      PageDown Start button
F3                                Call/Dial button
F4                                 Hangup/EndCall button
F5                             Search button
F7                              Power button
Ctrl-F3, Ctrl-KEYPAD_5 Camera button
Ctrl-F5, KEYPAD_PLUS Volume up button
Ctrl-F6, KEYPAD_MINUS Volume down button
KEYPAD_5 DPAD center
KEYPAD_4, KEYPAD_6 DPAD left, DPAD right
KEYPAD_8, KEYPAD_2 DPAD up, DPAD down
F8                                          Toggle cell network on/off
F9                                          Toggle code profiling (when -trace set)
Alt-ENTER                            Toggle fullscreen mode
Ctrl-T                                    Toggle trackball mode
Ctrl-F11, KEYPAD_7 Rotate screen orientation to previous or next layout Ctrl-F12, KEYPAD_9
  

FroYo: Android OS 2.2, API Level 8, Released May 20, 2010


  • Linux kernel 2.6.32.
  • Just-In-Time compilation (JIT) enabled, leading to faster code execution. n Voice dialing using Bluetooth.
  •  Car and desk dock themes.
  •  Better definition of multitouch events.
  •  Cloud-to-device APIs.
  •  Applications can request to be installed on the SD memory card.
  •  Wi-Fi tether support on select devices.
  •  Thumbnail utility for videos and images.
  •  Multiple language support on keyboard input.
  •  Application error reporting for Market apps. 

Eclair: Android OS 2.0, API Level 5, Released October 26, 2009 Android OS 2.0.1, API Level 6, Released December 3, 2009 Android OS 2.1, API Level 7, Released January 12, 2010


  •  Sync adapter APIs to connect to any backend.
  •  Embed Quick Contact accessible in applications.
  •  Applications can control the Bluetooth connection to devices. n HTML5 support.
  •  Microsoft Exchange support.
  •  Multitouch is accessible through the MotionEvent class.
  •  Animated wallpaper support. 

Donut: Android OS 1.6, API Level 4, Released September 15, 2009


  • Linux kernel 2.6.29.
  • Support for multiple screen sizes.
  •  Gesture APIs.
  • Text-to-speech engine.
  •  Integrate with the Quick Search Box using the SearchManager. n Virtual Private Network (VPN) support. 

Cupcake: Android OS 1.5, API level 3, Released April 30, 2009



  •  Linux kernel 2.6.27.
  •  Smart virtual (soft) keyboard, support for third-party keyboards.
  •  AppWidget framework.
  •  Live Folders.
  •  Raw audio recording and playback.
  •  Interactive MIDI playback engine.
  •  Video recording APIs.
  •  Stereo Bluetooth support.
  •  Removed end-user root access (unless tethered to computer and using SDK).
  •  Speech recognition via RecognizerIntent (cloud service).
  •  Faster GPS location gathering (using AGPS). 

How to install Android SDK in Eclipse?


  1. Install the Java Development Kit (for example, install JDK 6.0 for use with Android 2.1 or above; JDK 5.0 is the minimum version needed for any earlier ver- sion of Android).
  2. Install Eclipse Classic (for example, version 3.5.2). In the case of Windows, this just needs to be unzipped in place and is ready to use.
  3. Install the Android SDK starter package (for example, version r06). In the case of Windows, this just needs to be unzipped in place and is ready to use.
  4. Start Eclipse and select Help Install New Software..., and then type https:// dl-ssl.google.com/android/eclipse/ and install the Android DDMS and Android Development Tools.
  5. In Eclipse, select Window Preferences... (on a Mac, select Eclipse Prefer- ences) and select Android. Browse to the location where the SDK was unzipped and apply.
  6. In Eclipse, select Window Android SDK and AVD Manager Available Packages, and then choose the necessary APIs to install (for example, Documenta- tion for Android SDK,API 8; SDK Platform Android 2.2,API 8; Google APIs by Google Inc.; and Android API 8).
  7. From the same Android SDK and AVD Manager menu, create an Android virtual device to run the emulator or install USB drivers to run applications on a plugged- in phone.
  8. InEclipse,selectRunRunConfigurations...andcreateanewrunconfiguration to be used with each Android application (or similar for a Debug Configuration). Android JUnit tests can be configured here, too. 

How Android OS is organized?


The Android OS is organized into the following images:


-> Bootloader—Initiates loading of the boot image during startup --> Boot image—Kernel and RAMdisk
->System image—Android operating system platform and apps
->Data image—User data saved across power cycles

-> Recovery image—Files used for rebuilding or updating the
 ->system n Radio image—Files of the radio stack 

What is Android?



Android is an embedded OS that relies on the Linux kernel for core system services, but it is not embedded Linux. For example, standard Linux utilities such as X-windows and GNU C libraries are not supported.Writing applications for Android utilizes the Java framework, but it is not Java. Standard Java libraries such as Swing are not sup- ported. Other libraries such as Timer are not preferred; they have been replaced by Android’s own libraries, which are optimized for usage in a resource-constrained, embedded environment.
The Android OS is open source, which means developers can view and use any of the system source code, including the radio stack.This source code is one of the first resources for seeing examples of Android code in action, and it helps clarify the usage when documentation is lacking.This also means developers can utilize the system in the same way as any core application and can swap out system components for their own components. However, Android devices do contain some proprietary software that is inaccessible to developers (such as Global Positioning System (GPS) navigation). 

Saturday, May 10, 2014

Top Educational App on android iOS application (English Grammar Ultimate )

Grammar is the study of words and the ways words work together. An invisible force that guides us as we put words together into sentences. Any person who communicates using a particular language is consciously or unconsciously aware of the grammar of that language.
To speak in a clearer and more effective manner we study grammar. A person who has unconscious knowledge of grammar may be sufficient for simple language use, but the ones who wish to communicate in an artful manner and well, will seek greater depth of understanding and proficiency that the study of grammar provides.
This iOS application and Android application will help to improve your English grammar. Keep this application always in your pocket.
I) Spoken English
II)Tenses
1) Use of Let
2) Use Of Little, A Little, Few, A Few
3) Use of Shall
4) Use of Should
5) Use of Wish
6) Used to
7) Using of Must or Have To
8) Verbs
9) Phrases
10) Plurals
11) Practice1
12) Prepositions
13) Pronouns
14) Punctuation Marks
15) Quantifiers
16) Active Or Passive Voice
17) Adjectives
18) Adverbs
19) Articles
20) Auxiliary Verbs
21) Capitalization
23) Grammar Mistakes
24) Conditionals
25) Conjunctions
26) Degree of comparison
27) Determiners
28) Direct & indirect speech
29) English phonetics
30) Essay Writing
31) Figure of speech
32) Gender
33) Gerund and present participles
34) Going to
35) Had better
36) Homonyms
37) Idioms
38) Independent & Dependent Clauses
39) Infinitives
40) Interjections
41) Irregular verbs
42) Nouns


Download from iTunes :Click Here 
Download From Google Play :Click Here

AES Encryption and Decryption in iOS

Step 1: First you have to include these two files into your project.

#include <CommonCrypto/CommonCryptor.h>

@interface NSData(AES)
- (NSData*)AES128Decrypt;
- (NSData*)AES128Encrypt;
@end


#import "NSData+AES.h"

NSString *iv = @"fedcba9876543210";
NSString *key = @"0123456789abcdef";

@implementation NSData (AES)

-(NSData*)AES128Encrypt
{
    char ivPtr[kCCKeySizeAES128 + 1];
    bzero(ivPtr, sizeof(ivPtr));
    
    // fetch iv data
    [iv getCString:ivPtr maxLength:sizeof(ivPtr) encoding:NSUTF8StringEncoding];
    
    
    // 'key' should be 32 bytes for AES256, will be null-padded otherwise
    char keyPtr[kCCKeySizeAES128 + 1]; // room for terminator (unused)
    bzero(keyPtr, sizeof(keyPtr)); // fill with zeroes (for padding)
    
    // fetch key data
    [key getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];
    
    NSUInteger dataLength = [self length];
    
    //See the doc: For block ciphers, the output size will always be less than or
    //equal to the input size plus the size of one block.
    //That's why we need to add the size of one block here
    size_t bufferSize           = dataLength + kCCBlockSizeAES128;
    void* buffer                = malloc(bufferSize);
    
    size_t numBytesEncrypted    = 0;
    CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt, kCCAlgorithmAES128, 0,
                                          keyPtr, kCCKeySizeAES128,
                                           ivPtr/* initialization vector (optional) */,
                                          [self bytes], dataLength, /* input */
                                          buffer, bufferSize, /* output */
                                          &numBytesEncrypted);
    

    if (cryptStatus == kCCSuccess)
    {
        //the returned NSData takes ownership of the buffer and will free it on deallocation
        return [NSData dataWithBytesNoCopy:buffer length:numBytesEncrypted];
    }
    
   free(buffer); //free the buffer;
    return nil;
}

- (NSData*)AES128Decrypt
{
    char ivPtr[kCCKeySizeAES128 + 1];
    bzero(ivPtr, sizeof(ivPtr)); 
    
    // fetch iv data
    [iv getCString:ivPtr maxLength:sizeof(ivPtr) encoding:NSUTF8StringEncoding];
    
    

    // 'key' should be 32 bytes for AES256, will be null-padded otherwise
    char keyPtr[kCCKeySizeAES128 + 1]; // room for terminator (unused)
    bzero(keyPtr, sizeof(keyPtr)); // fill with zeroes (for padding)
    
    // fetch key data
    [key getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];
    
    
    NSUInteger dataLength = [self length];
    
    //See the doc: For block ciphers, the output size will always be less than or
    //equal to the input size plus the size of one block.
    //That's why we need to add the size of one block here
    size_t bufferSize           = dataLength + kCCBlockSizeAES128;
    void* buffer                = malloc(bufferSize);
    
    size_t numBytesDecrypted    = 0;
    CCCryptorStatus cryptStatus = CCCrypt(kCCDecrypt, kCCAlgorithmAES128, 0,
                                          keyPtr, kCCKeySizeAES128,
                                          ivPtr /* initialization vector (optional) */,
                                          [self bytes], dataLength, /* input */
                                          buffer, bufferSize, /* output */
                                          &numBytesDecrypted);
    
    if (cryptStatus == kCCSuccess)
    {
        //the returned NSData takes ownership of the buffer and will free it on deallocation
        return [NSData dataWithBytes:buffer length:numBytesDecrypted] ;
    }
    
    free(buffer); //free the buffer;
    return nil;
}

@end


Step 2: You have to import "Security.framework" into your project.

Step 3: Now, you need to put below code into the class where you want to Encrypt or Decrypt a string and also need to import "NSData+AES.h" file.

- (void)testActuallyEncrypting:(NSString *)hexString
{
    NSLog(@"Encrypted HexString : %@",hexString);

    NSData *data = [self dataFromHexString:hexString];
    NSData *encryptedData =  [NSData dataWithBytes:[data bytes] length:[data length]];
    NSData *decryptedData = [encryptedData AES128Decrypt];
    NSString *decryptedString = [NSString stringWithUTF8String:[decryptedData bytes]];
    NSLog(@"Decrypted String : %@",decryptedString);

    decryptedString = [self addPaddingToString:decryptedString];
    decryptedData = [NSData dataWithBytes:[decryptedString UTF8String] length:[[decryptedString dataUsingEncoding:NSUTF8StringEncoding] length]];
    encryptedData = [decryptedData AES128Encrypt];
    if (encryptedData!=nil)
    {
        NSString *encryptedHexString = [self hexStringFromData:encryptedData];
        NSLog(@"Encrypted HexString : %@",encryptedHexString);

//        NSData *data1 = [self dataFromHexString:encryptedHexString];
//        NSData *encryptedData1 =  [NSData dataWithBytes:[data1 bytes] length:[data1 length]];
//        NSData *decryptedData1 = [encryptedData1 AES128Decrypt];
//        NSString *decryptedString1 = [NSString stringWithUTF8String:[decryptedData1 bytes]];
//        NSLog(@"Decrypted String Testing 123: %@",[decryptedString1 stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@" "]]);
    }
}

Step 4 : For step3 , you have to add these three methods into your code.

// For Converting incoming HexString into NSData
- (NSData *)dataFromHexString:(NSString *)string 
{   
    NSMutableData *stringData = [[[NSMutableData alloc] init] autorelease];
    unsigned char whole_byte;
    char byte_chars[3] = {'\0','\0','\0'};
    int i;
    for (i=0; i < [string length] / 2; i++) {
        byte_chars[0] = [string characterAtIndex:i*2];
        byte_chars[1] = [string characterAtIndex:i*2+1];
        whole_byte = strtol(byte_chars, NULL, 16);
        [stringData appendBytes:&whole_byte length:1]; 
    }
    return stringData;
}


// For converting Encrypted Data into NSString after the encryption 
- (NSString*)hexStringFromData:(NSData *)data 
{
    unichar* hexChars = (unichar*)malloc(sizeof(unichar) * (data.length*2));
    unsigned char* bytes = (unsigned char*)data.bytes;
    for (NSUInteger i = 0; i < data.length; i++) {
        unichar c = bytes[i] / 16;
        if (c < 10) c += '0';
        else c += 'a' - 10;
        hexChars[i*2] = c;
        c = bytes[i] % 16;
        if (c < 10) c += '0';
        else c += 'a' - 10;
        hexChars[i*2+1] = c;
    }
    NSString* retVal = [[NSString alloc] initWithCharactersNoCopy:hexChars
                                                           length:data.length*2 
                                                     freeWhenDone:YES];
    return [retVal autorelease];
}
// For padding into a string for required string length
-(NSString *)addPaddingToString:(NSString *)string
{
    NSInteger size = 16;
    NSInteger x = [string length]%size;
    NSInteger padLength = size - x;
    for (int i=0; i<padLength; i++)
    {
        string = [string stringByAppendingString:@" "];
    }
    return string;
}

Motorola Moto X Vs Motorola Moto G

     Motorola Moto X         


GENERAL2G NetworkGSM 850 / 900 / 1800 / 1900 - all versions
3G NetworkHSDPA 850 / 900 / 1900 / 2100 - for AT&T
HSDPA 850 / 900 / 1700 / 1900 / 2100 - for T-Mobile
 HSDPA 850 / 900 / 1900 / 2100 - for Europe
4G NetworkLTE 700 / 850 / 1700 / 1900 / 2100 - for AT&T
LTE 700 / 1700 / 1900 / 2100 - for T-Mobile
 LTE 800 / 1800 / 2600 - for Europe
SIMNano-SIM
Announced2013, August
StatusAvailable. Released 2013, August
BODYDimensions129.3 x 65.3 x 10.4 mm (5.09 x 2.57 x 0.41 in)
Weight130 g (4.59 oz)
DISPLAYTypeAMOLED capacitive touchscreen, 16M colors
Size720 x 1280 pixels, 4.7 inches (~312 ppi pixel density)
MultitouchYes
ProtectionCorning Gorilla Glass
SOUNDAlert typesVibration, MP3, WAV ringtones
LoudspeakerYes
3.5mm jackYes
MEMORYCard slotNo
Internal16/32 GB, 2 GB RAM
DATAGPRSYes
EDGEYes
SpeedHSDPA, 42.2 Mbps; HSUPA, 5.76 Mbps; LTE, Cat3, 50 Mbps UL, 100 Mbps DL / EV-DO Rev. A, up to 3.1 Mbps
WLANWi-Fi 802.11 a/b/g/n/ac, dual-band, DLNA, Wi-Fi hotspot
BluetoothYes, v4.0 with A2DP, LE, EDR
NFCYes
USBYes, microUSB v2.0, USB Host
CAMERAPrimary10 MP, 4320 x 2432 pixels, autofocus, LED flash
Features1.4 µm pixel size, geo-tagging, touch focus, face detection, panorama, HDR
VideoYes, 1080p@30fps, stereo sound rec., HDR
SecondaryYes, 2 MP,1080p
FEATURESOSAndroid OS, v4.2.2 (Jelly Bean), upgradable to v4.4 (KitKat)
ChipsetQualcomm MSM8960Pro Snapdragon
CPUDual-core 1.7 GHz Krait
GPUAdreno 320
SensorsAccelerometer, gyro, proximity, compass, barometer, temperature
MessagingSMS(threaded view), MMS, Email, Push Email, IM
BrowserHTML5
RadioNo
GPSYes, with A-GPS support and GLONASS
JavaYes, via Java MIDP emulator
ColorsBlack, White (front panel), 18 color options (back panel)
 - Active noise cancellation with dedicated mic
- Google Drive (50 GB storage)
- SNS integration
- MP3/AAC+/WAV/WMA player
- MP4/H.263/H.264/WMV player
- Google Search, Maps, Gmail
- YouTube, Google Talk, Picasa
- Organizer
- Photo viewer/editor
- Document viewer
- Voice memo/dial
- Predictive text input
BATTERY Li-Ion 2200 mAh battery
Stand-byUp to 576 h
Talk timeUp to 13 h

     Motorola Moto G

GENERAL2G NetworkGSM 850 / 900 / 1800 / 1900
 CDMA 800 / 1900 - CDMA version
3G NetworkHSDPA 850 / 900 / 1900 / 2100
HSDPA 850 / 1700 / 1900 / 2100 - for T-Mobile, AT&T
 CDMA2000 1xEV-DO - CDMA version
SIMMicro-SIM
Announced2013, November
StatusAvailable. Released 2013, November
BODYDimensions129.9 x 65.9 x 11.6 mm (5.11 x 2.59 x 0.46 in)
Weight143 g (5.04 oz)
DISPLAYTypeIPS LCD capacitive touchscreen, 16M colors
Size720 x 1280 pixels, 4.5 inches (~326 ppi pixel density)
MultitouchYes
ProtectionCorning Gorilla Glass 3
SOUNDAlert typesVibration, MP3, WAV ringtones
LoudspeakerYes
3.5mm jackYes
MEMORYCard slotNo
Internal8/16 GB, 1 GB RAM
DATAGPRSYes
EDGEYes
SpeedHSDPA, 21 Mbps; HSUPA
WLANWi-Fi 802.11 b/g/n, Wi-Fi hotspot
BluetoothYes, v4.0 with A2DP, LE
USBYes, microUSB v2.0, USB Host
CAMERAPrimary5 MP, 2592 Ñ… 1944 pixels, autofocus, LED flash, check quality
FeaturesGeo-tagging, touch focus, face detection, HDR, panorama
VideoYes, 720p@30fps, stereo sound rec., HDR, check quality
SecondaryYes, 1.3 MP
FEATURESOSAndroid OS, v4.3 (Jelly Bean), upgradable to v4.4.2 (KitKat)
ChipsetQualcomm MSM8226 Snapdragon 400
CPUQuad-core 1.2 GHz Cortex-A7
GPUAdreno 305
SensorsAccelerometer, proximity, compass
MessagingSMS(threaded view), MMS, Email, Push Email, IM
BrowserHTML5
RadioFM radio
GPSYes, with A-GPS support and GLONASS
JavaYes, via Java MIDP emulator
ColorsBlack (front panel), 7 color options (back panel)
 - SNS integration
- Google Drive (50 GB storage)
- Active noise cancellation with dedicated mic
- MP3/AAC+/WAV/Flac player
- MP4/H.263/H.264 player
- Organizer
- Photo viewer/editor
- Document viewer
- Google Search, Maps, Gmail
- YouTube, Google Talk, Picasa
- Voice memo/dial
- Predictive text input
BATTERY Non-removable Li-Ion 2070 mAh battery
Stand-by
Talk timeUp to 24 h
MISCSAR US1.17 W/kg (head)     1.06 W/kg (body)    
SAR EU0.79 W/kg (head)    
Price group
TESTSDisplayContrast ratio: 967:1 (nominal), 2.477 (sunlight)
LoudspeakerVoice 81dB / Noise 75dB / Ring 82dB
Audio qualityNoise -92.1dB / Crosstalk -91.4dB
CameraPhoto / Video
Moto G (Dual Sim also available)