Closed abdielou closed 8 years ago
I tried the example in a new Android project and it worked.
Make sure you are using 3.2.0
which is the latest version at this point.
String text = "I know the times are difficult! Our sales have been "
+ "disappointing for the past three-quarters for our data analytics "
+ "product suite. We have a competitive data analytics product "
+ "suite in the industry. But we need to do our job selling it! "
+ "We need to acknowledge and fix our sales challenges. "
+ "We can’t blame the economy for our lack of execution! "
+ "We are missing critical sales opportunities. "
+ "Our product is in no way inferior to the competitor products. "
+ "Our clients are hungry for analytical tools to improve their "
+ "business outcomes. The economy has nothing to do with it.";
ToneAnalyzer toneAnalyzer = new ToneAnalyzer(ToneAnalyzer.VERSION_DATE_2016_05_19);
toneAnalyzer.setUsernameAndPassword("USERNAME", "PASSWORD");
toneAnalyzer.getTone(text, null).enqueue(new ServiceCallback<ToneAnalysis>() {
@Override
public void onFailure(Exception e) {}
@Override
public void onResponse(final ToneAnalysis tone) {
// Run view-related code back on the main thread
MainActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
System.out.print(tone);
}
});
};
});
I'm trying to run the Tone Analyzer Example but it won't initialize. Below is the error I'm getting.
JDK version - 1.8 java-sdk version - 3.0.1 & 3.2.0