Coder Social home page Coder Social logo

cosminadrianpopescu / cups-client Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 4.21 MB

Simple CUPS client for Android devices

License: GNU General Public License v3.0

JavaScript 63.93% TypeScript 29.44% HTML 2.83% SCSS 3.81%
android android-app cups-client cups

cups-client's Introduction

Cups Client

This is a simple client to connect to a CUPS server to print documents. It can run on Android devices or as a standalone PWA application.

I've search a lot of time for a decent CUPS client, and since I couldn't find one, I've developed this one.

For example, CUPS Printing will try to install the printers locally. I've also used JfCupsPrint, but also it installs the printers locally.

This application is just a client. This means that all the printer administration (available printers, default options, jobs handling etc.) is done on the CUPS server. This will just connect to the server, display the available printers and will send documents to them.

The communication with the server is made using the IPP protocol. The javascript implementation is based on the node ipp library that I heavily modified. This is MIT licensed. The rest of the code is GPL 3.0 licensed.

Installation

You can download the latest release from the releases page and install it, or you can build it.

Building

git clone https://github.com/cosminadrianpopescu/cups-client
cd cups-client
npm install
ionic build --prod
npx cap add android
cp ./AndroidManifest.xml ./android/app/src/main/
npx cap copy
node ./resources/resources.js
cd android
./gradlew assembleRelease

After this you'll find the apk in android/app/build/outputs/apk/release/app-release-unsigned.apk. You need to sign this file before installing, like shown here:

cd ./app/build/outputs/apk/release/
keytool -genkey -v -keystore my-release-key.keystore -alias cups-client -keyalg RSA -keysize 2048 -validity 10000
mv app-release-unsigned.apk cups.client.apk
jarsigner -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore cups.client.apk cups-client

Please note that the Cordova HTTP plugin has a default timeout on connections of 30 seconds. I've modified manually in the code of the plugin this timeout to the timeout indicated in the options of the javascript remote call. The problem is that if you cannot connect to the CUPS server, it takes 30 seconds until you get an error message.

cups-client's People

Contributors

cosminadrianpopescu avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.