Pages

Minggu, 14 Agustus 2011

Android Interview Question Answer

1.Describe the APK format?
  The APK file is compressed the AndroidManifest.xml file,application code(.dex files),resource files &    other  files.A Project is compiled into a single.apk file.

2.what is an action?
  A description of something that an Intent sender describes.

3.what is activity?
  A single screen in an application,with supporting java code.

4.what is intent?
  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.

5.How is nine-patch image different from a regular bitmap?
  It is a resizable bitmap resource that can be used for background or other images on the device.The Nine Patch class permits drawing in nine sections.The four corners are unscaled;the four edges are scaled in one axis,and the middle is scaled in both axes.

6.what languages does Android support for application development?
  Android applications are written using the java programming language.

7.what is resource?
  A user-supplied XML,bitmap,or other file,injected into the application build process,which can later be loaded from code.

8.How will you record a phone call in Android?How to get a handle on Audio Stream for a call in Android?
  Permissions.PROCESS_OUTGOING_CALLS:Allows an application to monitor,modify,or abort outgoing calls.

9.What's the difference between file,class and activity in android?
  File-It is a block of arbitrary information,or resource for storing information.It can be of any type.
  Class-Its 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.

10.What is a Sticky Intent?
   SendStickyBroadcasr() 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.

11.Is Bionic (Google's version of libc)dynamic linked?
   yes,all libs are dynamically linked.

12.Does Android have  USB support?External Keyboard.etc?
    The Hardware should support it but its not enabled in the software.Maybe in a point release.

13.what is the next version of the SDK?
   No major surprise.We are cleaning up APIs.Making sure things are named consistently,parameters all need to be there,etc.so there's some churn.Ensuring what goes out is something
   we can support until the end of time.For example protected members might go package private so we have the option of changing later.
   On the system side,we are moving towards a tighter security policy.In M5 lots of things run as root,but in the next version almost nothing runs as root.We use the minimum privileges necessary.

14.Will there be a central registery for intents?
   That should like a period opportunity for a 3rd party developer.Intents use package naming conventions to prevent collisions,like com.google.something.

15.Have any advice on general portability strategies;Android,Brew,etc.?
   Emphasize the commanality between platforms,common proile support,separation between main logic and front end interface.Eventually somebody will add J2ME APIs
   into the Android platform.But the user interface level you will want to tie into platform-specific things(for the best user experience).Access to the web is standard
   across all platforms.

16.Can I deploy linux apps on real handsets?With a modified Qemu?
   Expect the Android framework to run on top of other mobile Linux efforts?
   Qemu depends on OEM or carrier.Its possible that upgrades may have to be signed by carrier.As far as native code goes,we dont currently have a bunch of the standard Unix X type stuff in
   there.command line stuff compiles and runs as is.Expect that once this is open sourced,people will bolt on an X sever and traditional Unix/Linux into the framework.While java is the
   primary development language for Android 1.0,the system has been designed to support multiple platforms including native.Also expect the Android framework to run on top of other
   mobile Linux efforts.
   Example:Web browser WebKit is c++ based,and there's java chrome on top of that.For debugging I use gdb server to debug native code.JNI layer talks between c++ and java.

17.Is the magnifier widget shown in the opening session specific to the browser or can i use it in my apps?
   That one is specific to browser.It's implemented in the native part of browser.  

18.Gears will eventually be supported on Android,can we expect thatin 1.0?
   It's under investigation.cant guarantee on 1.0,but we would like to have it there.

19.Do you plan to support an extension mechanism like plug-ins?for example secure web site user certificate storage is not supported,and there is no mechanism to add it?
   We dont have the full plug-in support.Partial MPPI support ...we are still working on it.Probably not finished by 1.0.
   Note:we do have the HTTPS support now.

20.Is there info on the UI toolkit,animation effects,compostion,effects,and what is it based on?
   We have a couple different approaches to drawing.We have full support for OpenGL Es,and use hardware support if its there.For more conventional UI,apps use the view system
   documented in the SDK.This site on top of graphics layer,Canvas SGL.

21.Does Android complete with JavaFX mobile?
   The world doesnt need another operating system.The world needs an open embedded web operating system,open source.(Andy:)I haven't seen anything that encompasses as much as Android.

22.We do social apps.We have javascript expertise but not java.Is there an API running on localhost to fetch geo locations?
   There's a browser and web view .If you want to write local.If  you use the embedded web view you can have Java binding.javascript calls java in embedding app.You get your own icon,your own storage,your own
   world in which to operate.

23.(From Android Software company)Will there be any Android developer events in India?
    That makes sense but I'm not sure if any are planned right now.

24.If a small device manufufacturer wants to run Android,can they just download  it and go?Once it's open source ,anyone can download and port Android without joining OHA?
   Once it's open  source,anyone can download and port Android without joining OHA.Android will be open source before the end of the year.

25.(From 7 networks mobile messaging software).Can you comment on power management features?How can developers extend battery life?
   A the kernel level,it goes into low power states even when running.Android supports wake locks.does it at the platform level so apps dont have to request that from the kernel.We are trying
   to be smart about it.for example,a network event wakes up system,but may not even wake up the screen.There are two classes of timers-real time timers that can trigger even
   when device is asleep(like alarms),and free-running timers that only run when device is awake.we are also working on some visibility to the user,so they can tell what apps are
   contributing to the device being awake.We are hoping to set some good examples with core apps,and also provide a way for the end user to see what's keeping their device awake and
   be able to uninstall badly behaved apps.similar to finding out what's storage space or CPU time.

26.We are working on seamless mobility between cell and wifi calls.Can apps trigger Wifi scanning?search for SSIDs?
   Wifi support ,we have been adding.There's the connection manager that can see SSIDs,associate,and it supports a number of authentication schemes.

27.Can a 3rd party application initiate a wifi scan?
   Yes,if it has permission.

28.I want to use native phone dialer to make voip calls,can i do that?
   We already have hooks for that.system sends an intent,which can be intercepted.

29.Can I intercept incoming calls too?
   Not sure,there are security issues.

30.A VOIP app wants to route audio to earpiece.Normally apps dont use earpiece possible?
   Post to forum or bug request.The system can do audio routing but i dont know if it's been exposed to top level APIs.

31.Will Android support data from router/wifi?
   Yes,Its not fully enabled in 1.0 but you can even use bluetooth as an interface(ethernet over bluetooth).Ethernet over USB too,on Linux it works great,but
   some driver work is needed for windows and OSX.

32.How to select more than one option from list in android xml file?Give example?
   Specify android id,layout height and width as depicted in the following example.
   <ListView android:id="@+id/ListView01" android:layout-height="wrap_content" android:layout_width="fill_parent"></ListView>

0 komentar:

Posting Komentar