Android gallery using bitmap class
<p>Can someone post the android gallery example where bitmap properties are used. I am new to it so cant figure out how it works. I have gallery without bitmap which gives memory error. Please post example where it does not lead to memory error</p>

<p>Error Log is</p>

<pre><code>05-14 15:33:25.336: E/AndroidRuntime(563): FATAL EXCEPTION: main
05-14 15:33:25.336: E/AndroidRuntime(563): java.lang.OutOfMemoryError
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:483)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:773)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.content.res.Resources.loadDrawable(Resources.java:1937)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.content.res.Resources.getDrawable(Resources.java:664)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.widget.ImageView.resolveUri(ImageView.java:542)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.widget.ImageView.setImageResource(ImageView.java:315)
05-14 15:33:25.336: E/AndroidRuntime(563):  at com.hospital.ImageAdapter.getView(ImageAdapter.java:46)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.widget.Gallery.makeAndAddView(Gallery.java:844)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.widget.Gallery.fillToGalleryRightLtr(Gallery.java:798)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.widget.Gallery.fillToGalleryRight(Gallery.java:742)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.widget.Gallery.layout(Gallery.java:651)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.widget.Gallery.onLayout(Gallery.java:346)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.view.View.layout(View.java:11278)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.view.ViewGroup.layout(ViewGroup.java:4224)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.view.View.layout(View.java:11278)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.view.ViewGroup.layout(ViewGroup.java:4224)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.view.View.layout(View.java:11278)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.view.ViewGroup.layout(ViewGroup.java:4224)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.view.View.layout(View.java:11278)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.view.ViewGroup.layout(ViewGroup.java:4224)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.view.View.layout(View.java:11278)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.view.ViewGroup.layout(ViewGroup.java:4224)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1489)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.os.Looper.loop(Looper.java:137)
05-14 15:33:25.336: E/AndroidRuntime(563):  at android.app.ActivityThread.main(ActivityThread.java:4424)
05-14 15:33:25.336: E/AndroidRuntime(563):  at java.lang.reflect.Method.invokeNative(Native Method)
05-14 15:33:25.336: E/AndroidRuntime(563):  at java.lang.reflect.Method.invoke(Method.java:511)
05-14 15:33:25.336: E/AndroidRuntime(563):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-14 15:33:25.336: E/AndroidRuntime(563):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-14 15:33:25.336: E/AndroidRuntime(563):  at dalvik.system.NativeStart.main(Native Method)
</code></pre>
