Menu
Who Do Is
  • Home
  • What
  • How
  • Is
  • Can
  • Are
  • Does
  • Do
  • Why
  • Who
  • Where
  • Which
  • Which
  • Should
  • Will
  • When
  • What’s
  • Did
Who Do Is

[ANSWERED] java – How do I configure AWS Amplify without the command-line tool?

Posted on November 14, 2022

Solution 1 :

I figured it out!

The Amplify.configure() has a not-well-documented overload where you can specify a config file in the form of an Android “resource.”

So instead of using

    Amplify.configure(getApplicationContext());

as directed in the tutorials, I use

    Amplify.configure(
        AmplifyConfiguration.fromConfigFile(getApplicationContext(), R.raw.amplifyconfiguration),
        getApplicationContext());

The config file needs to be located in the app/src/main/res/raw/ path of the project, named amplifyconfiguration.json. The development environment automatically generates the definition of the value R.raw.amplifyconfiguration, which is a number identifying the file.

That solves the problem of loading the configuration from an explicit file, without using the amplify CLI. The next hurdle is figuring out what keys can be specified in the file…

Problem :

I’m trying to write an application that uses the AWS API from an Android app written in Java. It seems that the recommended way to do it is using a special set of libraries called “Amplify.” I was able to import the appropriate Amplify Java classes into my code, but I see that not all the parameters I want to supply (such as the S3 bucket or the API access key) can be given as method arguments.

All the advice I see online suggests running a command-line configuration command using npm install aws-amplify. But I’d prefer not to use a command-line tool which asks me questions: I’d prefer to configure everything in code. And I don’t want to install npm or mess around with it (full disclosure, I tried installing it and got some hassles).

Is there a way to supply the Amplify configuration without using the command-line tool, perhaps via a configuration file or some additional arguments to the methods I’m calling within Java?

READ  [ANSWERED] flutter - This method 'Scaffold' isn't defined for the type 'MyApp'
Powered by Inline Related Posts

Comments

Comment posted by barrelmaker

Indeed, and how do I configure it?

Comment posted by stackoverflow.com/questions/61281838/…

The amplify resources are configured using the Amplify CLI, which for each resource generates its own cloudformation templates. The same question was asked for IOS application. There is some hacks. But the clean solution is to use the CLI.

Comment posted by docs.amplify.aws/lib/auth/existing-resources/q/platform/android

These links can help someone who is still looking for what to put inside the configuration file: Auth:

Recent Posts

  • How can I play with my cat without toys?
  • What is a bag pipe band called?
  • Are Honda Civics actually fast?
  • Are Yankee candles toxic?
  • How do I pair my Michael Kors smartwatch with my Android?

Recent Comments

No comments to show.

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuántas
  • ¿Cuánto
  • ¿Que
  • ¿Quién
  • 90” and 108” so you may have to round up to the nearest size.
  • and delete any Spotify folders from it. Once this is done
  • Android
  • Are
  • At
  • Bei
  • blink
  • C'est
  • Can
  • carbs
  • Comment
  • Did
  • Do
  • Does
  • During
  • For
  • Has
  • How
  • In
  • Is
  • Ist
  • Kann
  • Können
  • nouveau
  • On
  • or 108 inches.2020-08-03
  • Où
  • owning
  • Pourquoi
  • Puis-je
  • Quand
  • Quante
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • spiritual
  • tap the downward-facing arrow on the top left. A downward-facing arrow will appear underneath each song in the album; they'll turn green as the download completes.2020-07-28
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welcher
  • Welches
  • Welke
  • Wer
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Whose
  • Why
  • Wie
  • Will
  • Wo
  • Woher
  • you will receive two curtains each with the same measurements of width 66"" (168cm) x drop 54""(137cm).
  • you'll see a green downward-facing arrow next to each song.2021-02-26
©2023 Who Do Is | Powered by SuperbThemes & WordPress