I want to create an application in android which, when connect an USB camera device to the android device, then all applications should detect the external camera as the primary camera. For example if we open camera application then the device take the picture from the one which is connected via USB. Is there a way to do this?
Please do not close this question as not a real question.
You cannot do this by writing a simple app as you do not decide which is the default camera. That is done by the system firmware, and you cannot modify this through the Android SDK.
The only way to achieve this would be to customize Android at a source level and add code to automatically switch the default camera to the one connected by USB when it is available.