Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
com.gluonhq:aws-java-sdk-pom
The Amazon Web Services SDK for Java Mobile provides Java APIs for building software on AWS’ cost-effective, scalable, and reliable infrastructure products. The AWS SDK for Java allows developers to code against APIs for all of Amazon's infrastructure web services (Amazon S3, Amazon EC2, Amazon SQS, Auto Scaling, etc).
The AWS SDK for Android provides a library and documentation for developers to build connected mobile applications using AWS.
This section explains how to understand and work with the various components of the SDK. The SDK provides direct access to many AWS service API's. It also has a collection higher level API's (called mobile connectors) which make mobile development easier.
The AWS SDK for Android supports the following AWS services:
Uploading a File to Amazon S3, and then downloading it using Async Task
private class S3Example extends AsyncTask<Void,Void,Void>{
@Override
protected Void doInBackground(Void... params) {
// Initialize the Amazon Cognito credentials provider
CognitoCachingCredentialsProvider credentialsProvider = new CognitoCachingCredentialsProvider(
MY-ACTIVITY.getApplicationContext(), // Application Context
"MY-IDENTITY-POOL-ID", // Identity Pool ID
Regions.SELECT_YOUR_REGION // Region enum
);
AmazonS3Client s3Client = new AmazonS3Client(credentialsProvider);
File fileToUpload = YOUR_FILE;
//(Replace "MY-BUCKET" with your S3 bucket name, and "MY-OBJECT-KEY" with whatever you would like to name the file in S3)
PutObjectRequest putRequest = new PutObjectRequest("MY-BUCKET", "MY-OBJECT-KEY",
fileToUpload);
PutObjectResult putResponse = s3Client.putObject(putRequest);
GetObjectRequest getRequest = new GetObjectRequest("MY-BUCKET", "MY-OBJECT-KEY");
S3Object getResponse = s3Client.getObject(getRequest);
InputStream myObjectBytes = getResponse.getObjectContent();
// Do what you want with the object
myObjectBytes.close();
return null;
}
}
There are only a few fundamentals that are helpful to know when developing against the AWS SDK for Android.
The SDK provides access to many AWS Services. At the most basic level the SDK provides a request/response model for many of the various service methods. At this level, for a given service, you will have a client that accepts request objects and will pass back a response object, or throw an error. This basic model is shown in the above example. Looking at the Javadoc you will notice that services typically have a com.amazonaws.services.servicename package and com.amazonaws.services.servicename.model package . This servicename package contains the client that you will pass request/response objects to in order to make service calls. The servicename.model package contains classes that model the request and response parameters of calls to and from AWS services.
The SDK also provides a higher level experience for many services.
The TransferUtility adds convenience and reliability on top of using the standard AmazonS3Client
when uploading and downloading data to S3:
The Transfer Manager adds convenience and reliability on top of using the standard AmazonS3Client
when uploading and downloading binary data to S3:
DynamoDB Object Mapper lets you map client-side classes to DynamoDB tables similar to standard ORM techniques. With it you can:
Note: The DynamoDB Mapper is in a separate jar (and Maven package), but requires the DynamoDB jar to be on the classpath. If you want to use S3 Links, you will also need the Amazon S3 jar on the classpath.
The Lambda Invoker helps calling code in the cloud via AWS Lambda by:
The Amazon Cognito mobile connector provides the ability to:
Note: The Amazon Cognito Federated Identities classes are part of AWS SDK for Android - Core
(aws-android-sdk-core
Maven package) and can be found here. The Amazon Cognito Sync code can be found here.
Using Amazon Mobile Analytics, you can:
Amazon Kinesis allows for real-time processing of streaming data at massive scale. Unlike Amazon Mobile Analytics, using Amazon Kinesis developers write server side code to process data sent to Kinesis. An example would be recording click stream data.
Follow these step-by-step instructions to get up and running with the SDK. Please note the AWS SDK for Android supports Android API level 10+.
Before you begin, you need to sign up for an AWS account here, click 'Sign In to the Console', and select new user.
Amazon Cognito Identity allows you to authenticate users to access your AWS resources without having to place your credentials within the applicaiton itself (which is very insecure).
To create a Identity Pool
The following 3 sections describe how you can depend on the SDK in your application using Gradle with Android Studio, Maven, or by downloading the Jar files from our website. If you use Maven or Gradle you can automatically get new versions of the SDK when they are released.
The AWS Android SDK (since version 2.1.3) is hosted in the Maven central repository. Gradle with Android Studio allows you to declare dependencies on packages in the Maven central repository right out of the box. Simply add "compile 'com.amazonaws:aws-android-sdk-SERVICE:2.x.x'"to your app's build.gradle (Module)'s dependencies{ } section, without the double quotes, but with the single quotes and replacing x.x with the version you want and SERVICE with any of the following
(hint: you can specify 2.+ or 2.x.+ to automatically get the latest version where the + is specified. Remember for version 2.X.Y an increase in X may indicate a breaking change or new features, while increases in Y are likely bug fixes, or small feature improvements)
Note: Cognito Identity authentication abilities are included in the aws-android-sdk-core which all of the following packages depend on.
The AWS Mobile SDK for Android (since version 2.1.3) supports Apache Maven. A Maven project contains a pom.xml file where you can specify the Amazon Web Services that you want to use in your app. Maven then includes the services in your project, so that you don't have to download the entire AWS Mobile SDK and manually include JAR files. If you're new to Maven and you'd like to learn more about it, see the Maven documentation.
Here's an example pom.xm showing how you can add Amazon Cognito Identity, Amazon S3, and Amazon Pinpoint to your project:
<dependencies>
<dependency>
<groupid>com.amazonaws</groupid>
<artifactid>aws-android-sdk-core</artifactid>
<version>[2.2,3.0)</version>
</dependency>
<dependency>
<groupid>com.amazonaws</groupid>
<artifactid>aws-android-sdk-s3</artifactid>
<version>[2.2,3.0)</version>
</dependency>
<dependency>
<groupid>com.amazonaws</groupid>
<artifactid>aws-android-sdk-pinpoint</artifactid>
<version>[2.2,3.0)</version>
</dependency>
</dependencies>
You can also download the .zip file containing the jars files of the SDK here. How you include these in your project will depend on the editor you are using.
For an Eclipse project, add the jar files to a folder in your project called 'libs' (creating one if it doesn't already exist). The Eclipse Android plug-in will usually add this to your classpath by default. If it does not right click your project --> properties --> Java build path (Libraries tab), add Jar and select the Jars you want to add
For Android studio, in the project view. Add the jars, under YourApp/app/libs, and right click the jar 'Add as Library'
This section describes how you can compile the SDK source code on your own.
You can build the source via Maven, which can be downloaded and installed from here. Building the SDK requires the Java 7 JDK.
After installing Java and Maven, clone this repository
The recommended IDE is Eclipse, but you should be able to use your favorite IDE as long as it supports Maven. You can import the cloned repository as 'Existing Maven Projects' and then start to make changes. In order to standardize formatting, please import eclipse-formatting.xml
into Java -> Code Stype -> Formatter
and eclipse.importorder
into Java -> Code Style -> Organize Imports
.
In a terminal, go inside the respository you just cloned and type
mvn package
from the repository directory and you will get the resulting JAR in the target folders of each service.
Note: that if you want to use the DynamoDB Object Mapper (dynamodbmapper) you will need to also include ddb (and optionally S3 if you want to use the S3 link capabilities). Also, if you want to use Cognito Sync, you will have to include it separately since it is not part of this repo. It can be found in here.
If you are using a Mac, you may run into issues when trying to compile, because certain Java installations do not set your JAVA_HOME environment variable, which is referenced in pom.xml. To fix this, you can run the command below, and then run 'mvn package'.
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
For more information on Android development, see the Android developer site at: developer.android.com
FAQs
The Amazon Web Services SDK for Java Mobile provides Java APIs for building software on AWS’ cost-effective, scalable, and reliable infrastructure products. The AWS SDK for Java allows developers to code against APIs for all of Amazon's infrastructure web services (Amazon S3, Amazon EC2, Amazon SQS, Auto Scaling, etc).
We found that com.gluonhq:aws-java-sdk-pom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.