Archive for 2014

Google Play Services Migration(new Google Admob Tutorial)

Monetize and Analyze your Android apps with  Google's AdMob

In this tutorial, you will learn how to integrate the new Google Admob with banner and interstitial ads into your Android application. The new AdMob is a streamlined user interface, to make it even easier for you to monetize and promote your apps in minutes.Monetize your apps with ads from over a million Google advertisers worldwide. Get access to programmatic demand and best-in class mediation tools to maximize revenues effortlessly.On Aug. 1 2014, Google Play will stop accepting new or updated apps using the standalone Google Mobile Ads SDKs v6.4.1 or lower.So Google Mobile Ads is now offered through Google Play services. This is the recommended way of enabling ads on your Android app.
Getting Started:
1.Sign up as an Admob Publisher here. Log in to your dashboard once you have your account approved.
2.Open the Monetize tab and create an ad unit for your application. You should be able to see your ad unit after selecting an app on your left panel.
3.Download the new Google Play Services Library using the Android SDK Manager in your Eclipse IDE.

4.Import Google Play Services Library into your Eclipse IDE. I’ve found mine in D:\Eclipse\sdk\extras\google\google_play_services\libproject . You will have to search the folder yourself.

5.Create a new project in Eclipse File > New > Android Application Project. Fill in the details and name your project AdmobTutorial.
Application Name : AdmobTutorial
Project Name : AdmobTutorial
Package Name : com.srinoid.admobtutorial
6.After created your project, You have to set Google Play Services Library as a reference project to your project.
7.Import Google Play Services Library into your App.

8.In your AndroidManifest.xml, we need to declare an activity for Google Play Services and permissions to allow the application to access to the Internet and check network status. Open your AndroidManifest.xml and paste the following code.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.srinoid.admobtutorial"
    android:versionCode="1"
    android:versionName="1.0" >
     <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
 <!--Google Play Service Meta-data Info -->
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
 <!-- AdActivity Declaration-->
        <activity
            android:name="com.google.android.gms.ads.AdActivity"
 android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
    </application>
</manifest>
9.Next, create an XML graphical layout for your MainActivity. Go to res > layout > Right Click on layout > New > Android XML File
Name your new XML file activity_main.xml and paste the following code.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
 <!--Creating AdView in XML and loading an ad-->
    <com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ads:adSize="BANNER"
        ads:adUnitId="Place adunitid here" />
</LinearLayout>

10.Open your MainActivity.java and paste the following code
package com.srinoid.admobtutorial;
//Importing Library Classes  
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.InterstitialAd;
 import android.os.Bundle;
import android.app.Activity;
 public class MainActivity extends Activity {
    private InterstitialAd interstitial;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // Get the view from activity_main.xml
        setContentView(R.layout.activity_main);
         // Prepare the Interstitial Ad
        interstitial = new InterstitialAd(MainActivity.this);
        // Insert the Ad Unit ID
        interstitial.setAdUnitId("Place your AdUnitId Here");
         //Locate the Banner Ad in activity_main.xml
        AdView adView = (AdView) this.findViewById(R.id.adView);
         // Request for Ads
        AdRequest adRequest = new AdRequest.Builder()
         // Add a test device to show Test Ads
         .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
         .addTestDevice("Place your test device id here")
                .build();
         // Load ads into Banner Ads
        adView.loadAd(adRequest);
         // Load ads into Interstitial Ads
        interstitial.loadAd(adRequest);
         // Prepare an Interstitial Ad Listener
        interstitial.setAdListener(new AdListener() {
            public void onAdLoaded() {
                // Call displayInterstitial() function
                displayInterstitial();
            }
        });
    }
    public void displayInterstitial() {
        // If Ads are loaded, show Interstitial else show nothing.
        if (interstitial.isLoaded()) {
            interstitial.show();
        }
    }
}
11. For More Information about Google Play Services Migration please go through the following  link


Android UI Design Guidelines

Android UI Design Guidelines

  • Android powers millions of phones, tablets, and other devices in a wide variety of screen sizes and form factors. By taking advantage of Android's flexible layout system, you can create apps that gracefully scale from large tablets to smaller phones.
  • Android runs on a variety of devices that offer different screen sizes and densities.
  • Android’s multiple devices and form factors make it feel like designing for it is an uphill battle.
  • Be flexible
      Stretch and compress your layouts to accommodate various heights and widths.
  • Optimize layouts
      On larger devices, take advantage of extra screen real estate. Create compound views that combine multiple views to reveal more content and ease navigation.
  • Assets for all
      Provide resources for different screen densities (DPI) to ensure that your app looks great on any device.
  • Devices vary not only in physical size, but also in screen density (DPI). To simplify the way you design for multiple screens, think of each device as falling into a particular size bucket and density bucket:
    • The size buckets are handset (smaller than 600dp) and tablet (larger than or equal 600dp).
    • The density buckets are LDPI, MDPI, HDPI, XHDPI, XXHDPI, and XXXHDPI.
  • To keep things simple, Android breaks down physical screen sizes (measured as the screen’s diagonal length from the top-left corner to bottom-right corner) into four general sizes: small, normal, large and xlarge.

  • Optimize your application's UI by designing alternative layouts for some of the different size buckets, and provide alternative bitmap images for different density buckets.

  • Notice: one dp (density-independent pixel) is one pixel on a 160 DPI screen.
  • Views dimensions and spacing
    • Touchable UI components are generally laid out along 48 dp units. Spacing between each UI element is 8 dp.

  • Text Size:
      The Android framework uses the following limited set of type sizes:
                                     Text size micro --------------------- 12sp
                                     Text Size Small ----------------------14sp
                                     Text Size Medium ------------------18sp
                                     Text Size Large ---------------------22sp
            Notice: one sp (scale-independent pixel) is one pixel on a 160 DPI screen if the user's global text scale is set to 100%.
  • Colors:
      Use color primarily for emphasis. Blue is the standard accent color in Android's color palette. Note that red and green may be indistinguishable to color-blind users.
              More Information refer following site:
                    http://developer.android.com/design/style/color.html
  • Iconography:
    • An icon is a graphic that takes up a small portion of screen real estate and provides a quick, intuitive representation of an action, a status, or an app.
    • When you design icons for your app, it's important to keep in mind that your app may be installed on a variety of devices that offer a range of pixel densities, as mentioned in Devices and Displays. But you can make your icons look great on all devices by providing each icon in multiple sizes.
    • When your app runs, Android checks the characteristics of the device screen and loads the appropriate density-specific assets for your app.

      Qualifier DPI Scaling factor Launcher icon Action bar, tab icon Notification icon (API 11) Notification icon (API 9) Notification icon (older)
      ldpi 120 0.75 36 x 36
      32 x 32
      24 x 24
      18 x 18
      18 x 18
      16 x 16
      12 x 19
      12 x 12
      19 x 19
      16 x 16
      mdpi 160
      48 x 48
      42 x 42
      32 x 32
      24 x 24
      24 x 24
      22 x 22
      16 x 25
      16 x 16
      25 x 25
      21 x 21
      hdpi 240 1.5 72 x 72
      64 x 64
      48 x 48
      36 x 36
      36 x 36
      33 x 33
      24 x 38
      24 x 24
      38 x 38
      32 x 32
      xhdpi 320 2.0 96 x 96
      84 x 84
      64 x 64
      48 x 48
      48 x 48
      44 x 44
      32 x 50
      32 x 32
      50 x 50
      42 x 42
      xxhdpi 480 3.0 144 x 144
      126 x 126
      96 x 96
      72 x 72
      72 x 72
      66 x 66
      48 x 75
      48 x 48
      75 x 75
      63 x 63


        • Notice: the first icon dimension in table cell is full asset size, the second icon dimension is optical square. Dimension values are in pixels.
        • Tip: creating ldpi assets is not really needed anymore. The devices are rare and the platform will just scale down mdpi.

        • So, to create an icon for different densities, you should follow the 2:3:4:6:8 scaling ratio between the five primary densities (medium, high, x-high, xx-high, and xxx-high respectively). For example, consider that the size for a launcher icon is specified to be 48x48 dp. This means the baseline (MDPI) asset is 48x48 px, and the high density (HDPI) asset should be 1.5x the baseline at 72x72 px, and the x-high density (XHDPI) asset should be 2x the baseline at 96x96 px, and so on.
        • For More Information refer following site:
          http://developer.android.com/design/style/iconography.html
      • Writing Styles:
      • Best Practices for User Interface

        • Android provides a flexible framework for UI design that allows your app to display different layouts for different devices, create custom UI widgets, and even control aspects of the system UI outside your app's window.
        • Designing for multiple Screens::
          • Android powers hundreds of device types with several different screen sizes, ranging from small phones to large TV sets. Therefore, it’s important that you design your application to be compatible with all screen sizes so it’s available to as many users as possible.

      • Naming conventions
      • Naming conventions for drawables

        • File names must contain only lowercase a-z, 0-9, or _.

        • Drawables for the specific views (ListView, TextView, EditText, ProgressBar, CheckBox etc.) should be named like this views keeping the naming rules, e.g. drawable for CheckBox should be named "checkbox_on_bg.png".

      Asset Type Prefix Example
      Action bar ab_ ab_stacked.9.png
      Button btn_ btn_send_pressed.9.png
      Dialog dialog_ dialog_top.9.png
      Divider divider_ divider_horizontal.9.png
      Icon ic_ ic_star.png
      Menu menu_ menu_submenu_bg.9.png
      Notification notification_ notification_bg.9.png
      Tabs tab_ tab_pressed.9.png
      • Naming conventions for icon assets

      Asset Type Prefix Example
      Icons ic_ ic_star.png
      Launcher icons ic_launcher ic_launcher_calendar.png
      Action bar icons ic_menu ic_menu_archive.png
      Status bar icons ic_stat_notify ic_stat_notify_msg.png
      Tab icons ic_tab ic_tab_recent.png
      Dialog icons ic_dialog ic_dialog_info.png
      • Naming conventions for selector states

      State
      Suffix Example
      Normal _normal btn_order_normal.9.png
      Pressed _pressed btn_order_pressed.9.png
      Focused _focused btn_order_focused.9.png
      Disabled _disabled btn_order_disabled.9.png
      Selected _selected btn_order_selected.9.png

      Android DP / PX converter

Generate signed APK for Android Application

Generate signed APK for Android Application

        After you finished your Android application development, you must generate signed APK for that Application because only signed APK will be accepted by Google Play store.So before uploading APK into Google play you have to sign it.
Android APK Sign Process:
Step 1:- In Eclipse IDE, right click on your project in Package Explorer. -> Select Android Tools -> Select Export Signed Application Package
Step 2:- Then Project Checks Window will be open ->Click on Browse -> Make sure the correct project is selected -> and click Next
Step 3:-Keystore Selection window will open ->there we have 2 radion buttons one is Use existing keystore and another one is Create new keystore -> If you are already created keystore then browse and select it or else you can create one keystore for that app.(Note:-For each and every Android app have one unique keystore.) ->Select the keystore file location, and enter password. Then click Next.
Note:-If you are not created Keystore select create new keystore radio button and browse where you need to save that keystore then enter password and confirm password,then click Next .
Step 4:-Key Creation window will open -> Enter Alias, password, confirm, number of validity years, and at least one Certificate issuer field. -> then click Next
Step 5:-Destination window will open -> Select destination of the APK file(Storage Location of Signed APK file). and click Finish.

Android FAQs

ANDROID FAQs
INTRODUCTION TO ANDROID:
       Android is a software stack for mobile devices that includes an operating system, middle ware and key application. Android is a software platform and operating system for mobile devices based on the Linux operating system and developed by Google and the Open Handset Alliance.
     The unveiling of the Android platform on 5 November 2007  was announced with the founding of the Open Handset Alliance, a consortium of 34 hardware, software and telecom companies devoted open standard for mobile devices. When released in 2008, most of the Android platform will be made available under the Apache free-software and Open-source-license.

THE BIRTH OF THE ANDROID:

Google Acquire Android Inc.
        In July 2005, Google acquire Android Inc, a small company based in PolaAlto, CA. Android co-founder who went to work with Google included Andy Rubin(co-founder of Danger), Rich Miner(co-founder of Wildlife communication, Inc), Nick Seares(once VP @ T-Mobile), and Chris White(one of the first engineer at WebTV). At the time, little was about the function of Android Inc. other than they made software for mobile-phones.

OPEN HANDSET ALLIANCE FOUNDED:

        On 5 November 2007, the open Handset Alliance, a consortium of several companies which included Google, HTC, Intel, Qualcomm, T-Mobile, Sprint Nextel and NVIDIA, was unveiled with the goal to develop open standards for mobile devices. Along with the OHA also unveiled their first product, Android, an open source mobile devices platform based on the Linux operating system.

1.What are the prerequisites to learn the Android?
Ans:-Core Java
          OOPS Concepts, Exception Handling, Multithreading, IOStreams, Collection Frame Work….
2.What is Android?
Ans:-android is a mobile application development platform, that consist mobile operating system, middle ware Services and android key applications.
What is platform?
Platform is an environment using which we can able to run an application…
3.What is mobile Operating System?
Ans: - A mobile operating system (mobile OS) is the operating system that controls a smart phone, tablet, PDA, or other mobile device.
  • It will occupy 20MB-40MB
  • If u wants to run an application in hardware we need one OS.
  • Modern mobile operating systems combine the features of a personal computer operating system with touch screen, cellular, Bluetooth, Wi-Fi, GPS mobile navigation, camera, video camera, speech recognition, voice recorder, music player, near field communication, personal digital assistant (PDA), and other features.

 Different Mobile Operating Systems:
           Android from Google.
           Symbian OS from Nokia.
           Black Berry from RIM
           IOS from Apple.
           Windows Phone from Microsoft.
           Fire OS from Amazon
           Tizan OS
           Firefox OS
4.What are the advantages   and Features of Android?
Ans: - The following are the advantages of Android:
  •   The customer will be benefited from wide range of mobile applications to choose, since the monopoly of wireless carriers like AT&T and Orange will be broken by Google Android.
  • Features like weather details, live RSS feeds, opening screen, icon on the opening screen can be customized
  • Innovative products like the location-aware services, location of a nearby convenience store etc., are some of the additive facilities in Android.Components can be reused and replaced by the application framework.
  • Optimized DVM for mobile devices
  • SQLite enables to store the data in a structured manner.
  • Supports GSM telephone and Bluetooth, WiFi, 3G and EDGE technologies
  • The development is a combination of a device emulator, debugging tools, memory profiling and plug-in for Eclipse IDE.

The following are the Features of Android:
  • Application framework enabling reuse and replacement of components.
  • Dalvik virtual machine optimized for mobile devices.
  • Integrated browser based on the open source Web Kit engine.
  • Optimized graphics powered by a custom 2D graphics library; 3D, graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional)
  • SQLite for structured data storage.
  • Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF).
  •  GSM Telephony (hardware dependent).
  • Bluetooth, EDGE, 3G, and Wi-Fi (hardware dependent).
  • Camera, GPS, compass, and accelerometer (hardware dependent).
  •  Rich development environment including a device emulator, tools for debugging, memory and performance profiling, and a plug-in for the Eclipse IDE.

5.Describe Android Application Architecture.
Ans:- Android Application Architecture has the following components:
• Services – like Network Operation
• Intent – To perform inter-communication between activities or services
• Resource Externalization – such as strings and graphics
• Notification signaling users – light, sound, icon, notification, dialog etc.
• Content Providers – They share data between applications

6. Describe the APK format.
Ans:- The APK file is compressed the AndroidManifest.xml file, application code (.dex files), resource files, and other files. A project is compiled into a single .apk file.
7. What is .apk extension? 
The extension for an Android package file, which typically contains all of the files related to a single Android application. The file itself is a compressed collection of an AndroidManifest.xml file, application code (.dex files), resource files, and other files. A project is compiled into a single .apk file.
8. What is .dex extension ?
Ans:- Android programs are compiled into .dex (Dalvik Executable) files, which are in turn zipped into a single .apk file on the device. .dex files can be created by automatically translating compiled applications written in the Java programming language
9. What is an ADB ?
Ans:- Android Debug Bridge, a command-line debugging application shipped with the SDK. It provides tools to browse the device, copy tools on the device, and forward ports for debugging.
10. What is an Application ?
Ans:- A collection of one or more activities, services, listeners, and intent receivers. An application has a single manifest, and is compiled into a single .apk file on the device.
11. What is a Content Provider ?
Ans:- A class built on ContentProvider that handles content query strings of a specific format to return data in a specific format. See Reading and writing data to a content provider for information on using content providers.
12. What is a Dalvik ?
Ans:- The name of Android’s virtual machine. The Dalvik VM is an interpreter-only virtual machine that executes files in the Dalvik Executable (.dex) format, a format that is optimized for efficient storage and memory-mappable execution. The virtual machine is register-based, and it can run classes compiled by a Java language compiler that have been transformed into its native format using the included “dx” tool. The VM runs on top of Posix-compliant operating systems, which it relies on for underlying functionality (such as threading and low level memory management). The Dalvik core class library is intended to provide a familiar development base for those used to programming with Java Standard Edition, but it is geared specifically to the needs of a small mobile device.
13. What is an DDMS? 
Ans:- Dalvik Debug Monitor Service, a GUI debugging application shipped with the SDK. It provides screen capture, log dump, and process examination capabilities.
14. What is Drawable? 
Ans:- A compiled visual resource that can be used as a background, title, or other part of the screen. It is compiled into an android.graphics.drawable subclass.
15. What is an Intent?
Ans:-A class (Intent) that contains several fields describing what a caller would like to do. The caller sends this intent to Android’s intent resolver, which looks through the intent filters of all applications to find the activity most suited to handle this intent. Intent fields include the desired action, a category, a data string, the MIME type of the data, a handling class, and other restrictions.
16. What is an Intent Filter ?
Ans:-Activities and intent receivers include one or more filters in their manifest to describe what kinds of intents or messages they can handle or want to receive. An intent filter lists a set of requirements, such as data type, action requested, and URI format, that the Intent or message must fulfill. For Activities, Android searches for the Activity with the most closely matching valid match between the Intent and the activity filter. For messages, Android will forward a message to all receivers with matching intent filters.
17. What is an Intent Receiver? 
Ans:- An application class that listens for messages broadcast by calling Context.broadcastIntent
18. What is a Layout resource?
Ans:- An XML file that describes the layout of an Activity screen.
19. What is a Manifest ?
Ans:- An XML file associated with each Application that describes the various activies, intent filters, services, and other items that it exposes.
20. What is a Resource ?
Ans:- A user-supplied XML, bitmap, or other file, entered into an application build process, which can later be loaded from code. Android can accept resources of many types; see Resources for a full description. Application-defined resources should be stored in the res/ subfolders.
21. What is a Service ?
Ans:- A class that runs in the background to perform various persistent actions, such as playing music or monitoring network activity.
22. What is a Theme ?
Ans:-A set of properties (text size, background color, and so on) bundled together to define various default display settings. Android provides a few standard themes, listed in R.style (starting with “Theme_”).
23. What is an URIs? 
Ans:-Android uses URI strings both for requesting data (e.g., a list of contacts) and for requesting actions (e.g., opening a Web page in a browser). Both are valid URI strings, but have different values. All requests for data must start with the string “content://”. Action strings are valid URIs that can be handled appropriately by applications on the device; for example, a URI starting with “http://” will be handled by the browser.
24. Can I write code for Android using C/C++?
Ans:-Yes, but need to use NDK
Android applications are written using the Java programming language. Android includes a set of core libraries that provides most of the functionality available in the core libraries of the Java programming language.
Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so that a device can run multiple VMs efficiently. The Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. The VM is register-based, and runs classes compiled by a Java language compiler that have been transformed into the .dex format by the included “dx” tool.
Android only supports applications written using the Java programming language at this time.
25. What is an action?
Ans:-A description of something that an Intent sender desires.
26. What is activity?
Ans:-A single screen in an application, with supporting Java code.
27. What is intent?
Ans:-A class (Intent) describes what a caller desires to do. The caller sends this intent to Android’s intent resolver, which finds the most suitable activity for the intent. E.g. opening a PDF file is an intent, and the Adobe Reader is the suitable activity for this intent.
28. How is nine-patch image different from a regular bitmap?
Ans:-It is a resizable bitmap resource that can be used for backgrounds or other images on the device. The NinePatch class permits drawing a bitmap in nine sections. The four corners are unscaled; the four edges are scaled in one axis, and the middle is scaled in both axes.
29.What languages does Android support for application development?
Ans:-Android applications are written using the Java programming language.
30. What is a resource?
Ans:-A user-supplied XML, bitmap, or other file, injected into the application build process, which can later be loaded from code.
31. How will you record a phone call in Android? How to get a handle on Audio Stream for a call in Android?
Ans:-Permissions.PROCESS_OUTGOING_CALLS: Allows an application to monitor, modify, or abort outgoing calls.
32.What’s the difference between file, class and activity in android? 
Ans:-File – It is a block of arbitrary information, or resource for storing information. It can be of any type.
Class – It’s a compiled form of .Java file . Android finally used this .class files to produce an executable apk
Activity – An activity is the equivalent of a Frame/Window in GUI toolkits. It is not a file or a file type it is just a class that can be extended in Android for loading UI elements on view.
33. What is a Sticky Intent?
Ans:-sendStickyBroadcast() performs a sendBroadcast (Intent) that is “sticky,” i.e. the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of registerReceiver (BroadcastReceiver, IntentFilter). In all other ways, this behaves the same as sendBroadcast(Intent).
One example of a sticky broadcast sent via the operating system is ACTION_BATTERY_CHANGED. When you call registerReceiver() for that action — even with a null BroadcastReceiver — you get the Intent that was last broadcast for that action. Hence, you can use this to find the state of the battery without necessarily registering for all future state changes in the battery.
34.Does Android support the Bluetooth serial port profile?
Ans:-Yes.
35. Can an application be started on powerup?
Ans:-Yes.
36. How to Remove Desktop icons and Widgets?
Ans:-A. Press and Hold the icon or widget. The phone will vibrate and on the bottom of the phone you will see an option to remove. While still holding the icon or widget drag it to the remove button. Once remove turns red drop the item and it is gone
37.Describe a real time scenario where android can be used?
Ans:-Imagine a situation that you are in a country where no one understands the language you speak and you cannot read or write. However, you have mobile phone with you.
With a mobile phone with android, the Google translator translates the data of one language into another language by using XMPP to transmit data. You can type the message in English and select the language which is understood by the citizens of the country in order to reach the message to the citizens.
38.How to select more than one option from list in android xml file? 
Ans:-Give an example.
Specify android id, layout height and width as depicted in the following example.
39. Explain about the exceptions of Android?
Ans:-The following are the exceptions that are supported by Android
* InflateException : When an error conditions are occurred, this exception is thrown
* Surface.OutOfResourceException: When a surface is not created or resized, this exception is thrown
* SurfaceHolder.BadSurfaceTypeException: This exception is thrown from the lockCanvas() method, when invoked on a Surface whose is SURFACE_TYPE_PUSH_BUFFERS
* WindowManager.BadTokenException: This exception is thrown at the time of trying to add view an invalid WindowManager.LayoutParamstoken.

40. What are the steps in creating a bounded service through AIDL?
Ans:-1. create the .aidl file, which defines the programming interface 
2. implement the interface, which involves extending the inner abstract Stub class as well as implanting its methods. 
3. expose the interface, which involves implementing the service to the clients.
41. What data types are supported by AIDL?
Ans:-AIDL has support for the following data types: 
string 
charSequence 
List 
Map 
all native Java data types like int, long, char and Boolean
42. What is portable Wi-Fi hotspot?
Ans:-Portable Wi-Fi Hotspot allows you to share your mobile internet connection to other wireless device. For example, using your Android-powered phone as a Wi-Fi Hotspot, you can use your laptop to connect to the Internet using that access point.
43. What are the advantages of having an emulator within the Android environment?
Ans:-
- The emulator allows the developers to work around an interface which acts as if it were an actual mobile device.
- They can write, test and debug the code.
- They are safe for testing the code in early design phase

44. What do you think are some disadvantages of Android?
Ans:-Given that Android is an open-source platform, and the fact that different Android operating systems have been released on different mobile devices, there’s no clear cut policy to how applications can adapt with various OS versions and upgrades. One app that runs on this particular version of Android OS may or may not run on another version. Another disadvantage is that since mobile devices such as phones and tabs come in different sizes and forms, it poses a challenge for developers to create apps that can adjust correctly to the right screen size and other varying features and specs.

Copyright © Srinoid