How to provide image file as an sd card

by Chetan » Wed, 18 Mar 2009 14:08:47 GMT


Sponsored Links
 Hello ,
I am using camera to capture snapshots.
But i am unable to view taken pictures location.
I am also unable to browse sdcard directory using DDMS in eclipse.
--~--~---------~--~----~------------~-------~--~----~



How to provide image file as an sd card

by David » Thu, 19 Mar 2009 01:26:54 GMT


 In Run Configuration,
set the Additional emulator command line options

type this parameter
-sdcard "exactpath of image file in your PC"

so this image will be added as SDcard for your emulator.

-David




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


Sponsored Links


Other Threads

1. problem with OutputStream.flush() not working

I am sending jpg images via TCP, using InputStream and OutputStream:

CODE:
  //  Note that valid outStream and inStream variables have been
established and passed to the
  //  picTransmit method

          public picTransmit(Bitmap sendBitmap, OutputStream
outStream,
                    InputStream inStream) {
                // First, send the sendBitmap
               sendBitmap.compress(Bitmap.CompressFormat.JPEG, 80,
outStream);
               try {
                    outStream.close();    //<-- using this works to
force pic to be sent
                    // outStream.flush();  //<-- using this code
instead (without the "//") ,
                                                  // should force pic
to be sent...  but it doesn't.
               } catch (IOException e) {
                    e.printStackTrace();
               }

                // Second, receive an incoming Bitmap
               Bitmap receiveBitmap = BitmapFactory.decodeStream
(inStream);  // this throws
                        // "Bad socket error, if you call
outStream.close() up above.

//  Do more stuff...

ENDCODE

The first part where the picture is sent works, but only if I use the
outStream.close() code.  If I try to use outStream.flush(), nothing
happens and the IO just hangs.  This I don't understand.
I have tried using BufferedOutputStream and BufferedInputStream but
the behaviour is the same.

Unfortunately, when I use outStream.close(), it means that my
subsequent call to inStream later, resuts in a "Bad Socket" error. I
am not sure why if I close the outStream, the inStream is also screwed
up, but I have seen others make reference to this in other internet
posts.
([EMAIL PROTECTED]/
msg02516.html)

So I have a catch-22, I can only get the first send-picture to work if
I use outStream.close() and if I use outStream.close(), I have no way
of getting the second part (where I receive a picture) to work.

Any ideas about how to structure a send then receive of image data via
TCP would be appreciated since this seems to be a dead end.


Thanks,
JIm





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

2. Trouble with BitmapFactory.decodeResource

I use this line:

mIcon = BitmapFactory.decodeResource(context.getResources(),
R.drawable.icon);

after which mIcon is not null, but its width and height are both -1
and nothing is drawn.  Is there something obvious that I'm missing?

Here's my call to draw it:

canvas.drawBitmap(mIcon, null, new Rect(loc.x-16, loc.y+16, loc.x+16,
loc.y-16), mPaint);

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

3. Android Beginners <android-beginners@googlegroups.com>

4. WAV (GSM 6.1) Support?

5. Adding static non scroll areas when using a list view.

6. Communication protocol question

7. How do you step through (debug) from the Java layer into the Linux layer?