Monday, 23 February 2015

download professional android 4 application development pdf

Professional Android 4 Application Development (English) 

The fast-growing popularity of Android smartphones and tablets creates a huge opportunities for developers. If you're an experienced developer, you can start creating robust mobile Android apps right away with this professional guide to Android 4 application development. Written by one of Google's lead Android developer advocates, this practical book walks you through a series of hands-on projects that illustrate the features of the Android SDK. That includes all the new APIs introduced in Android 3 and 4, including building for tablets, using the Action Bar, Wi-Fi Direct, NFC Beam, and more.
Key Features
  • The market growth of Google Android devices now far outpaces Apple.
  • The Android 4 release brings the power of Android to both smartphones and the hot tablet computing market.
  • Builds on Meier's bestselling Pro Android 2, which has sold more than 20,000 copies.
  • The author shows how to use the features of each Android API through a series of fully worked examples.
  • The book also covers advanced Android functionality such as OpenGL and native development.
About the Author
Reto Meier is Google's lead Android Developer Advocate for Europe, the Middle East, and Africa. Reto's development approach is focused on delivering intuitive applications with compelling user interfaces, optimally designed for the working environment of end users. His blog posts and tutorials regularly appear on the official Android Developer blog as well as his own blog. With over 5.5k followers on Twitter he has developed a strong social network following.
Table of Contents
  • Introduction
  • Hello, Android
  • Getting Started
  • Creating Applications and Activities
  • Building User Interfaces
  • Intents and Broadcast Receivers
  • Using Internet Resources
  • Files, Saving State, and Preferences
  • Databases and Content Providers
  • Working in the Background
  • Expanding the User Experience
  • Advanced User Experience
  • Hardware Sensors
  • Maps, Geocoding, and Location-Based Services
  • Invading the Home Screen
  • Audio, Video, and Using the Camera
  • Bluetooth, NFC, Networks, and Wi-Fi
  • Telephony and SMS
  • Advanced Android Development
  • Monetizing, Promoting, and Distributing Applications
  • Index


Download Now


Download Now

Thursday, 19 February 2015

storage class in c

Storage class in C

  • Automatic variables
  • External variables
  • Static variables
  • Register variables
  • Scopes and longevity of above types of variables.

Few terms

  • Scope: the scope of a variable determines over what part(s) of the program a variable is actually available for use(active).
  • Longevity: it refers to the period during which a variables retains a given value during execution of a program(alive)
  • Local(internal) variables: are those which are declared within a particular function.
  • Global(external) variables: are those which are declared outside any function.

Automatic variables

  • Are declare inside a function in which they are to be utilized.
  • Are declared using a keyword auto           eg. auto int number;
  • Are created when the function is called and destroyed automatically when the function is exited.
  • This variable are therefore private(local) to the function in which they are declared.
  • Variables declared inside a function without storage class specification is, by default, an automatic variable.

Example program

int main()
{ int m=1000;
  int m = 10;
{  int m = 100;

Few observation about auto variables

  • Any variable local to main will normally live throughout the whole program, although it is active only in main.
  • During recursion, the nested variables are unique auto variables.
  • Automatic variables can also be defined within blocks. In that case they are meaningful only inside the blocks where they are declared.
  • If automatic variables are not initialized they will contain garbage.
External Variables
  • These variables are declared outside any function. 
  • These variables are active and alive throughout the entire program.
  • Also known as global variables and default value is zero.
  • Unlike local variables they are accessed by any function in the program.
  • In case local variable and global variable have the same name, the local variable will have precedence over the global one.
  • Sometimes the keyword extern used to declare these variable.
  • It is visible only from the point of declaration to the end of the program.

External variable (examples)

int number;
float length=7.5;
{ . . .
  . . .
{. . .
 . . .
{. . .
 . . .

Global variable example

int x;
int main()
int fun1()
 { x=x+10;
 int fun2()
 { int x

External declaration

int main()
  . . .
  . . .
int y;


External declaration(examples)

int main()
  extern int y;
  . . .
  . . .
 extern int y;
 . . .
 . . .
int y;

Multifile Programs and extern variables

int main()
    extern int m;
    int i
    . . .
    . . .
     int j;
     . . .
     . . .

Multifile Programs and extern variables

int m;
int main()
    int i;
    . . .
    . . .
     int j;
     . . .
     . . .

Static Variables

  • The value of static variables persists until the end of the program.
  • It is declared using the keyword static like
  •                    static int x;
  •                    static float y;
  • It may be of external or internal type depending on the place of there declaration.
  • Static variables are initialized only once, when the program is compiled.

Internal static variable

  • Are those which are declared inside a function.
  • Scope of Internal static variables extend upto the end of the program in which they are defined.
  • Internal static variables are almost same as auto variable except they remain in existence (alive) throughout the remainder of the program.
  • Internal static variables can be used to retain values between function calls.
  • Examples (internal static)
  • Internal static variable can be used to count the number of calls made to function. eg.

int main()
  int I;
  for(i =1; i<=3; i++)
void stat()
  static int x=0;
  x = x+1;
  printf(“x = %d\n”,x);

External static variables

  • An external static variable is declared outside of all functions and is available to all the functions in the program.
  • An external static variable seems similar simple external variable but their difference is that static external variable is available only within the file where it is defined while simple external variable can be accessed by other files.
Static function
  • Static declaration can also be used to control the scope of a function.
  • If you want a particular function to be accessible only to the functions in the file in which it is defined and not to any function in other files, declare the function to be static. eg.

          static int power(int x inty)
                  .   .   .
                  .   .   .

Register Variable

  • These variables are stored in one of the machine’s register and are declared using register keyword. 
  •             eg. register int count;
  • Since register access are much faster than a memory access keeping frequently accessed variables in the register lead to faster execution of program.
  • Since only few variable can be placed in the register, it is important to carefully select the variables for this purpose. However, C will automatically convert register variables into non register variables  once the limit is reached.
  • Don’t try to declare a global variable as register. Because the register will be occupied during the lifetime of the program.

Friday, 13 February 2015

Swine Flu:Know & Preventive Steps

Human swine flu is a highly contagious respiratory disease caused by a new strain of influenza virus. Symptoms of human swine flu include a fever (temperature over 38°C), cough, sore throat, aches and tiredness. Human swine flu is also known as human swine influenza, influenza A (H1N1) virus or H1N1 influenza 09.

The name ‘swine flu’ comes from a strain of the virus that is found in pigs. In 2009, a new strain of the swine flu virus that affects humans was identified. Cases of human swine flu have been confirmed in countries throughout the world including Australia. 

Despite some deaths in Victoria, the majority of cases of human swine flu have so far been mild and can be compared to the normal seasonal flu. Most people recover without any medical treatment. However, like seasonal flu, human swine flu may make underlying chronic medical conditions worse in vulnerable people. 

Seasonal flu 

The virus now circulates worldwide as one of three seasonal flu viruses. The other viruses are influenza virus B and influenza virus A/H3N2.

The symptoms of flu caused by the H1N1pdm09 virus are similar to those of other types, and include:
  • a sudden fever – a temperature of 38C (100.4F) or above
  • tiredness
  • aching muscles or joint pain
  • a headache
  • a runny or blocked nose
Most people recover within a week, even without special treatment.
However, some people are at a higher risk of complications and are recommended to have the seasonal flu jab. The 2014-15 seasonal flu jab includes protection against three types of flu virus, including H1N1pdm09.
10 Preventive Steps to keep Swine-Flu Away
They say prevention is better than cure and now that Swine Flu is spreading like Wildfire in India too, we need to come up with some proactive measures so that we are not a victim of the deadly disease. Here are 10 things you can do to protect yourself from the virus. 

1. Wash your hands frequently 

Use the antibacterial soaps to cleanse your hands. Wash them often, at least 15 seconds and rinse with running water. Use Alcohol based hand Sanitizer frequently

2. Get enough sleep 

Try to get 8 hours of good sleep every night to keep your immune system in top flu-fighting shape. 

3. Keep hydrated 

Drink 8 to10 glasses of water each day to flush toxins from your system and maintain good moisture and mucous production in your sinuses. 

4. Boost your immune system 

Keeping your body strong, nourished, and ready to fight infection is important in flu prevention. So stick with whole grains, colorful vegetables, and vitamin-rich fruits. 

5. Keep informed 

The government is taking necessary steps to prevent the pandemic and periodically release guidelines to keep the pandemic away. Please make sure to keep up to date on the information and act in a calm manner. 

6. Avoid alcohol 

Apart from being a mood depressant, alcohol is an immune suppressant that can actually decrease your resistance to viral infections like swine flu. So stay away from alcoholic drinks so that your immune system may be strong. 

7. Be physically active 

Moderate exercise can support the immune system by increasing circulation and oxygenating the body. For example brisk walking for 30-40 minutes 3-4 times a week will significantly perk up your immunity. 

8. Keep away from sick people 

Flu virus spreads when particles dispersed into the air through a cough or sneeze reach someone else's nose. So if you have to be around someone who is sick, try to stay a few feet away from them and especially, avoid physical contact. 

9. Know when to get help 

Consult your doctor if you have a cough and fever and follow their instructions, including taking medicine as prescribed. 

10. Avoid crowded areas 

Try to avoid unnecessary trips outside. Moreover, avoid touching your eyes, nose or mouth. Germs spread this way. We all want a Healthy India.

Most symptoms are the same as seasonal flu. They can include:
    • cough.
    • fever.
    • sore throat.
    • stuffy or runny nose.
    • body aches.
    • headache.
    • chills.
    • fatigue.

Wednesday, 11 February 2015

Android Lollipop(5.x)

B) :woohoo: What is Android Lollipop(5.x)? B) :woohoo:

Android Lollipop is the latest version of Android which was previewed at Google I/O.
It features a number of significant updates, the most obvious of which is a new look with Google rolling out a new design language called Material Design which allows developers create layers within their apps.
Google has also deeply integrated its Android Wear platform with Android Lollipop, allowing users unlock smartphones without a pin code if they are wearing a smartwatch.
Notifications have also been given a make-over, allowing users respond to notifications directly from the lock screen.
Under the hood, Google is also working to improve battery life (Project Volta) and now supports 64-bit chips and promises to improve performance thanks to a move entirely to Android Runtime (ART).


User Interface

Material Support in Lollipop
• The material theme
• View Shadows
• The RecyclerView Widget
• Drawable animation and styling effects
• Material design animation and activity transition effects
• Animators for View properties based on the state of the view
• Customizable UI widgets and app bars with color palettes that you control

Lockscreen Notifications
• Presence of notification on lockscreen
• Turn on/off sensitive notification content to be shown over a secure lockscreen

Notification Metadata
• Uses metadata associated with your app notifications to sort the notifications more intelligently

Concurrent documents and activities in the recent screen
• App can open more tasks as needed for additional concurrent activities for documents
• Facilitates multitasking by letting users quickly switch between individual activities and documents from the Recents screen

WebView Updates
• Updates the WebView to Chromium M36, bringing security and stability enhancements as well as bug fixes

ART (Android Runtime)

• Replacement of old Dalvic application runtime with ART(Android Runtime)
• Introduced in 4.4(Kitkat) as optional developer feature, further improvement in Lollipop release
• Dalvic uses JIT(Just-in-Time) compiler whereas ART uses AOT(Ahead-of-Time) compiler
• Improved garbage collection (GC)
• Improved debugging support

Power Efficiency

Scheduling Jobs
• The app has non-user-facing work that you can defer
• The app has work you'd prefer to do when the unit is plugged in
• The app has a task that requires network access (or requires a Wi-Fi connection)
• he app has a number of tasks that you want to run as a batch on a regular schedule
You can schedule task under such conditions-
• The device is charging
• The device is connected to an unmetered network
• The system deems the device to be idle
• Completion with a minimum delay or within a specific deadline

• History of battery related events
• Global statistics for the device
• Approximated power use per UID and system component
• Per-app mobile ms per packet
• System UID aggregated statistics
• App UID aggregated statistics


Support for OpenGL EL 3.1
• Compute Shaders
• Separate shader objects
• Indirect draw commands
• Multisample and stencil textures
• Shading language improvements
• Extension for advance blend mode and debugging
• Backward compatibility with OpenGL 2.0 and 3.0

Android Extension Pack
• Guaranteed fragment shader support for shader storage buffers, images, and atomics (fragment shader support is optional in OpenGL ES 3.1.)
• Tessellation and geometry shaders
• ASTC (LDR) texture compression format
• Per-sample interpolation and shading
• Per-sample interpolation and shading

Wireless and Connectivity

Multiple Network Connection
• let your app dynamically scan for available networks with specific capabilities, and establish a connection to them
• useful when your app requires a specialized network, such as an SUPL, MMS, or carrier-billing network, or if you want to send data using a particular type of transport protocol

Bluetooth Broadcasting
• Android device can now act as a Bluetooth LE peripheral device
• Apps can use this capability to make their presence known to nearby devices
• build apps that allow a device to function as a pedometer or health monitor and communicate its data with another BLE device

NFC enhancement(enable wider and more flexible use of NFC)
• Android Beam is now available in the share menu


Camera API for advanced camera capabilities
• Introduces new API to facilitate fine-grain photo capture and image processing

Audio playback
• Supply audio data in floating point format
• This permits grater dynamic range, more consistent precision and grater headroom