Image-Steganography-Library-Android
Introduction:
Repo https://github.com/aagarwal1012/Image-Steganography-Library-Android
Issue https://github.com/aagarwal1012/Image-Steganography-Library-Android/issues/5
PR https://github.com/aagarwal1012/Image-Steganography-Library-Android/pull/4
Today I found a good repo that I wanted to contribute to. Its relatively new so I think there's a good chance to get my work accepted into it quickly. The Repo is an Image Stenography app in which encodes text into images encrypted with a password. Saving and encoding both are too much load on the UI thread and often cause the system to hang, I want to apply a fix of this nature to the save function for this app. When I first tried saving the photo I encoded the system would just hang and not function at all. The app didn't even save the photo.
Work
I recently had to deal with an issue regarding saving photos on android, and I noticed with this app that it never asked me permission to access my file to save the photo. So I opened my other app and pulled out a trusty function I used to check my permission settings!
So this only tackles the saving not working, Next I need to add a worker thread to save the file in the background so that the UI thread is not blocked by work.
To do this ill create a function to save the image then ill call the function from a worker thread.
Worker Call and Start:
This worked, everything was smooth except there were chances of trying to decode when encoding is still happening. For this Just try and implement a loading fragment and have the thread callback to dismiss it
I never knew but by calling .post in the thread we can run a small chunk of code on the UI thread. This snippit will disable the loading screen when the process is done
Looks Great!
Comments
Post a Comment