Skip to content
Advertisement

Generate a image with custom text in Android

I’m trying to make an app for create custom cards. I’d like to add some text over a custom background (a jpg image).

What is the best way of doing it? I’d need to show the user a preview of the card before send it to the server.

Thanks

Advertisement

Answer

Use below code to achieve your requirement

JavaScript

You have to use below permission in manifest file.

JavaScript

For my device the path is /sdcard to access external SD card, it may vary for other devices. Some devices may have /mnt/sdcard may be it is for internal sd cards. Just check it while before using this code.

Actually I wrote the above code for some other question, which required time stamp on photo after captured from camera. I gave you the same solution with a little modifications for your specific requirement.

I hope you can understand this. If you have any doubts regarding code feel free to ask.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement