# android-gif-encoder **Repository Path**: gx_wz/android-gif-encoder ## Basic Information - **Project Name**: android-gif-encoder - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-07-23 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README android-gif-encoder =================== An animated GIF encoder for Android, without any native code required. Based on the J2ME encoder posted here: http://www.jappit.com/blog/2008/12/04/j2me-animated-gif-encoder/ with the addition of dirty rectangle support. ## Example usage: ```java public byte[] generateGIF() { ArrayList bitmaps = adapter.getBitmapArray(); ByteArrayOutputStream bos = new ByteArrayOutputStream(); AnimatedGifEncoder encoder = new AnimatedGifEncoder(); encoder.start(bos); for (Bitmap bitmap : bitmaps) { encoder.addFrame(bitmap); } encoder.finish(); return bos.toByteArray(); } public void saveGif() { try { FileOutputStream outStream = new FileOutputStream("/sdcard/test.gif"); outStream.write(generateGIF()); outStream.close(); } catch(Exception e) { e.printStackTrace(); } } ```