Android, java

7 copy & paste snippets for Android


Tagged: , , , , , , , , ,

I listed seven common tasks that Android developers often face, it’s the kind of stuff that interrupts your train of tought and makes you think “Oh God.. this is boring and I have other things to do, let’s google for some code”.
And here it is. In no particular order.
Just copy and paste, no questions asked.

How to rotate a Bitmap in Android

This will rotate any Bitmap to the desired angle, in degrees.

How to copy a file in Android

The smart way, without that nasty new buffer[1024] thing.

How to delete a directory in Android

Yes, the directory itself and all the files and subdirectories recursively.

How to convert a byte array into an hexadecimal String

I will probably google this in the future and find my own post.

How to convert Android dps to pixels

You are welcome.

How to copy a directory in Android

Again yes, the directory itself and all the files and subdirectories recursively.

How to extract a zip archive in Android

This will extract any zip archive to the desired location on the filesystem.

.

Unique opportunity! Help a fellow grow his blog!

Hi there! If you’ve read this far maybe you think this was useful, or fun, or I don’t know what but for some reason You Got Here! Great! Please consider sharing this post with your network, I am trying to get The Code Butchery to grow so I can provide more content like this, will you help me in my journey? Thank you!

Share this

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.