Naturally, you are limited by memory when you want to create huge bitmaps, but you have enough memory to create quite large bitmaps. For example, a 1024 * 1024 bitmap ARGB_8888 will require approximately 4 MB of memory, which is not a problem if your application is economical with memory in general. The typical heap size for an Android app is usually between 16 and 32 MB depending on the version of Android to give you a feel for what you have to play with.
You say you are making a copy of a large bitmap, and this may be your main problem. There is no need to make a copy of a large bitmap, you only need one. Here is an example project that creates a large (1024 * 1024) white bitmap and draws a view in your application in the middle, and then writes the result to PNG:
package com.example.android; import android.app.Activity; import android.graphics.Bitmap; import android.graphics.Canvas; import android.os.Bundle; import android.os.Environment; import android.util.Log; import android.view.View; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; public class WhitePngActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); findViewById(R.id.draw_to_bitmap).setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Bitmap largeWhiteBitmap = Bitmap.createBitmap(1024, 1024, Bitmap.Config.ARGB_8888);
Together with this basic layout:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <Button android:id="@+id/draw_to_bitmap" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Click to draw to bitmap" /> </LinearLayout>
You will get a bitmap somewhere like /mnt/sdcard/Pictures/big-white-image-with-view.png , which looks something like this:

source share