You can simply draw text on the canvas directly without first creating a bitmap.
To do this, create a Paint with the correct configuration, calculate how large your text will be when it is drawn, and then draw the text directly on the canvas.
Paint textPaint = new Paint();
textPaint.setColor(Color.WHITE);
textPaint.setAntiAlias(true);
textPaint.setFakeBoldText(true);
textPaint.setStyle(Paint.Style.FILL);
textPaint.setTextAlign(Paint.Align.CENTER);
textPaint.setTextSize(30f);
String myText = "This is a test";
Rect textBounds = new Rect();
textPaint.getTextBounds(myText, 0, myText.length(), bounds);
canvas.drawText(myText, 0, myText.length() rect.width()/2, rect.height()/2, textPaint);
In the above code, the text will be highlighted in the center, but you can easily change it to suit your needs.