Problem to Connect to infura with Java Android

I downloaded the IPFS library as the following article

But it doesn’t show how to pass the credentials, like projectid and secretid

Follow the article, show me this error “android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)”

I know you need to send the information, but how to send this information to authenticate yourself?

private AppBarConfiguration appBarConfiguration;
private ActivityMainBinding binding;
MultiAddress IPFS_INFURA_URL = new MultiAddress("/dnsaddr/ipfs.infura.io/tcp/5001/https");



IPFS ipfsClient;

//Creating an IPFS client:


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    new Thread(new Runnable() {
        @Override
        public void run() {
            ipfsClient = new IPFS(IPFS_INFURA_URL);
        }
    }).start();

}

i tryed with ultiAddress(“kornerzipfs.infura-ipfs.io/ipfs/2H5loO4DyHz8E7SAvDhIzV8YDaL”) too

when after the last / is my project id

4 Likes

Hi @gabriel, I can’t see why you’d get “no address associated with hostname” - but then error messages don’t always accurately reflect the actual error!

You need to pass auth details like this:

add an auth header to your requests.

Hope that helps, let me know.

Warm regards,
Chris | Infura | ConsenSys

1 Like

Hi @chris.paterson

It’s my question, how send header request with IPFS Library.

Don’t it’s clear how send the information with MultiAddress or need use a class to send like a Httprequest

2 Likes

it was best dear go ahead with soft skin :zipper_mouth_face: :laughing:

I resolved sending the HTTPCONNECTION with my credentials TO IPFS CLASS, rewriting the Ipfs.java and Mulpart.Java

2 Likes

so be succsssfull dear congrationaltions