Camera application 1.5 on emulator does nothing

by Johnny Song » Tue, 26 May 2009 08:14:35 GMT


Sponsored Links
 you must make sure that you have already implemented libcamera in your
source code.

2009/5/22 arnouf <arnaud.far...@gmail.com>


Best Regards,
Johnny Song


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. select pitcure may lead to excced memory and crash?

i got a problem
i intend to use

intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(intent, 1);

to select picture from gallery in google phone, and load the selected
photo back into my application
it works ok in the emulator
but when i punt it on real google phone (HTC hero/ HTC magic)
if i capture a photo in the gallery, and select the photo,
it sometimes crash (not always)
is it because the photo is too large or something?
are there any solution? thanks!

//--------following are part of my code-----//

private void getGalleryImage()
    {
        //...

        selectNewPicture = false;
        Intent intent = new Intent();
        intent.setType("image/*");
        intent.setAction(Intent.ACTION_GET_CONTENT);
        startActivityForResult(intent, 1);

    }
    @Override
    protected void onActivityResult(int requestCode, int
resultCode,Intent data)
    {
      if (resultCode == RESULT_OK)
      {
        uriAvator = data.getData();

        ContentResolver cr = this.getContentResolver();

        try
        {
          bmpAvator = Bitmap.createBitmap(BitmapFactory.decodeStream
(cr.openInputStream(uriAvator)));

          //Do Cutting
          int dX = bmpAvator.getWidth();
          int dY = bmpAvator.getHeight();
          int dMin = Math.min(dX, dY);
          if(dX > dY)
              bmpAvator = Bitmap.createBitmap(bmpAvator, (dX-dMin)>>1,
0, dMin, dMin);
          else if(dX < dY)
                  bmpAvator = Bitmap.createBitmap(bmpAvator, 0, (dY-dMin)>>1,
dMin, dMin);

          //Do Scaling
          bmpAvator = Bitmap.createScaledBitmap(bmpAvator, 100, 100,
true);

          //Compress into jpeg

          myAvator.setImageBitmap(bmpAvator);
        } catch (FileNotFoundException e)
        {
          e.printStackTrace();
        }
      }
      super.onActivityResult(requestCode, resultCode, data);
    }

--~--~---------~--~----~------------~-------~--~----~

2. Should I use Canvas or SurfaceView for a chess game?

Hi,
I am developing a chess game, what view should I use for the
chessboard, Canvas or SurfaceView? I want to implement some animations
like moving a piece, fading the chessboard or maybe rotating the
chessboard.
--~--~---------~--~----~------------~-------~--~----~

3. activesync contacts uri

4. Relation between Google GeoPoint instances

5. Vony Saputra ingin chatting

6. Android on OMAP 34x-II device

7. Multiple screens in one activity (like home screen)