Search code examples
javaandroid-studioapi-key

Usage Of Marvel API keys in Android Studio


Can some one tell, that how to use the Marvel API keys in android studio for building an app. I did not find a single article that could tell on how to use the Marvel API keys in android studio.


Solution

  • It's simple:

    1. Get Marvel Api Keys (public and private) from https://developer.marvel.com/account

    2. Now you need a Hash key to make requests:

    • Your will need a ts value (for example 1)
    • Generate md5 concatening (ts + private key + public key)
    1. Now, you can try in the browser calling https://gateway.marvel.com/v1/public/characters?apikey=$MARVEL_API_PUBLIC_KEY&ts=$MARVEL_API_TS&hash=$MARVEL_API_HASH

    For example: Private key: qqqq Public key: wwww ts: 1 -> here you can choose the value that you want

    1. Go to http://www.md5.cz/ and put qqqqwwww1 to generate md5 -> result : 30db1167f72b3ff7acbbd14df4c1f878
    2. Now, from browser you can try: https://gateway.marvel.com/v1/public/characters?apikey=wwww&ts=1&hash=30db1167f72b3ff7acbbd14df4c1f878

    If you are programing an Android App, you found an example here: https://github.com/yelotmany/Marvel-Characters