Coder Social home page Coder Social logo

jpushbullet's Introduction

jpushbullet

A simple Java library to interface/use/access Pushbullet's API.

Dependencies:

To use the jpushbullet library, you require the following libraries:

How to use:

jpushbullet is intended to be very simple and lightweight. To start, you need to create a PushbulletClient.

PushbulletClient client = new PushbulletClient(api_key);

This creates the connection to Pushbullet's REST API and supplies the api_key used to identify users (as passed into the constructor). FYI, you can get the api key from https://www.pushbullet.com/account when logged in.

To identify user devices, you need to get the devices.

try {
	PushbulletDevice devices = client.getDevices();
} catch (IllegalStateException | IOException e) {
	e.printStackTrace();
}

This method is absolutely vital to use this library as you need device identification keys to send things via Pushbullet.

Finally, onto the real meat of things,

How to send things via jpushbullet

//where n is the device id as ordered by the list. 

//To send notes:
client.sendNote(devices.getDevices().get(n).getIden(), "SUPER TITLE YO", "JPUSHBULLET ROCKS!");

//To send files
client.sendFile(devices.getDevices().get(n).getIden(), new File("path to file");

//To send links
client.sendLink(devices.getDevices().get(n).getIden(), "title here=", "uhh the url here");

//To send list
client.sendList(devices.getDevices().get(n).getIden(), "title here", ArrayList<String> itemsToPush);

OR if you dont want to create an arraylist, you can insert lots of strings into the parameters instead.
client.sendList(devices.getDevices().get(n).getIden(), "title", "item 1", "item 2", "item 3" ... );

//To send an address
client.sendAddress(devices.getDevices().get(n).getIden(), "name of place", "address");

Thank you for using this! If you do. Maybe put this in your credits perhaps. With a link maybe.

jpushbullet's People

Contributors

ngbmameman avatar shakethat 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.