Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
package com.test.camara1; import java.io.FileOutputStream; import java.io.IOException; import android.app.Activity; import android.graphics.PixelFormat; import android.hardware.Camera; import android.hardware.Camera.Size; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.widget.FrameLayout; import android.widget.TextView; public class TestCamara1 extends Activity { private static final String TAG = "TestCamara"; private Camera m_Camera = null; private String m_PictureName = null; private String m_FilePath = "/sdcard/img_folder"; private Size m_Size = null; private FileOutputStream m_BitmapFos = null; private static final int CAPTURE_IMG = Menu.FIRST; private TextView txt_Test = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Log.e(TAG,"Inicio"); txt_Test = (TextView)findViewById(R.id.txt_Test); } @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); menu.add(0, CAPTURE_IMG, 0, "Capture image"); return true; } @Override public boolean onMenuItemSelected(int featureId, MenuItem item) { switch(item.getItemId()) { case CAPTURE_IMG: Log.d(TAG,"Call take picture"); capturePicture(); return true; } return super.onMenuItemSelected(featureId, item); } /** * Take picture with specified parameters and format */ public void capturePicture(){ try { m_Camera.startPreview(); //NOTICE THAT: I added this because it failed to call Camera.open(); (fail to connect to camera service) m_Camera = Camera.open(); if (m_Camera == null) { Log.e(TAG, "CapturePicture : Camera not available"); return; } Camera.Parameters params = m_Camera.getParameters(); m_Size = params.getPictureSize(); params.setPictureFormat(PixelFormat.JPEG); m_Camera.setParameters(params); m_Camera.takePicture(null, null, photoCallback); } catch (Exception e) { txt_Test.setText(e.getMessage()); releaseCamera(); } } /** * Handles the callback for when a picture is taken. */ Camera.PictureCallback photoCallback=new Camera.PictureCallback() { public void onPictureTaken(byte[] data, Camera camera) { try { Log.d(TAG,String.format(m_FilePath + "/%d.jpg", System.currentTimeMillis()).toString()); m_PictureName = String.format(m_FilePath + "/%d.jpg", System.currentTimeMillis()); m_BitmapFos = new FileOutputStream(m_PictureName); m_BitmapFos.write(data); m_BitmapFos.close(); releaseCamera(); } catch (IOException e) { // TODO Auto-generated catch block releaseCamera(); e.printStackTrace(); } } }; private void releaseCamera() { if (m_Camera != null) m_Camera.release(); } }