Rice Compression Algorithm Implementation on Android Apps

in #utopian-io9 years ago (edited)



File compression is a solution to overcome the size of the data size. Because the current limitations of data storage media into a major consideration for application developers. On this project I want to give an example of how to implement one of the data compression algorithms on android application.
The algorithm I choose is Rice Code Algorithm.

Rice Code algorithm is an algorithm created by Robert F. Rice, which shows the use of a subset of Golomb Coding derivatives to generate a simple code that allows suboptimal of the prefix code itself. The Rice Code algorithm is used in an adaptive coding scheme, which can refer only to a subset of Golomb Coding derivatives.

This project will compress text file on an android app using that algorithm.

Screen Shot 2017-12-31 at 11.21.42 AM.png

Minimum Requirement to Run This Project

  1. Requires at minimum Java 7
  2. Android Studio 2.3.

How to Import the Project in Android Studio?

  1. Open Android Studio > Open an existing Android Studio Project
  2. New window will opened > Browse to directory where you place AndroidApps project > Ok
  3. Wait for few minutes until all process import has finished.

Simulation Code Of Rice Code Algorithm

This is the example simulation code of Rice Code Algorithm . I Wrote this on Java Programming Language.

Screen Shot 2017-12-31 at 11.26.32 AM.png

Screen Shot 2017-12-31 at 11.26.49 AM.png
Screen Shot 2017-12-31 at 11.27.05 AM.png
Screen Shot 2017-12-31 at 11.27.19 AM.pngScreen Shot 2017-12-31 at 11.27.48 AM.png
Screen Shot 2017-12-31 at 11.27.34 AM.png
Screen Shot 2017-12-31 at 11.28.04 AM.png
Screen Shot 2017-12-31 at 11.28.30 AM.png
Screen Shot 2017-12-31 at 11.28.46 AM.png
Screen Shot 2017-12-31 at 11.30.32 AM.png

The Compression Process

Lets make a simple text to compress in our andorid phone.
kompress.png

Now Lets Open Our Android apps and select the compress button
1.png

Now lets click the select button than drive the file picker dialog to our sample text file

compress-layout.png
pickfile.png

now lets fill with our file result name , then click compress button
screeencompletedialogcompress.png

Now The Apps Will Show the Compression Result
compression_rsult.png

See the compresion result file by using our text editor program that available in your android phone. the file is ini kompresi directory

k0.png

k1.png

now lets click the file and see what happend

k2.png

What you see is the text containing the encrypted characters using the Rice Code algorithm

Decompression Process

To Decompress the compressed file lets go to main menu and then press the decompress button.
Now you will see the decompression dialog. Press the select file folder and drive the file picker dialog to the kompresi directory,

dc4.png
dc6.png

now lets click the button and you will see the decompression time
dc7.png

Now lets check the file in the dekompresi folder. And See the decompression file is exacly same

kompress.png

GITHUB LINK

https://github.com/iqbal09/Rice-Code-Compression-Algorithm-Java-Android

PROOF OF WORK

Screen Shot 2017-12-31 at 11.33.39 AM.png



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Amazing information thanks alot ;)💕👏👍

Hi dude @usahil , Thanks for the support, dont forget to follow me :)

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hi, Thanks For The Approval :)

Hey @iqbalhood I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

my cousin love android development, i surely recomend this article to him

Coin Marketplace

STEEM 0.04
TRX 0.33
JST 0.094
BTC 63413.19
ETH 1780.09
USDT 1.00
SBD 0.39