Q:

Flashlight ON/OFF App is crashing

I found a example for switching the light on the phone here :
http://www.mkyong.com/android/how-to-turn-onoff-camera-ledflashlight-in-android/
So I snipped some code for my App and got a Error.
03-02 21:31:28.066: E/AndroidRuntime(1591): FATAL EXCEPTION: main
03-02 21:31:28.066: E/AndroidRuntime(1591): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.kaltech.led/com.kaltech.led.ActivityMAIN}: java.lang.NullPointerException
03-02 21:31:28.066: E/AndroidRuntime(1591):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
03-02 21:31:28.066: E/AndroidRuntime(1591):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
03-02 21:31:28.066: E/AndroidRuntime(1591):     at android.app.ActivityThread.access$600(ActivityThread.java:130)
03-02 21:31:28.066: E/AndroidRuntime(1591):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
03-02 21:31:28.066: E/AndroidRuntime(1591):     at android.os.Handler.dispatchMessage(Handler.java:99)
03-02 21:31:28.066: E/AndroidRuntime(1591):     at android.os.Looper.loop(Looper.java:137)
03-02 21:31:28.066: E/AndroidRuntime(1591):     at android.app.ActivityThread.main(ActivityThread.java:4745)
03-02 21:31:28.066: E/AndroidRuntime(1591):     at java.lang.reflect.Method.invokeNative(Native Method)
03-02 21:31:28.066: E/AndroidRuntime(1591):     at java.lang.reflect.Method.invoke(Method.java:511)
03-02 21:31:28.066: E/AndroidRuntime(1591):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
03-02 21:31:28.066: E/AndroidRuntime(1591):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
03-02 21:31:28.066: E/AndroidRuntime(1591):     at dalvik.system.NativeStart.main(Native Method)
03-02 21:31:28.066: E/AndroidRuntime(1591): Caused by: java.lang.NullPointerException
03-02 21:31:28.066: E/AndroidRuntime(1591):     at com.kaltech.led.ActivityMAIN.onCreate(ActivityMAIN.java:40)
03-02 21:31:28.066: E/AndroidRuntime(1591):     at android.app.Activity.performCreate(Activity.java:5008)
03-02 21:31:28.066: E/AndroidRuntime(1591):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
03-02 21:31:28.066: E/AndroidRuntime(1591):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
03-02 21:31:28.066: E/AndroidRuntime(1591):     ... 11 more

Edit :
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

          bat_status = (ImageView)findViewById(R.id.bat_stat);
          mySwitch = (Switch) findViewById(R.id.switch_signal);

          Context context = this;
          PackageManager pm = context.getPackageManager();

          if (!pm.hasSystemFeature(PackageManager.FEATURE_CAMERA)) {
                Log.e("err", "Device has no camera!");
                return;
            }

          camera = Camera.open();
          final Parameters p = camera.getParameters();

          mySwitch.setChecked(false);
          mySwitch.setOnCheckedChangeListener(new OnCheckedChangeListener() {

           @Override
           public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) {

            if(isChecked){                                                              //EIN
             bat_status.setImageResource(R.drawable.bat_signal_1);

             p.setFlashMode(Parameters.FLASH_MODE_TORCH);

                camera.setParameters(p);
                camera.startPreview();
                isLighOn = true;

            }
            else{                                                                       //AUS
                bat_status.setImageResource(R.drawable.bat_signal_2);

                p.setFlashMode(Parameters.FLASH_MODE_OFF);
                camera.setParameters(p);
                camera.stopPreview();
                isLighOn = false;
            }

           }
          });

         }

Edit 2:

final Parameters p = camera.getParameters();   //Line 40

A:

You're getting NullPointerException on line 40, which is:
final Parameters p = camera.getParameters();

Most likely the camera object is null. You're initializing it earlier with:
camera = Camera.open();

and Camera.open():

Creates a new Camera object to access the first back-facing camera on the device. If the device does not have a back-facing camera, this returns null.

Check if your camera is not null and proceed only then, eg.:
camera = Camera.open();

if (camera != null) {
    //normal code
}
else {
    //ERROR, camera is null
}

You might be getting this because:

the device does not have back-facing camera
you forgot to add 
<uses-permission android:name="android.permission.CAMERA" />

in your AndroidManifest.

