Saturday, 7 May 2016

What is the Difference Between a File, a Class and an 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.
Describe the APK Format ?

The (Android Packaging Key) APK file is compressed format of the AndroidManifest.xml file, application code (.dex files), resource files, and other files. A project is compiled into a single .apk file.
Where Can You Define the Icon for Your Activity ?

<activity android:icon="@drawable/app_icon" android:name=".MyTestActivity"></activity>


Where Will You Declare Your Activity so the System Can Sccess it ?

Activity is to be declared in the manifest file. For example:
  <activity android:name=".MyTestActivity"></activity>
How Will You Pass Data to Sub-Activities ?

We can use Bundles to pass data to sub-activities. There are like HashMaps that and take trivial data types. These Bundles transport information from one Activity to another.

        Bundle b = new Bundle();
        b.putString("EMAIL", "abc@xyz.com");
        i.putExtras(b); // where i is the intent

What is an Action ?

Action in Android glossary is something that an Intent sender wants done. It is a string value that is assigned to intent. Action string can be defined by the Android itself or by you as third party application developer.
Name the Resource that is a Compiled Visual Resource and Can be Used as a Background, Title, or in other Part of the Screen ?

 Drawable is the virtual resource that can e used as a background, title, or in other parts of the screen. It is compiled into an android.graphics.drawable subclass.