package com.javacodegeeks.androids.androiddevicecameraexample;

import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.widget.TextView;

public class MainActivity extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

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

		TextView text = (TextView) findViewById(R.id.text);

		if (pm.hasSystemFeature(PackageManager.FEATURE_CAMERA)) {

			text.setText("This device has a Camera");

		} else {

			text.setText("This device doesn't have a Camera");
		}

	}
}