- What is compressor-head-android?
- What is Compressor Head?
- Setting up the Project
- Running the App
- Contributing
- Additional Learning
Compressor Head on Android is an Android client that generates image URLs for the Compressor Head web application. It takes various specifications of an image such as its URL or source, width, height, and format (PNG, JPEG or WEBP) as arguments to generate a usable image URL in accordance with the dimensions and format specified.
Compressor Head is a fast web application based on Python to resize images. For a more detailed explanation, visit the Compressor Head project. You can use this to compress images for websites which have a maximum capping for uploading an image or use it to scale up the images.
If you want to just download the app
- Just download .zip file.
If you want to contribute to the project
- Fork the repository by clicking on the Fork icon at the top right corner of this page.
- Clone the repository on to your local machine by running the following commands on git:
$ git clone https://github.com/[YOUR-USERNAME]/compressor-head-android.git
- If you need help, refer Forking and Cloning in git. You can also ask for help on the chat.
- Download and install Android Studio.
- You will also need to download the Android SDK from the IDE itself.
- Import the cloned repository into Android Studio by clicking on
files --> Open
and navigate to the directory where you forked the repository.
- The Elipse IDE and its setup guide.
- The IntelliJ IDEA and its setup guide.
- Download and install Android Studio.
- You will also need to download the Android SDK from the IDE itself.
- Import the cloned repository into Android Studio by clicking on
files --> Open
and navigate to the directory where you forked the repository.
Install the packages required to build the android project
sudo apt install android-sdk android-sdk-platform-28
export ANDROID_HOME=/usr/lib/android-sdk
Build the app from project
gradle assembleDebug
Via your own android smartphone.
-
Enable USB Debugging on your phone.
-
Install adb drivers for your smartphone from your manufacturer's website.
-
Click Run on the Android Studio tool bar, or Shift + F10 and then choose your phone to run the app.
By running a virtual device.
- Setup a Android Virtual Device in the IDE.
- Click Run on the Android Studio tool bar, or Shift + F10 and then choose the newly created virtual device to run the app.
Via your own android smartphone.
-
Enable USB Debugging on your phone.
-
Install drivers for your smartphone from manufacturer's website.
-
Install the app with adb (Android Debud Bridge).
adb start-server # Start the adb server
adb devices # Check your device is available
adb install -r app/build/outputs/apk/app-debug.apk
By running a virtual device.
- Install Shashlik
wget http://static.davidedmundson.co.uk/shashlik/shashlik_0.9.3.deb # Download the deb package
sudo dpkg -i shashlik_0.9.3.deb # Install the package
sudo apt-get install -f && sudo dpkg -i shashlik_0.9.3.deb # This step is only if you encounter errors in previous step
- Run the app
cd app/build/outputs/apk # Change the directory
shashlik-run app-debug.apk compressor-head-android
Step 1: Fork this project:
Go to the top right of the project page and click on "Fork". A fork of this repo will be created on your GitHub account.
Step 2: Code your changes:
Create a new branch by:
git checkout -b YOUR_NEW_BRANCH_NAME
Then create/edit files as per your coding requirements. Ensure that your code is clean and efficient, and avoid redundancies. It is also advised to follow naming conventions as and where specified. Also make sure that your code is your own, and is not closed-source or stolen.
Step 3: Commiting and pushing the changes:
Commit the changes and push the commit to your forked repository on GitHub by:
# for including inidividual files
git add filename.extension
# for including all files at once
git add .
git commit -m"Your commit message here"
git push origin
If stuck at this point, refer here
Step 4: Sending a Pull Request (PR):
Once you are done coding the changes, commit the files and create a PR. Click on "Compare across forks" when creating the PR, and select the master branch of this repo as the base. Set the head to your branch on your fork. Click on the button "Create Pull Request". Give your PR a meaningful title and a brief message explaining the purpose of your commits.
Step 5: Ensuring code quality
Once a PR has been created, check if it can be merged without any issues or conflicts. If there are any issues, repeat from Step 2 and try to resolve them. Wait for a reviewer to cross check your changes, and then merge your changes. Also wait for Codacy Reviewer to review the changes made by your commits and in case of any error fix them first.
- Additional Reference regarding clone, fork and editing a repository here.
Keep Contributing to open source! =)