Home > Android > Android Program – Camera Activity

Android Program – Camera Activity

Android camera snippet code download

ANDROID FOR FRESHERS 

Android Program of Camera Activity

Java Code(CameraAct)

import android.app.Activity;
import android.content.Intent;
import android.provider.MediaStore;
import android.os.Bundle;
import android.view.View;

public class CameraAct extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_camera);
}
public void next(View v)
{
Intent i= new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivity(i);

}
}

Layout XML Code(activity_camera)

<?xml version=”1.0″ encoding=”utf-8″?>
<LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”
xmlns:tools=”http://schemas.android.com/tools”
android:layout_width=”match_parent”
android:orientation=”vertical”
android:layout_height=”match_parent”
android:paddingBottom=”@dimen/activity_vertical_margin”
android:paddingLeft=”@dimen/activity_horizontal_margin”
android:paddingRight=”@dimen/activity_horizontal_margin”
android:paddingTop=”@dimen/activity_vertical_margin”
tools:context=”com.andro.tech.androidproject.CameraAct”>

<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:textSize=”@dimen/textsize”
android:layout_gravity=”center”
android:textStyle=”bold”
android:text=”@string/cameratext”
android:layout_marginBottom=”120dp” />

<Button
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:text=”OPEN CAMERA”
android:onClick=”next”
android:layout_marginBottom=”120dp”/>

<Button
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:text=”@string/sourcecode”
android:background=”@color/bgcolor”
android:textStyle=”bold”
android:textColor=”@color/text”
android:onClick=”view1″/>

</LinearLayout>

Output

Android camera snippet code download

Android camera snippet code download

Download Camera Activity Source Code

For More Android Programs –Click Here

 

Follow Us – Never Miss Update

Fb/PageTwitterGoogle+InstagramPinterest 

 

Related Search

android camera code download, android camera source snippet, android camera snippet code download, android camera open snippet source code download, android camera snippet code download, android activity camera snippet code download, android camera program source download, Android camera snippet code download, Android Camera activity snippet code

Is This Content Useful For You?