Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation is Quite Confusing (package names and .ts code in Android documentation) #3637

Closed
nithinbandaru1 opened this issue Sep 10, 2024 · 6 comments
Labels
question General question

Comments

@nithinbandaru1
Copy link

State your question

  1. Package names in repo README are different compared to package names provided in Amplify Documentation.
dependencies {
    implementation 'com.amazonaws:aws-android-sdk-SERVICE:2.x.y'
}

# Above, SERVICE might be s3, ddb, pinpoint, etc. A full list is provided below.
dependencies {
    // Amplify API dependencies
    implementation("com.amplifyframework:aws-storage-s3:2.19.1")
    implementation("com.amplifyframework:aws-auth-cognito:2.19.1")    
    // ... other dependencies
    coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")
}

Q1: I am not quite confused on which set should I be using for Android development. Please give some insight here?
Q2: com.amazonaws:aws-android-sdk, is this package AWS Mobile SDK which gives low level APIs and not Amplify SDK?
Q3: Amplify SDK, will it provide performance optimization or API usage optimization or both? Any insights on this like documentation could be great to understand Amplify advantages compared to other SDKs like Java SDK or Kotlin SDK which can also be used in Android if needed.
Q4: Code samples in Amplify documentation shows typescript code. Is that supposed to be that way?
Q5: I also see Gen 1 and Gen2 docs. Is Gen 1 legacy and Gen 2 latest? Gen 1 have V1 and V2 sessions. I don't get this part. I see that AWS REST APIs did not change from 2006. So I guess it is referring to Kotlin SDK versions? Correct? Or it just about amplify library versions?

Which AWS Services are you utilizing?
S3

Provide code snippets (if applicable)
Not applicable

Environment(please complete the following information):

  • SDK Version: Latest

Device Information (please complete the following information):

  • Device: Not applicable
  • Android Version: Not applicable
  • Specific to simulators: Not applicable
@github-actions github-actions bot added pending-triage Issue is pending triage pending-maintainer-response Issue is pending response from an Amplify team member labels Sep 10, 2024
@tylerjroach
Copy link
Member

@nithinbandaru1

The docs for the AWS-SDK-Android (this repo) can be found here: https://docs.amplify.aws/gen1/android/sdk/. The AWS SDK Android is an older SDK that was written pre-Amplify, but the provided documentation is hosted on the Amplify site. If you are writing new code, we would recommend that you use Amplify and/or the AWS Kotlin SDK.

The recommendation would be to use Amplify v2 (client side) with the Gen2 backend. Under the hood, the Amplify client library uses the AWS Kotlin SDK.

The AWS Kotlin SDK provides codegen API's to directly communicate with AWS Services. Amplify builds on top of these APIs to provide an opinionated solution/implementation to complex problems.

For example, Amplify Auth helps securely store tokens on device, and automatically handles refresh. Amplify Storage manages background transfers, restarts, splitting files for multipart uploads, etc. You could do all of this with the AWS Kotlin SDK, but you would have to implement the complexities of these scenarios yourself.

@tylerjroach tylerjroach added the question General question label Sep 10, 2024
@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 10, 2024
@tylerjroach tylerjroach removed the pending-triage Issue is pending triage label Sep 10, 2024
@nithinbandaru1
Copy link
Author

nithinbandaru1 commented Sep 10, 2024

@tylerjroach Thanks for the reply.

Based on your reply. I got what is gen 1 and gen 2 means, advantage of amplify. Can you please confirm below things.

Q1: Can I assume that README in this repo is outdated because I see the package names different in Gen 2 documentation as shown in below image, Ideally it should be pointing to latest, greatest and highly recommended one right?

Edit:

  • I just saw you said this repo is for AWS-SDK-Android. That makes sense.
  • So, this repo will have no more updates. Right?
  • I have to say this repo README is not very clear because at beginning it talks directly about Amplify without any context saying this is AWS Android SDK which is legacy and Amplify or AWS SDK for Kotlin should be used. Hope this will be updated.
  • Amplify repo is at https://github.com/aws-amplify/amplify-android.

https://docs.amplify.aws/android/build-a-backend/storage/set-up-storage/

image

Q2: Code samples in Amplify documentation shows typescript code. Is that supposed to be that way?

https://docs.amplify.aws/android/build-a-backend/storage/set-up-storage/

image

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 10, 2024
@vincetran
Copy link
Member

@nithinbandaru1 The README in this repo is accurate for developers that are still using or wish to use these packages. Therefore the README that says to use

dependencies {
    implementation 'com.amazonaws:aws-android-sdk-SERVICE:2.x.y'
}

is accurate for them.

The screenshot you provided to the Amplify documentation which all out packages with the namespace com.amplifyframework is also accurate for developers who wish to use Amplify. The README in this repo calls out Amplify as what we recommend as the "latest and greatest" and provides links to the documentation to use that library. We are not going to prevent developers from using this repo in their projects as there may be circumstances that require them to use this repo (e.g. older min SDK or a module that isn't supported by Amplify).

For your second question, the Typescript is there for setting up your backend resources like your S3 bucket. It is the Gen 2 way of setting up those resources. The Gen 1 way of setting up those same resources is to use the Amplify CLI tooling. You can read more about what Gen 2 specifically provides here: https://docs.amplify.aws/android/how-amplify-works/concepts/

@nithinbandaru1
Copy link
Author

Thanks for the fast replies guys. I really appreciate that. I think now I have good clarity on the AWS S3 SDK for Android ecosystem 😊.

@github-actions github-actions bot added the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 11, 2024
@vincetran
Copy link
Member

That's great! Glad we could help ☺️ will close this issue now.

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending response from an Amplify team member label Sep 11, 2024
Copy link
Contributor

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question General question
Projects
None yet
Development

No branches or pull requests

3 participants