1
votes

I would like to add Amazon services to my CodeName one App, I have downloaded java-SDK from Amazon and added a library to my App. Everything working properly in simulator once I gave Android build. If I try to access Amazon AWS in my android app I'm getting an error like "NoClassDefFoundError".

Here my question is CodeName one supports Amazon AWS or not. If Codename One supports integration with Amazon AWS then how can I integrate and use below AWS services

  1. Amazon Cognito,
  2. Amazon Cognito Sync,
  3. Amazon API Gateway,
  4. Amazon DynamoDB,
  5. AWS Device Farm,
  6. Amazon SNS(Simple Notification Service),
  7. Amazon Analytics.

enter image description here

1

1 Answers

0
votes

You can't just add an arbitrary JAR to Codename One, because we don't support all the features of Java SE as explained here.

There are two ways in which you can support Amazon and you can see samples of both approaches in the libraries section of Codename One.

  1. Wrap the native Android/iOS libraries - there is a long tutorial for this here and in the developer guide.

  2. Wrap the webservice/JSON API's which is a better approach in many regards as it is 100% portable and will bring you into platforms like UWP, Desktop, Web etc. This is the approach taken by parse4cn1.

Option 2 is superior for solutions like AWS as it's much easier to debug and doesn't require any native code etc. Ideally we'd love to have a proper AWS cn1lib similarly to the parse cn1lib.