vendredi 1 mai 2015

Using toJSONPretty();

I am trying to work with JSON objects with DynamoDB and am having difficulty. I'm trying to follow the tutorial: http://ift.tt/1rZaL3n

I wanted to use toJSONPretty(); on my object but the method is not recognized. I don't think I have the right gradle dependencies. I"m currently using:

compile 'com.amazonaws:aws-android-sdk-core:2.2.0'
compile 'com.amazonaws:aws-android-sdk-ddb:2.2.0'
compile 'com.amazonaws:aws-android-sdk-ddb-mapper:2.2.0' 

Previously, my dynamo client was set up using the imports:

 import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
 import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;

But looking at code from Dynamo/JSON tutorials, I see the import:

 import com.amazonaws.services.dynamodbv2.document.DynamoDB;

This seems to be required if you want to use the type DynamoDB as it:

 DynamoDB dynamo = new DynamoDB(new AmazonDynamoDBClient(...)); 

I don't understand the difference between these libraries or how they relate to each other. Help!




Aucun commentaire:

Enregistrer un commentaire