Monday 14 December 2015

Difference between an IntentService and a Service ?


When to use ?

The Service can be used in tasks with no UI, but shouldn't be too long. If you need to perform long tasks, you must use threads within Service.

The IntentService can be used in long tasks usually with no communication to Main Thread. If communication is required, can use Main Thread handler or broadcast intents. Another case of use is when callbacks are needed (Intent triggered tasks).
How to trigger ?

The Service is triggered by calling method startService().
The IntentService is triggered using an Intent, it spawns a new worker thread and the method onHandleIntent() is called on this thread.
Triggered From

The Service and IntentService may be triggered from any thread, activity or other application component.

Runs On

The Service runs in background but it runs on the Main Thread of the application.
The IntentService runs on a separate worker thread.
Limitations / Drawbacks

The Service may block the Main Thread of the application.
The IntentService cannot run tasks in parallel. Hence all the consecutive intents will go into the message queue for the worker thread and will execute sequentially.
When to stop?

If you implement a Service, it is your responsibility to stop the service when its work is done, by calling stopSelf() or stopService(). (If you only want to provide binding, you don't need to implement this method).
The IntentService stops the service after all start requests have been handled, so you never have to call stopSelf().

Tuesday 8 September 2015

What is portable wi-fi hotspot?

Portable Wi-Fi Hotspot allows you to share your mobile internet connection to other wireless device. For examples, using your Android-powered phone as a Wi-Fi Hotspot, you can use your laptop to connect to the Internet using that access-point.
What is the difference between a regular bitmap and a nine-patch images?

In general, a Nine_patch image allows resizing that can be used as background or other image size requirements for the target device. The Nine-patch refers to the way you can resize the image: 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be scaled into both axes
How to store images of an activity into android phone gallery?

MediaStore.Images.Media.insertImage(getContentResolver(),
yourBitmap,yourTitle,yourDescription);

ContentValues values = new ContentValues(); values.put(Images.Media.DATE_TAKEN, System.currentTimeMillis()); values.put(Images.Media.MIME_TYPE, "image/jpeg"); values.put(MediaStore.MediaColumns.DATA, filePath); context.getContentResolver().insert(Images.Media.EXTERNAL_CONTENT_URI, values);
What is the base class for any android application?

Application

Monday 3 August 2015

REST vs SOAP


SOAP stands for Simple Object Access Protocol. REST stands for REpresentational State Transfer.

SOAP is a XML based messaging protocol and REST is not a protocol but an architectural style.

SOAP has a standard specification but there is none for REST.

Whole of the web works based on REST style architecture. Consider a shared resource repository and consumers access the resources.

Even SOAP based web services can be implemented in RESTful style. REST is a concept that does not tie with any protocols.

SOAP is distributed computing style and REST is web style (web is also a distributed computing model).

REST messages should be self-contained and should help consumer in controlling the interaction between provider and consumer(example, links in message to decide the next course of action). But SOAP doesn’t has any such requirements.

REST does not enforces message format as XML or JSON or etc. But SOAP is XML based message protocol.

REST follows stateless model. SOAP has specifications for stateful implementation as well.

SOAP is strongly typed, has strict specification for every part of implementation. But REST gives the concept and less restrictive about the implementation.

Therefore REST based implementation is simple compared to SOAP and consumer understanding.

SOAP uses interfaces and named operations to expose business logic. REST uses (generally) URI and methods like (GET, PUT, POST, DELETE) to expose resources.

SOAP has a set of standard specifications. WS-Security is the specification for security in the implementation. It is a detailed standard providing rules for security in application implementation. Like this we have separate specifications for messaging, transactions, etc. Unlike SOAP, REST does not has dedicated concepts for each of these. REST predominantly relies on HTTPS.

Above all both SOAP and REST depends on design and implementation of the application.

Pass ArrayList From OneActivity to AnotherActivity

    public class DataWrapper implements Serializable 
     {
       private ArrayList<String> arrayList;
       public DataWrapper(ArrayList<String> data) 
        {
         this.arrayList = data;
        }
       public ArrayList<String> getArrayList() 
       {
        return this.arrayList;
       }
      }
 

    Intent intent = new Intent(SubCat1Activity.this,Full1Activity.class);
    intent.putExtra("data",new DataWrapper(MainData));
    startActivity(intent);

    DataWrapper dw = (DataWrapper) getIntent().getSerializableExtra("data");
    ArrayList<String> list = dw.getArrayList();

Friday 6 February 2015

How many application tag we can add in manifest ?

As many user wants
Which method is called when the user leaves the activity ?

onPause
Which built-in database is Android have ?

SQLite
Which are must required folders in the android application ?

src & res
What is the default permission for external storage files ?

Public
What does .apk extension stand for ?

Application Package kit
What are the different launch configurations for Android ?

Run and debug
To log messages from your app to LogCat you should use ?

android.util.Log
The root element of AndroidManifest.xml is ?

manifest
The basic building element of Android's user interface is called ?

View
Stores private primitive data in key-value pairs ?

Shared Preferences
Specify the directory name where the XML layout files are stored ?

/res/layout

Thursday 5 February 2015

the method used to access a view element of a layout resource in an activity

findViewById()
a mandatory attribute for any view inside of a containing layout manager

layout_width
Android SDK is compatible with ?

Windows
Mac
Linux

Android Apps can share data among other apps

Content Provider

difference between versioncode and versionname ?

android:versionCode
An internal version number. This number is used only to determine whether one version is more recent than another, with higher numbers indicating more recent versions. This is not the version number shown to users; that number is set by the versionName attribute. The value must be set as an integer, such as "100". You can define it however you want, as long as each successive version has a higher number. [...]


android:versionName

The version number shown to users. This attribute can be set as a raw string or as a reference to a string resource. The string has no other purpose than to be displayed to users. The versionCode attribute holds the significant version number used internally.

Fragment Life Cycle ?

onAttach()
onCreate()
onCreateView()
onActivityCreated()
onStart()
onResume()
onPaused()
onStop()
onDestroyView()
onDestroy()
onDetach()
What is the difference between activity and fragment in android ?

fragment is a part of an activity, which contributes its own UI to that activity. Fragment can be thought like a sub activity. Where as the complete screen with which user interacts is called as activity. An activity can contain multiple fragments.Fragments are mostly a sub part of an activity.

An activity may contain 0 or multiple number of fragments based on the screen size. A fragment can be reused in multiple activities, so it acts like a reusable component in activities.

A fragment can't exist independently. It should be always part of an activity. Where as activity can exist with out any fragment in it.

Tuesday 3 February 2015

What is the difference between local variables, instance variables, and class variables ?

local variables - declared in the function 
class variables - declared in class, static 
instance variables - declared in class which are non static

What is the difference between intent and intent-filter in android ?

intent is a message passing mechanism between components of android, except for content provider.
intent-filter tells about the capabilities of that component.
What is the difference between getPreferences and getSharedPreferences in android ?

getPreferences(0) - will open or create a preference file with out giving a name specifically. By default preference file name will be the current Activity name. if some one knows this, any once can access getPreference() file using that activity name.  getSharedPreferences("name",0) - will open or create a preference file with the given name. If you want to create a preference file with a specific name then use this function. If you want multiple preference files for you activity, then also you can use this function.  Note: preferences file will be with .xml extension stored in data/data/preferences folder.

Tuesday 13 January 2015

SQLite query returns a set of rows along with a pointer called  ?

cursor
A small message that is displayed to the user for a few seconds ?

Toast

A folder contains all of the source code of the application ?

src
component that responds to system-wide broadcast announcements ?

Broadcast Receiver
when background(AsyncTask) task completes ?

onPostExecute()

is an mechanism created to handle long operations that need to report UI thread ?

AsyncTask
is the callback specifies the work to be done on menu key press ?

onCreateOptionsMenu()
represents a single user interface screen ?

Activity
is used to uniquely identify the framework API revision offered by a version of the Android platform ?

Version Number
testing tests internal structures or workings of a program ?

White Box Testing

Monday 12 January 2015

What is cursor.moveToNext() ?

It will move the cursor to point to next row if it is available, else it returns false.
What is the purpose of the ContentProvider class ?

If you want to share the data of one application with the application then use content provider.  
Note: We can start an Activity, a service, and a broadcast receiver by using intents. 
But you can't start or communicate with a content provider by using intents. 
If you want to communicate with content provider then you have to use content resolver.  
1.content provider, and resolver will handle IPC(Inter process communication) mechanism when sharing data between 
2 applications. 2.content provider has the capability to handle multiple threads, when queries are coming from multiple resolvers.
When does onCreate() function of ContentProvider will be called ?

onCreate() will be called when the application containing the content provider is loaded into the memory for the first time.
Is it possible to have multiple actions in an intent-filter ?

intent-filters can have 0 - n number of actions, but if that component has only one intent-filter with 0 actions, then that component can be triggered using only explicit intents. a given intent-filter can have more than one action because, a given component can do more than one action. EG: notepad can perform two actions ACTION_VIEW & ACTION_EDIT on an existing note pad file.
what is the permission required to make a call in android, by using  ACTION_CALL ?

android.permission.CALL_PHONE

Sunday 11 January 2015

 How many types of menus are there in android ?

Options Menu - triggered when user presses menu hard key. This is deprecated starting from android 3.0. In place of options menu migrate to action bars.
Sub Menu - Menu with in a menu (only one level of sub menu is allowed).
Context Menu - Triggered when user press and hold on some view which was registered to show context menu.
What is the difference between menus and dialogs, in android ?

Menus are designed using xml, because menus will not change so frequently. You can build menus using code also when ever required. But it is not recommended to completely build menus using code.
Dialogs are built using code because dialog content will frequently change.
What is the life cycle of a started service ? 

oncreate 
onstartCommand() 
onDestroy()
What is the difference between service and intentservice in android  ? 

i  Intentservice by default will create one separate thread to handle the service functionality.
   All the startservice requests for intentservice will be routed to that thread. 
ii. Where as service by default runs in main thread. All the startservice requests will be routed to main thread by default. 
iii. While implementing a service, programmer has to implement onCreate(), onStartCommand(), and onDestroy() methods. 
iv. Where as while implementing IntentService programmer has to implement only onHandleIntent(). 
v. After starting IntentService, it will be automatically closed if there are no pending startService requests. 
vi. Where as for normal service programmer has to stop the service explicitly either by using stopSelf() or stopService() methods. 
vii. Don't try to touch UI from IntentService's onHandleIntent() method directly, as that function runs in a separate thread. (Not in main thread).

Thursday 8 January 2015

What is the difference between this context and getapplicationcontext ? 

There are two types of contexts available in android to create any component. 
1. this context (or) this pointer 
2. application context When programmer wants to create any component or control,
 then you have to use one of the contexts. 
 eg: TextView t = new TextView(this); Here we are using this pointer (context). 
 eg: static TextView st = new TextView(getApplicationContext()); 
 Here we are using application context, because it is a static variable whose life time will be through out application life time.

 If you use this pointer here, then it will leak memory (memory wastage) of your activity. 



  View.getContext()

  Returns the context the view is currently running in. Usually the currently active Activity.

  Activity.getApplicationContext()

  Returns the context for the entire application (the process all the Activities are running inside of.
  Use this instead of the current Activity context if you need a context  tied to the lifecycle of the entire 
  application, not just the current Activity. 

  ContextWrapper.getBaseContext()

  If you need access to a Context from within another context, 
  you use a ContextWrapper..
  The Context referred to from inside that ContextWrapper is accessed via  getBaseContext().

what is MODE_PRIVATE when creating shared preference file ?

only the process or application which has created that preference file can access it. other applications can't access it.
What is the difference between permission and uses-permission in android ?  

i. permission tag is used to enforce a user defined permission on a component of your application. 
ii. uses-permission tag is used to take a permission from the user for your application. 
iii. permission tag is used when you want other applications to seek permission from the user to use some of your applications components.
What is the root tag of a manifest file in android? (which will be immediately after xml tag).

manifest
What is the maximum memory limit given for each process or application in android ?

16 MB
What is android raw folder in eclipse project ?

it is used to store MP3 or other assets files
Android web browser is based on which source ?

Android web browser is based with free ware under Apache license that is web kit software.
What is APK in android, and What does .apk  file contains ?

APK - Application Package file. It is a file format used to distribute and install android applications. .apk will contain single .dex file, zipped resources, other non java library files (c/c++). .dex file will internally contains converted .class files. other wise .apk will not contains .class files.
What is R.java in android? What does it contain ?

It is automatic generated file, which have pointers to all resources used in the application.
Where all I can use Android ?

cars, watches, phones, tablets, laptops, robots, washing machines, traffic controllers, head phones, goggles, TVs.
What type of kernel is used in Android ?

Linux modified kernel (Monolithic) is used in Android
Android is released under which license ?

Android is freeware, it is under Apache license but only kernel layer is under GPL license.
Which company has released first android phone ?

In 2008 first android phone came from HTC.
which programming language should be used to create applications in Android ?

At the initial stages android application development was limited to use only Java. But later with NDK (Native Development Kit) programmers can use C & C++ to write applications. Recently there has been lot of support for lot of scripting languages as well.
What are the four essential states of an activity ?

  Active – if the activity is at the foreground
  Paused – if the activity is at the background and still visible
  Stopped – if the activity is not visible and therefore is hidden or obscured by another

  activity
  Destroyed – when the activity process is killed or completed terminated
Which component is not started by an intent ?

we use content resolver to start or communicate with content providers.

What are the permissions required to obtain phone locations ?

android.permission.ACCESS_FINE_LOCATION - use this if you are using GPS features in your programming. 
android.permission.ACCESS_COARSE_LOCATION - use this if you are fetching locations based on career network or by using WiFi.
In which library GeoCoder class is located  ?

GeoCoding is part of location's package. It is not related with Maps library.
What are the permissions required to access phone's location using NETWORK_PROVIDER ?

ACCESS_FINELOCATION
ACCESS_COARSE_LOCATION

NETWORK_PROVIDER will fetch locations either by using WiFi point or cell tower information. for cell tower we have to use COARSE_LOCATION permission and for WiFi we have to use FINELOCATION permission.

How to find whether GPS is disabled in the phone ?

if it is disabled onProviderDisabled() will be called with provider name.
How to get phone location? which is better network provider or GPS provider ?

You can either use your cell tower information or WiFi information to know your phone location.
How to create a SensorManager object to access and view list of sensors available in the phone ?

SensorManager s = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
What is the package name of HTTPClient ?

org.apache.http.client
What is the package name of JSONObject, JSONArray ?

org.json
To use HTTPClient, which permission is required in an android application ?

android.permission.INTERNET is mandatory for any HTTPRequest, as we are fetching or posting information using internet or by using network connection.

Wednesday 7 January 2015

If internet permission is not taken to use HTTP Client, then what will happen ?

With out internet permission, it will throw UnknownHostException which is part of IOException.
How To Send SMS Message In Android  ?

  SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage("phoneNo", null, "sms message", null, null);

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.putExtra("sms_body", "Hii.....  i m Naveen Tamrakar an Android Developer from 
        Sehore(Bhopal)"); 
intent.setType("vnd.android-dir/mms-sms");
startActivity(intent);

<uses-permission android:name="android.permission.SEND_SMS" />
To use HTTPClient, which permission is required in an android application ?

android.permission.INTERNET is mandatory for any HTTPRequest, as we are fetching or posting information using internet or by using network connection.
What are the functionalities of HTTPClient interface in android ?

connection, authentication, Cookies management are the functionalities of HTTPClient interface
How to send mail in android  ?

        Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"er.naveen.tamrakar@gmail.com"}); intent.putExtra(Intent.EXTRA_SUBJECT, "subject");
intent.putExtra(Intent.EXTRA_TEXT, "message");
intent.setType("message/rfc822");
        startActivity(Intent.createChooser(intent, "Choose an Email client :"));

How to use Hindi fonts in Android ?



 TextView t = new TextView(this);
 Typeface Hindi = Typeface.createFromAsset(getAssets(), "fonts/mangle.ttf");
 t.setTypeface(Hindi);
 t.setText("Naveen Tamrakar");


What items are important in every Android project ?

These are the essential items that are present each time an Android project is created:
- AndroidManifest.xml
- build.xml
- bin/
- src/
- res/
- assets/
What are Adapters and when and how are they used ?

It is tough to develop an Android app without using an adapter somewhere because they are so important.
 Where do adapters fit in? They bridge the Model and View (e.g. AdapterViews such as ListViews, GridViews, Spinners and ViewPagers) with underlying data. They provide access to data items and are responsible for creating a view for each item in the data set.
 Android doesn’t adopt the MVC pattern per se. You define the Model that works for you. Android helps you layout and render views, and you customize Android’s Activities and Fragments that typically act as Controllers.

 Novice developers might try to get away with using simple helper adapters like ArrayAdapter, SimpleAdapter and SimpleCursorAdapter when possible, but these are usually too limiting for some of the more complex views typically required by todays apps. Master developers will write adapters that extend BaseAdapter directly, because it is more powerful and flexible than the subclass helpers mentioned above.
What is an URI ?

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.

Tuesday 6 January 2015

What is AsyncTask ?

AsyncTask enables proper and easy use of the UI thread. This class allows to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers.An asynchronous task is defined by a computation that runs on a background thread and whose result is published on the UI thread. An asynchronous task is defined by 3 generic types, called Params, Progress and Result, and 4 steps, called onPreExecute, doInBackground, onProgressUpdate and onPostExecute.
What are the different Storage Methods in android ?

Android provides many options for storage of persistent data. It provides the solution according to your need. The storages which have been provided in Android are as follows:

 Shared Preferences: Store private primitive data in key value pairs
 Internal Storage: Store private data on the device memory.
 External Storage: Store public data on the shared external storage.
 SQLite Databases: Store structured data in a private database.
 Network Connection: Store data on the web with your own network server.



What is a Sticky Intent ?

Intent is basically an abstract description of an operation that has to be performed for communication. Sticky Intent is also a type of intent which allows the communication between a function and a service.

 sendStickyBroadcast() performs a sendBroadcast (Intent) known as 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). 
What is a Broadcast receivers ?

A broadcast receiver is a component that does nothing but receive and react to broadcast announcements.
 For example, announcements that the timezone has changed, that the battery is low or that the user changed a language preference.
 All receivers extend the BroadcastReceiver base class.

 Broadcast receivers do not display a user interface. However, they may start an activity in response to the information they receive, or they may use the NotificationManager to alert the user like(flashing the backlight, vibrating the device, playing a sound)
What is an Intent Filter ?

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.
What is the difference between Service and Thread ?

Service is like an Activity but has no interface. Probably if you want to fetch the weather for example you wolud not create a blank activity for it, for this you will use a Service. It is also known as Background Service because it performs tasks in background. 

A Thread is a concurrent unit of execution. You need to know that you cannot update UI from a Thread. You need to use a Handler for this.
What is a Toast Notification ? 

A toast notification is a message that pops up on the surface of the window. It only fills the amount of space required for the message and the users current activity remains visible and interactive. The notification automatically fades in and out, and does not accept interaction events.
What is Android Runtime ?

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.
What is Dalvik Virtual Machine ?

The name of Android 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.
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 access 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.
How will you call a subactivity ?

       
      Intent intent = new Intent(this, SubActivity.class);
          addintent.putExtra(name, value);

          startActivityForResult(intent, int);
Write code snippet to retrieve IMEI number of Android phone ?

TelephonyManager class can be used to get the IMEI number. It provides access to information about the telephony services on the device.

       TelephonyManager mTelephonyMgr = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);

        String imei = mTelephonyMgr.getDeviceId();
What attribute values should be localized ?

The attribute values that can be displayed to users should be localized. For example: label, icon etc.
How can your application perform actions that are provided by other application e.g. sending email ?

Intents are created to define an action that we want to perform and the launches the appropriate activity from another application.

        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.putExtra(Intent.EXTRA_EMAIL, recipientArray);
        startActivity(intent);
 How will you launch an Activity within you application ?

For launching an application, we will need to create an intent that explicitly defines the activity that we wish to start. For example:

       Intent intent = new (this,MyActivity.class);
       startActivity(intent);


An Android application needs to access device data e.g SMS messages, camera etc. At what stage user needs to grant the permissions ?

Application permission must be granted by the user at install time.
Can an Android application access files or resources of another Android application ?

The system sets permission on all the files/resources of an application so that they are only accessible by their own application. Other applications cannot access resources belonging to other applications unless applications sign the same certificate.
 Define Activity application component ?

It is used to provide interactive screen to the users. It can contain many user interface components. A typical Android application consists of multiple activities that are loosely bound to each other. Android developer has to define a main activity that is launched on the application startup.

Which dialog boxes can you use in you Android application ?


 AlertDialog: it supports 0 to 3 buttons with a list of selectable elements that includes check  boxes and radio  buttons.
 ProgressDialog: it displays the progress of any dialog or application. It is an extension of  AlertDialog and  supports adding buttons.
 DatePickerDialog: it is used to give provision to the user to select the date.
 TimePickerDialog: it is used to give provision to the user to select the time.

Define Android application resource files ?

As an Android application developer, you can inject files (XML, JSON, JPEG etc) into the build process and can load them from the code. These injected files are revered as resources.
What needs to be done in order to set Android development environment where Eclipse IDE is to be used ?

Download the Android SDK from Android homepage and set the SDK in the preferences. Windows > Preferences > Select Android and enter the installation path of the Android SDK. Alternatively you may use Eclipse update manager to install all available plugins for the Android Development Tools (ADT).
Is it okay to change the name of an application after its deployment ?

It is not recommended to change the application name after its deployment because this action may break some functionality. For example: shortcuts will not work if you change application name.
How can two Android applications share same Linux user ID and share same VM ?

The applications must sign with the same certificate in order to share same Linux user ID and share same VM.