- ªî£ì¼‹
Altitude ÝAòõŸ¬ø
ªì™ªï†(Telnet)ðò¡
ð´ˆF ªè£´‚è º®
»‹. ꣡ø£è ⺫ô†
ì˜ 5554 â¡ø «ð£˜
®™ ªêò™ð†ì£™
èñ£‡† Šó£‹Š†
®™ W›‚è‡ìõ£Á
è†ì¬÷ ªè£´‚è
«õ‡´‹.
talent localhost 5554
geo fix 2030 500 â¡Á ªè£´ˆî£™, Üèô
«è£†®¡ à¬ìò ñFй 20 â¡Á‹ Gô
G¬ó‚«è£†®Â¬ìò ñFй 30 â¡Á‹
àòóˆF¬ìò (Altitute) ñFй 500 â¡Á‹
ܬñˆ¶‚ ªè£œÀ‹. (ðì‹-1)
Location Changed â¡ø ªñˆî®™ ⺫ô†
ì˜ Ü™ô¶ ªñ£¬ð™ ®¬õC™ àœ÷ îŸ
«ð£¬îò Üèô‚«è£´ ñŸÁ‹ GôG¬ó‚
«è£†®¬ù è‡ìPò º®»‹. ÜîŸè£è
loc.getLatitude();
loc.getLongitude(); ðò¡ð´ˆîŠð´Aø¶
THâv Ý‚®M†®‚è£ù
Gó™ -3 ™ àœ÷¶.
Run>Run As> Android Appli
cation â¡ðî¬ù AO‚ ªêŒî¾
ì¡ ÜŠO«èê¡ ªêò™ðì
ªî£ìƒ°‹. ªì™ªï† Íô‹
THâvCŸè£ù îèõL¬ù
ªè£´ˆî£™ Üî¬ù F¬óJ™
裇H‚°‹.
â‚OŠC™ Þ¼‰¶‹ îèõ™
ªè£´‚è º®»‹. â‚OŠC™
®®â‹âv â¡ðî¬ù «î˜¾ ªêŒ¶
ªè£´‚è «õ‡´‹. (ðì‹-3)
Þ‰î ꣡Á Íô‹ THâv ®¬õC™
àœ÷ Üèô‚«è£´ ñŸÁ‹ GôG¬ó‚«è£´
âšõ£Á 致H®Šð¶ â¡ðî¬ù 𣘈
«î£‹.
‡†ó£Œ®™ ðôMîñ£ù ý£˜´«õ˜ ðò¡
ð´ˆîŠð´A¡øù. ꣡ø£è, Sensors, Camera,
aculerometer, magnetometer, pressure sensor,
temperature sensor, Telephony, Bluetooth
ñŸÁ‹ õò˜ªôv (Wireless) è¼Mèœ.
«èñó£ (Camera)
«èñó£ ♫ô£¼‹ ݘõñ£è ðò¡ð´ˆ¶‹
å¼ ý£˜´«õ˜ ݰ‹. «èñó£M¬ù
Þ¡ªì¡† (Intent)Íôº‹ Classðò¡ð´ˆ¶
õî¡ Íôº‹ ÜŠO«èêQ™ ðò¡ð´ˆîô£‹.
꣡ø£è,
Camera Intent intent = new Intent
("android.media.action.IMAGE_CAPTURE)
Start Activity(intent);
Ü´ˆîî£è Camera Class ðò¡ð´ˆ¶‹
º¬ø¬ò 𣘊«ð£‹.
Camera Class ðò¡ð´ˆ¶õ android
manifest.xml-™ permission ªè£´‚è «õ‡´‹.
<uses-permission android:name=
"android.permission.CAMERA"/>
Camera Class ðò¡ð´ˆF ÜŠO«èêQ™
Camera ðò¡ð´ˆîº®»‹.
Camera.Parameters Class Íô‹ Camera-
MŸè£ù Parameter-è÷£ù picture size, picture
quality, flash modes «ð£¡ø¬õèœ ªè£´‚è
º®»‹.
Camera Preview ªñˆî´(Method)
Camera ܾ†¹†®¬ù 𣘂è ðò¡ð´
Aø¶. Surface View Class Íô‹ F¬óJ™
裇H‚è å¼ î÷ˆF¬ù ܬñˆFì º®»‹.
꣡ø£è, ÜŠO«èêQ™ Camera ðò¡ð´ˆ
¶‹ º¬øJ¬ù 𣘊«ð£‹. ݇†ó£Œ´
ÜŠO«èê¡ à¼õ£‚Aò¾ì¡ main.xml «î£¡
Á‹. main.xml-™ Camera ܾ†¹†®¬ù ªðÁ
õè Surface View ðò¡ð´ˆî«õ‡´‹.
/res/layout/main.xml-Ÿè£ù Gó™ content 1-™
àœ÷¶ «ð£¡Á Þ¼‚°‹.
Content 1:
<Linear Layout
x m l n s : a n d r o i d -
"http://schemas.android.com/apk/res/android"
android:layout-width="fill-parent"
android:layout-height="fill-parent"
android: orientation="vertical">
<Surface View android:id="@tid/surface"
android:layout-width="fill-parent"
android:layout-height="fill-parent">
</SurfaceView>
</LinearLayout>
main.xml-½ì¡ Control interface ðò¡
ð´ˆî Þ¡ªù£¼ xml ç¬ð™ ðò¡ð´ˆî
«õ‡´‹.
/res/layout/camera overlay.xml-Ÿè£ù Gó™
content 2-™ àœ÷¶ «ð£¡Á Þ¼‚°‹.
Content 2:
<Linear Layout xmlns:android=
"http://schemas.android.com/apk/res/
android"
android:layout-width="fill-parent"
android:layout-height="fill-parent"
android:orientation="vertical"
android:gravity="bottom"
android:Layout-gravity="bottm">
<Linear Layout
xmlns:android="http://schemas.android.com
/apk/res/android"
android:layout-width="fill-parent"
android:layout-height="wrap-content"
android:orientation="horizontal"
android:gravity="center-horizontal">
<Button
android:id="@+id/button"
android:layout-width="wrap=content"
android:layout-height="wrap-content"
android:text="take picture"
/>
</Linear Layout>
</Linear Layout>
Ü´ˆîî£è Activity à¼õ£‚°‹ º¬øJ¬ù
(Gó™ content 3), ºîL™ title ñŸÁ‹ NOTIFI
CATION BAR ñ¬ø‚èŠð´‹.
Layout Inflater Íô‹ main.xml ç¬ð™ «ñ™
cameraoverlay.xml ðò¡ð´ˆîŠð´‹. GóL™
ð†ì¬ù AO‚ ªêŒî¾ì¡ ªêò™ ï¬ìªðø
OnclickListener() ðò¡ð´ˆî «õ‡´‹. Take
Picture(), ShutterCallback ñŸÁ‹ PictureCall
back() ðò¡ð´ˆîŠð†´œ÷¶. PictureCall
back() Þó‡´ º¬ø ðò¡ð´ˆîŠð†®¼‚°‹.
H¡ù˜ Activity îèõ¬ô «êI‚°‹. Compressed
Picture byte array ðò¡ð´ˆîŠð†´ ܶ
tempdata â¡ø local variable-L™ «êI‚èŠ
ð´‹. Byte Array-J¬ù Bitmap-Ýè ñ£ŸPì
Bitmap Factory ðò¡ð´ˆîŠð´Aø¶.
îèõ¬ô Bitmap Ýè «êIˆ¶ URL Ýè
ªðÁõ media content provider ðò¡ð´ˆîŠ
ð´Aø¶. è¬ìCò£è ÜŠO«èê¡ º®¾
õ¼õ finish() ðò¡ð´ˆîŠð´Aø¶. Cô
Ý
Content 3:
src/com/cookbook/hardware/cameraApplica
tion.java
Package com.cookbook.hardware ;
import android .app.activity ;
import android .content.Intent ;
import android .graphics.Bitmap ;
import android .graphics.Bitmapfactory ;
import android .graphics.Pixelformat ;
import android .hardware.camera ;
importandroid .hardware.camera.picturecallback;
import android.hardware.camera.shuttercallback;
import android .os.Bundle ;
import android . provider.media store. Images ;
import android . util . Log ;
import android . view . LayoutInfbater ;
import android . view .Surfaceholder ;
import android . view . surfaceview ;
import android . view . view ;
import android . view . window ;
import android . view . Windowmanager ;
import android . view .OnclickListener ;
import android . view . viewGroup.LayoutParams;
import android . widged .Button ;
import android .widget . Toast ;
Public class camera Application extends Activity
implement surface Holder . Callback{
Private static final string TAG ="
Private Layout Inflater mInflater =null;
Camera m Camera ;
byte[] tempdata ;
boolean mPreviewRunning = false ;
private surface Holder mSurfaceHolder ;
private surfaceView mSurfaceView ;
Button take Picture ;
@Override
Public void onCreate (Bundle saved Instance
State){
super . on Create [saved Instance state ] ;
getwindow () . setFormat [PixelFormat .
TRANSLUCENT);
request Window Feature ( Window .
FEATURE- NO_TITLE];
getWindow().setFlags(WindowManager.LayoutPa
rams.
FLAG-FULLSCREEN,
window Manager.Layout.Params.FLAG-
FULLSCREEN);
SetContentView[R.layout.main];
mSurfaceView= [Surfaceview] findViewBy Id
[R.id.surface];
mSurfaceHolder=mSurfaceView.getHolder[];
mSurfaceHolder.addCallback[this];
mSurfaceHolder.setType[SurfaceHolder.SURF
ACE-TYPE-PUSH-BUFFERS];
mInflater=LayoutInflater.from[this];
View overview=mInflater .inflate [R.Layout.
CameraOverlay,null ];
This .add contentView (overView,
new Layout params (layout params
.FILL- PARENT
Layout Params -FILL -PARENT ));
takepicture=[button] findViewById[R.id.button);
take picture .set On click listener [new onClick
Listener (){
public void onClick [View view] {
mCamera.takePicture [mShutter Callback ,
mPicture Callback ,mjpey];
}
} );
}
ShutterCallback mSshutterCallback=new
shutter call back []{
@override
public void onShutter(){}
};
Picturecallback mPictureCallback=newPicture
Callback[]{
public void onPictureTaken [byte[] data
,Camera[]{}
};
Picture callback mjepy=new Picture
callback []{
public void on Picture Taken [byte []data,
camera {
if [data !=null]{
tempdata =data ;
done[];
}
}
};
void done []{
Bitmap bm= Bitmap Factory .decode Byet
Array [temdata,O,tempdata .length];
String url =Images.Media insert Image
[getContent Resolver [], bm,null,null];
bm.recycle[];
Bundle. bundle =new Bundle[];
if(url! =null){
bundle.putstring ["Url",url ];
Ý¡†ó£Œ´ -2
Þ󣋰ñ£˜ ªô†²Iï£ó£òí¡
13
ªñ£¬ðL™ preview êKò£è ªêò™ðì£ñ™
Þ¼‚°‹. Ü‰î «ïóˆF™ oncreate() ªñˆî®™
W›‚è‡ì õKè¬÷ ðò¡ð´ˆî«õ‡´‹.
mthis.setRequestedOrientation
(ActivityInfo.SCREEN_ORIENTATION_
LANGUAGE);
Ü´ˆîî£è Hardware Telephone ݰ‹.
Þî¬ù ðò¡ð´ˆ¶õ Telephony Api ðò¡
ð´ˆîŠð´Aø¶. Intent ðò¡ð´ˆF»‹ ªêò™
è¬÷ ðò¡ð´ˆîº®»‹. ꣡ø£è, startActivity
(newIntent(Intent.ACTION_CALL,
Vri.parse("tal:9443188750")));
ªî£ì¼‹
Intent mIntent =new Intent [];
mIntent PutExtras [bundle];
Set Result [RESULT -OK,mIntent ];
} else {
Toast.make Text [this, "Picture can not
be
saved,"
Toast .LENGTH -SHORT.show [];
}
finish [];
}
@override
public void surface changed [surface
Holder holder, int format int w ,
int h]{
Log .e {TAG, "surface changed '];
try {
if[mPreview Running]{
mCamera .stop Preview [];
mPreview Running =false;
}
Camera .parameters p=m Camera
.getParameters[];
p.set preview size [w,h ];
mCamera .setparameters [p];
mCamera .setPreview Display [holder ]
mCamera .start Preview [];
mPreview Running =true ;
} Catch [Exception e] {
Log .d[" " . e. to string []);
}
}
@Override
Public void surface created[surface
Holder
holder ]{
Log . e [TAG ,"surface created "];
m camera = camera .open [];
}
@Override
public void surface Destroyed [ surface
Holder holder
]{
Log .e[TAG, "surface Destroyed " ];
mcamera .stop Preview [];
mPreview Running =false;
mCamera .release[];
mCamera =null;
}
}

Hardware Interface in Android (in tamil)

  • 1.
    - ªî£ì¼‹ Altitude ÝAòõŸ¬ø ªì™ªï†(Telnet)ðò¡ ð´ˆFªè£´‚è º® »‹. ꣡ø£è ⺫ô† ì˜ 5554 â¡ø «ð£˜ ®™ ªêò™ð†ì£™ èñ£‡† Šó£‹Š† ®™ W›‚è‡ìõ£Á è†ì¬÷ ªè£´‚è «õ‡´‹. talent localhost 5554 geo fix 2030 500 â¡Á ªè£´ˆî£™, Üèô «è£†®¡ à¬ìò ñFй 20 â¡Á‹ Gô G¬ó‚«è£†®Â¬ìò ñFй 30 â¡Á‹ àòóˆF¬ìò (Altitute) ñFй 500 â¡Á‹ ܬñˆ¶‚ ªè£œÀ‹. (ðì‹-1) Location Changed â¡ø ªñˆî®™ ⺫ô† ì˜ Ü™ô¶ ªñ£¬ð™ ®¬õC™ àœ÷ îŸ «ð£¬îò Üèô‚«è£´ ñŸÁ‹ GôG¬ó‚ «è£†®¬ù è‡ìPò º®»‹. ÜîŸè£è loc.getLatitude(); loc.getLongitude(); ðò¡ð´ˆîŠð´Aø¶ THâv Ý‚®M†®‚è£ù Gó™ -3 ™ àœ÷¶. Run>Run As> Android Appli cation â¡ðî¬ù AO‚ ªêŒî¾ ì¡ ÜŠO«èê¡ ªêò™ðì ªî£ìƒ°‹. ªì™ªï† Íô‹ THâvCŸè£ù îèõL¬ù ªè£´ˆî£™ Üî¬ù F¬óJ™ 裇H‚°‹. â‚OŠC™ Þ¼‰¶‹ îèõ™ ªè£´‚è º®»‹. â‚OŠC™ ®®â‹âv â¡ðî¬ù «î˜¾ ªêŒ¶ ªè£´‚è «õ‡´‹. (ðì‹-3) Þ‰î ꣡Á Íô‹ THâv ®¬õC™ àœ÷ Üèô‚«è£´ ñŸÁ‹ GôG¬ó‚«è£´ âšõ£Á 致H®Šð¶ â¡ðî¬ù 𣘈 «î£‹.
  • 2.
    ‡†ó£Œ®™ ðôMîñ£ù ý£˜´«õ˜ðò¡ ð´ˆîŠð´A¡øù. ꣡ø£è, Sensors, Camera, aculerometer, magnetometer, pressure sensor, temperature sensor, Telephony, Bluetooth ñŸÁ‹ õò˜ªôv (Wireless) è¼Mèœ. «èñó£ (Camera) «èñó£ ♫ô£¼‹ ݘõñ£è ðò¡ð´ˆ¶‹ å¼ ý£˜´«õ˜ ݰ‹. «èñó£M¬ù Þ¡ªì¡† (Intent)Íôº‹ Classðò¡ð´ˆ¶ õî¡ Íôº‹ ÜŠO«èêQ™ ðò¡ð´ˆîô£‹. ꣡ø£è, Camera Intent intent = new Intent ("android.media.action.IMAGE_CAPTURE) Start Activity(intent); Ü´ˆîî£è Camera Class ðò¡ð´ˆ¶‹ º¬ø¬ò 𣘊«ð£‹. Camera Class ðò¡ð´ˆ¶õ android manifest.xml-™ permission ªè£´‚è «õ‡´‹. <uses-permission android:name= "android.permission.CAMERA"/> Camera Class ðò¡ð´ˆF ÜŠO«èêQ™ Camera ðò¡ð´ˆîº®»‹. Camera.Parameters Class Íô‹ Camera- MŸè£ù Parameter-è÷£ù picture size, picture quality, flash modes «ð£¡ø¬õèœ ªè£´‚è º®»‹. Camera Preview ªñˆî´(Method) Camera ܾ†¹†®¬ù 𣘂è ðò¡ð´ Aø¶. Surface View Class Íô‹ F¬óJ™ 裇H‚è å¼ î÷ˆF¬ù ܬñˆFì º®»‹. ꣡ø£è, ÜŠO«èêQ™ Camera ðò¡ð´ˆ ¶‹ º¬øJ¬ù 𣘊«ð£‹. ݇†ó£Œ´ ÜŠO«èê¡ à¼õ£‚Aò¾ì¡ main.xml «î£¡ Á‹. main.xml-™ Camera ܾ†¹†®¬ù ªðÁ õè Surface View ðò¡ð´ˆî«õ‡´‹. /res/layout/main.xml-Ÿè£ù Gó™ content 1-™ àœ÷¶ «ð£¡Á Þ¼‚°‹. Content 1: <Linear Layout x m l n s : a n d r o i d - "http://schemas.android.com/apk/res/android" android:layout-width="fill-parent" android:layout-height="fill-parent" android: orientation="vertical"> <Surface View android:id="@tid/surface" android:layout-width="fill-parent" android:layout-height="fill-parent"> </SurfaceView> </LinearLayout> main.xml-½ì¡ Control interface ðò¡ ð´ˆî Þ¡ªù£¼ xml ç¬ð™ ðò¡ð´ˆî «õ‡´‹. /res/layout/camera overlay.xml-Ÿè£ù Gó™ content 2-™ àœ÷¶ «ð£¡Á Þ¼‚°‹. Content 2: <Linear Layout xmlns:android= "http://schemas.android.com/apk/res/ android" android:layout-width="fill-parent" android:layout-height="fill-parent" android:orientation="vertical" android:gravity="bottom" android:Layout-gravity="bottm"> <Linear Layout xmlns:android="http://schemas.android.com /apk/res/android" android:layout-width="fill-parent" android:layout-height="wrap-content" android:orientation="horizontal" android:gravity="center-horizontal"> <Button android:id="@+id/button" android:layout-width="wrap=content" android:layout-height="wrap-content" android:text="take picture" /> </Linear Layout> </Linear Layout> Ü´ˆîî£è Activity à¼õ£‚°‹ º¬øJ¬ù (Gó™ content 3), ºîL™ title ñŸÁ‹ NOTIFI CATION BAR ñ¬ø‚èŠð´‹. Layout Inflater Íô‹ main.xml ç¬ð™ «ñ™ cameraoverlay.xml ðò¡ð´ˆîŠð´‹. GóL™ ð†ì¬ù AO‚ ªêŒî¾ì¡ ªêò™ ï¬ìªðø OnclickListener() ðò¡ð´ˆî «õ‡´‹. Take Picture(), ShutterCallback ñŸÁ‹ PictureCall back() ðò¡ð´ˆîŠð†´œ÷¶. PictureCall back() Þó‡´ º¬ø ðò¡ð´ˆîŠð†®¼‚°‹. H¡ù˜ Activity îèõ¬ô «êI‚°‹. Compressed Picture byte array ðò¡ð´ˆîŠð†´ ܶ tempdata â¡ø local variable-L™ «êI‚èŠ ð´‹. Byte Array-J¬ù Bitmap-Ýè ñ£ŸPì Bitmap Factory ðò¡ð´ˆîŠð´Aø¶. îèõ¬ô Bitmap Ýè «êIˆ¶ URL Ýè ªðÁõ media content provider ðò¡ð´ˆîŠ ð´Aø¶. è¬ìCò£è ÜŠO«èê¡ º®¾ õ¼õ finish() ðò¡ð´ˆîŠð´Aø¶. Cô Ý
  • 3.
    Content 3: src/com/cookbook/hardware/cameraApplica tion.java Package com.cookbook.hardware; import android .app.activity ; import android .content.Intent ; import android .graphics.Bitmap ; import android .graphics.Bitmapfactory ; import android .graphics.Pixelformat ; import android .hardware.camera ; importandroid .hardware.camera.picturecallback; import android.hardware.camera.shuttercallback; import android .os.Bundle ; import android . provider.media store. Images ; import android . util . Log ; import android . view . LayoutInfbater ; import android . view .Surfaceholder ; import android . view . surfaceview ; import android . view . view ; import android . view . window ; import android . view . Windowmanager ; import android . view .OnclickListener ; import android . view . viewGroup.LayoutParams; import android . widged .Button ; import android .widget . Toast ; Public class camera Application extends Activity implement surface Holder . Callback{ Private static final string TAG =" Private Layout Inflater mInflater =null; Camera m Camera ; byte[] tempdata ; boolean mPreviewRunning = false ; private surface Holder mSurfaceHolder ; private surfaceView mSurfaceView ; Button take Picture ; @Override Public void onCreate (Bundle saved Instance State){ super . on Create [saved Instance state ] ; getwindow () . setFormat [PixelFormat . TRANSLUCENT); request Window Feature ( Window . FEATURE- NO_TITLE]; getWindow().setFlags(WindowManager.LayoutPa rams. FLAG-FULLSCREEN, window Manager.Layout.Params.FLAG- FULLSCREEN); SetContentView[R.layout.main]; mSurfaceView= [Surfaceview] findViewBy Id [R.id.surface]; mSurfaceHolder=mSurfaceView.getHolder[]; mSurfaceHolder.addCallback[this]; mSurfaceHolder.setType[SurfaceHolder.SURF ACE-TYPE-PUSH-BUFFERS]; mInflater=LayoutInflater.from[this]; View overview=mInflater .inflate [R.Layout. CameraOverlay,null ]; This .add contentView (overView, new Layout params (layout params .FILL- PARENT Layout Params -FILL -PARENT )); takepicture=[button] findViewById[R.id.button); take picture .set On click listener [new onClick Listener (){ public void onClick [View view] { mCamera.takePicture [mShutter Callback , mPicture Callback ,mjpey]; } } ); } ShutterCallback mSshutterCallback=new shutter call back []{ @override public void onShutter(){} }; Picturecallback mPictureCallback=newPicture Callback[]{ public void onPictureTaken [byte[] data ,Camera[]{} }; Picture callback mjepy=new Picture callback []{ public void on Picture Taken [byte []data, camera { if [data !=null]{ tempdata =data ; done[]; } } }; void done []{ Bitmap bm= Bitmap Factory .decode Byet Array [temdata,O,tempdata .length]; String url =Images.Media insert Image [getContent Resolver [], bm,null,null]; bm.recycle[]; Bundle. bundle =new Bundle[]; if(url! =null){ bundle.putstring ["Url",url ]; Ý¡†ó£Œ´ -2 Þ󣋰ñ£˜ ªô†²Iï£ó£òí¡ 13 ªñ£¬ðL™ preview êKò£è ªêò™ðì£ñ™ Þ¼‚°‹. Ü‰î «ïóˆF™ oncreate() ªñˆî®™ W›‚è‡ì õKè¬÷ ðò¡ð´ˆî«õ‡´‹. mthis.setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_ LANGUAGE); Ü´ˆîî£è Hardware Telephone ݰ‹. Þî¬ù ðò¡ð´ˆ¶õ Telephony Api ðò¡ ð´ˆîŠð´Aø¶. Intent ðò¡ð´ˆF»‹ ªêò™ è¬÷ ðò¡ð´ˆîº®»‹. ꣡ø£è, startActivity (newIntent(Intent.ACTION_CALL, Vri.parse("tal:9443188750")));
  • 4.
    ªî£ì¼‹ Intent mIntent =newIntent []; mIntent PutExtras [bundle]; Set Result [RESULT -OK,mIntent ]; } else { Toast.make Text [this, "Picture can not be saved," Toast .LENGTH -SHORT.show []; } finish []; } @override public void surface changed [surface Holder holder, int format int w , int h]{ Log .e {TAG, "surface changed ']; try { if[mPreview Running]{ mCamera .stop Preview []; mPreview Running =false; } Camera .parameters p=m Camera .getParameters[]; p.set preview size [w,h ]; mCamera .setparameters [p]; mCamera .setPreview Display [holder ] mCamera .start Preview []; mPreview Running =true ; } Catch [Exception e] { Log .d[" " . e. to string []); } } @Override Public void surface created[surface Holder holder ]{ Log . e [TAG ,"surface created "]; m camera = camera .open []; } @Override public void surface Destroyed [ surface Holder holder ]{ Log .e[TAG, "surface Destroyed " ]; mcamera .stop Preview []; mPreview Running =false; mCamera .release[]; mCamera =null; } }