Skip to content

frankkienl/FrankkieNL_ThingiverseLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FrankkieNL_ThingiverseLib

Youtube Demonstration: http://www.youtube.com/watch?v=WnvH2NOA2xw

Java Library for connecting to the Thingiverse API (Android and 'Desktop' Java)

Getting Started:

  1. Download ThingiverseLib.jar

Tip: This file can be found in /ThingiverseLib/dist/

  1. Add it to your Java-project

Android-Tip: Paste it into /project/libs/

Desktop-Tip: (NetBeans) RightClick project name, Properties, Libraries, Add JAR/Folder

  1. Get clientId, clientSecret and clientCallback from:

http://www.thingiverse.com/developers

(click the 'Create an App!'-button)

  1. Use the following code:
ThingiverseClient client = new ThingiverseClient("clientId","clientSecret","clientCallback");
String authUrl = client.loginFirstTime(); //get url where the user must login
//IF DESKTOP
Desktop.getDesktop().browse(URI.create(authUrl)); //better put try-catch around it
//IF ANDROID
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(authUrl));
startActivity(i);
//ENDIF
String accessTokenString = client.loginWithBrowserCode(codeTheUserGotFromBrowser);
//Optional: save the accessTokenString, else the user must login with browser next time
//Now you can use the client to access the API
String featured = cleint.featured(); //get featured things, you will get JSON in a String
String thisUser = cleint.user("me"); //get info about logged-in user, you will get JSON in a String

About

Java Library for connecting to the Thingiverse API (Android and 'Desktop' Java)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published