I have searched lot on this issue and spent more than 3 days but none of the thread helped me. I am using Jersey oAuth to access webservice.
below is my code for jersey oAuth.
private SSRestServiceClient(String url, String consumerKey, String consumerSecret) {
OAuthParameters params = new OAuthParameters().signatureMethod(HMAC_SHA1.NAME).consumerKey(
consumerKey).version(OAUTH_VERSION);
OAuthSecrets secrets = new OAuthSecrets().consumerSecret(consumerSecret);
Client httpClient = Client.create();
OAuthClientFilter filter = new OAuthClientFilter(httpClient.getProviders(), params, secrets);
httpClient.addFilter(filter);
httpClient.addFilter(new LoggingFilter());
this.webResource = httpClient.resource(url);
}
for oAuth , I am using below apis,
- List item
- OAuth Client 1.12.jar
- OauthSignature-1.12 jar
- Jersey client -1.12 jar
- jersey-core-1.12.jar
- jersey-json-1.12.jar
- jsr311.jar
when i run this code in simple java application, it works fine but when i migrated this code from java to android , it start giving me error that
[2014-09-27 17:19:05 - Dex Loader] Unable to execute dex: Multiple dex files define Ljavax/ws/rs/ApplicationPath; [2014-09-27 17:19:05 - Demo-Jersey] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Ljavax/ws/rs/ApplicationPath;
I googled about it, some thread suggest me to remove ApplicationPath file from jsr311. I did the same but still not able to solve the problem.
can anyone know how to get rid of this problem? why this code is working in java and not in andriod?
is there any android specific jsr311 that i can use in my code?
kindly help me if anyone has a solution.