How to integrate soundcloud sdk in android application...! - java

I tried googling that's cause i am found 2 methods code.google.com/p/soundcloudapi-java/
in that step-1 occurred
java.lang.NoClassDefFoundError: oauth.signpost.commonshttp.CommonsHttpOAuthConsumer
i tried to found that solution but not got success anyone can help to sort out these bug......
am i trying to second one
github.com/soundcloud/java-api-wrapper so please suggest how to use it
Thanks in Advance...!!!!
i am including these library file...!!!

I found my mistake and how to integrate the sound-cloud SDK.
// Create a wrapper instance
ApiWrapper wrapper = new ApiWrapper("client_id", "client_secret", null, null, Env.LIVE);
Here, initialization of the ApiWrapper class pass old argument null at position of Env.LIVE* but in the new SDK it passes out Env.LIVE the parameter.

Related

Using enums with LispWorks' Java interface

I'm trying to use the EWS Java library (link) with LispWorks 7.1.2 Win32's Java interface. I am somewhat familiar with basic Java concepts but have no experience with the Java language. This is the code I am trying to mimic:
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
So I figured I would create an ExchangeVersion object (which is an enum), set it to the value "Exchange2010_SP2", and pass it to another create-java-object expression for the ExchangeService object.
This was my first step:
(create-java-object "microsoft.exchange.webservices.data.core.ExchangeService"
"microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion.Exchange2010_SP2")
However, I get the following error message: constructor of microsoft/exchange/webservices/data/core/ExchangeService first arguments is wrong type, wanted microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion got "microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion.Exchange2010_SP2"
OK, so then I tried this:
(create-java-object "microsoft.exchange.webservices.data.core.ExchangeService"
"microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion")
which gave me the error: constructor of microsoft/exchange/webservices/data/core/ExchangeService first arguments is wrong type, wanted microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion got "microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion". Which doesn't make much sense to me. So finally I tried to create a standalone ExchangeVersion object:
(create-java-object "microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion")
which led to this error message: CREATE-JAVA-OBJECT: : Failed to find constructors for class "microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion".
I wonder if anyone have suggestions on what am I doing wrong?
Many Thanks!

Azure Custom Vision Parameter this.client.endpoint() is required and cannot be null

I'm trying to get a basic Custom Vision image classifier working by following the tutorial in the Azure documentation found here: https://learn.microsoft.com/en-us/azure/cognitive-services/custom-vision-service/quickstarts/image-classification?pivots=programming-language-java
I have followed this tutorial word for word and have spent a couple days trying to work this out. The issue I am having is when running the code I am getting the following stack trace:
Parameter this.client.endpoint() is required and cannot be null.
java.lang.IllegalArgumentException: Parameter this.client.endpoint() is required and cannot be null.
at com.microsoft.azure.cognitiveservices.vision.customvision.training.implementation.TrainingsImpl.createProjectWithServiceResponseAsync(TrainingsImpl.java:2313)
at com.microsoft.azure.cognitiveservices.vision.customvision.training.implementation.TrainingsImpl$TrainingsCreateProjectParameters.execute(TrainingsImpl.java:2401)
at com.microsoft.azure.cognitiveservices.vision.customvision.samples.CustomVisionSamples.ImageClassification_Sample(CustomVisionSamples.java:67)
at com.microsoft.azure.cognitiveservices.vision.customvision.samples.CustomVisionSamples.runSample(CustomVisionSamples.java:46)
at com.microsoft.azure.cognitiveservices.vision.customvision.samples.CustomVisionSamples.main(CustomVisionSamples.java:374)
The endpoint is defined here and passed as a parameter
final String Endpoint = System.getenv("AZURE_CUSTOMVISION_ENDPOINT");
CustomVisionTrainingClient trainClient = CustomVisionTrainingManager.authenticate("https://{Endpoint}/customvision/v3.0/training/", CustomVisionTrainingClientKey).withEndpoint(Endpoint);
CustomVisionPredictionClient predictClient = CustomVisionPredictionManager.authenticate("https://{Endpoint}/customvision/v3.0/prediction/", predictionApiKey).withEndpoint(Endpoint);
While the tutorial doesn't explicitly state to do so I have tried to set the system environment variable AZURE_CUSTOMVISION_ENDPOINT manually with PowerShell and it doesn't work with or without this set.
Am I missing something? Any help would be greatly appreciated!
Fixed my own issue. The environment variables had not set correctly and were null pointers. I replaced the System.getenv call to the string in plain text and this is working correctly.

ExtendedItemHandle null after calling newExtendendItem

I have to refactor and migrate legacy code from pre 2010. Documentation is bad and I am pretty new to RCP and BIRT coding as well.
The thing is, that we replaced the broken ant build process with a maven tycho process and we got a running application. Now i need to fix a report which somehow does not get displayed and we dont know why.
ExtendedItemHandle eih = elementFactory.newExtendedItem( null, "Chart" );
The newExtendedItem method returns null for some unknown reason and I cant figure out why. Since the code is so old i figured it may have something to do with the target platform, but I dont know where to look. Any suggestions?
EDIT:
I should probably give some context:
// A session handle for all open reports
SessionHandle session = new DesignEngine( null ).newSessionHandle( (ULocale) null );
// Create a new report
reportDesignHandle = session.createDesign( );
// Element factory is used to create instances of BIRT elements.
elementFactory = reportDesignHandle.getElementFactory( );
It was a missing plugin. I dont know, which one, but eventually adding the whole target platform to my running configuration fixed it.

NoSuchMethodError on certain OS versions

I’m not sure why I’m getting this error only on certain Android versions (below 5.0).
I’m calling:
myImageView.setImageDrawable(getResources().getDrawable(R.drawable.image, null));
Because of this I’m getting a NoSuchMethodError.
What to do?
Use this
myImageView.setImageDrawable(ContextCompat.getDrawable(this,R.drawable.image));
Instead of this
myImageView.setImageDrawable(getResources().getDrawable(R.drawable.image, null));
EDIT
when you use setImageDrawable(getResources().getDrawable(R.drawable.image, null)); this it will shows below error
NOTE setImageDrawable(getResources().getDrawable(R.drawable.image, null)); this method is added in API level 21
You can read more about ContextCompat
Use ContextCompat, it's helper class for accessing features in
Context.
Using this class you can easily access the following resources,
ImageDrawable
String
Colour
ColorStateList
CodeCacheDir
And many more...
Try by following way,
myImageView.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.image));
#Prem answer is the right one. Just adding this to provide you with a tip.
In Android documentation there is an indication of which API level included each method. For example, the one you're using was introduced in Android 5.0 (API level 21).
You are calling
getResources().getDrawable(R.drawable.image, null) method which is added in API level 21
check Android docs
If you are using second parameter (theme) as a null
So try to use
getResources().getDrawable(R.drawable.image);
You can use following code for the same
myImageView.setImageDrawable(getResources().getDrawable(R.drawable.image));

Error on trying to create HawkConsole Object on TIBCO Hawk JAVA API

When i'm trying to create a HawkConsole Object using Hawk JAVA API, i'm get bellow error message
Unable to create EMS transport:
COM.TIBCO.hawk.console.nest.shared.TransportInitializationException:
COM/TIBCO/hawk/util/security/PasswordObfuscation
I'm using the follow code to try to create the object
hawkConsole = new TIBHawkConsole("MyDomain",
"MyEMSConnectionString",
"MyUserTOEMS",
"MyPasswortoEMS",
1);
In according with the official documentation, to the last parameter can be used anyone number ... This will be ignored ...
The object is successfully created but when the below line is executed the error happens
getAgentMonitor().initialize;
I think the exact syntax is getAgentMonitor():initialize;
Try to do and told me if it works.
Problem is solved.
Its necessary add the security.jar and utils.jar extracted from lib Hawk folder, on the Top of BUildPath to work.

Categories