英文:
Usage Of Marvel API keys in Android Studio
问题
如何在Android Studio中使用Marvel API密钥构建应用程序?我找不到一篇文章能够说明如何在Android Studio中使用Marvel API密钥。
英文:
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.
答案1
得分: 2
简单明了:
-
从 https://developer.marvel.com/account 获取 Marvel API 密钥(公钥和私钥)。
-
现在你需要一个哈希键来发起请求:
- 你需要一个 ts 值(例如 1)
- 生成 md5,连接(ts + 私钥 + 公钥)
-
现在,你可以在浏览器中尝试调用 https://gateway.marvel.com/v1/public/characters?apikey=$MARVEL_API_PUBLIC_KEY&ts=$MARVEL_API_TS&hash=$MARVEL_API_HASH
例如:
私钥:qqqq
公钥:wwww
ts:1 -> 在这里你可以选择想要的值
- 前往 http://www.md5.cz/ 并输入 qqqqwwww1 以生成 md5 -> 结果: 30db1167f72b3ff7acbbd14df4c1f878
- 现在,你可以尝试在浏览器中输入:
https://gateway.marvel.com/v1/public/characters?apikey=wwww&ts=1&hash=30db1167f72b3ff7acbbd14df4c1f878
如果你正在编写一个 Android 应用程序,你可以在这里找到一个示例:https://github.com/yelotmany/Marvel-Characters
英文:
It's simple:
-
Get Marvel Api Keys (public and private) from https://developer.marvel.com/account
-
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)
- 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
- Go to http://www.md5.cz/ and put qqqqwwww1 to generate md5 -> result : 30db1167f72b3ff7acbbd14df4c1f878
- 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
答案2
得分: 1
Server-side applications must pass two parameters in addition to the apikey parameter:
ts - a timestamp (or other long string which can change on a request-by-request basis)
hash - an md5 digest of the ts parameter, your private key, and your public key (e.g. md5(ts+privateKey+publicKey)
英文:
Server-side applications must pass two parameters in addition to the apikey parameter:
ts - a timestamp (or other long string which can change on a request-by-request basis)
hash - a md5 digest of the ts parameter, your private key and your public key (e.g. md5(ts+privateKey+publicKey)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论