Getenv() can't find API key although API key is defined in project

Hi all,

I have a problem with .env file contain API key. Everytime I call getenv(“API_KEY”), it always return null.

Here is steps to get my api key:

I created an API_KEY.env contain:

Then, I put this key in my project. In MainActivity I call System.getenv(“API_KEY”) to get value of environment variable API_KEY.env but it always return null.

Did I have mistake in steps?

I configured follow in this document:

Please help me! Thanks!


Can you try getenv(“MBED_CLOUD_SDK_API_KEY”)?
Also, to rule out bad key value, test using curl as outlined here - Hope this helps.

Prior API KEY was an known to subject to me, i searched in facebook many times to know about the topic. Now could understand the thing. Much informative thread.