开发者

Importing access keys and secrets to an Android device

I've got an app that can save stuff you like to Google Storage for Developers. Assuming, of course, that you have an account and associated access keys. Their web based key management tool allows you to create keys and associated secrets. My question is regarding how a user 开发者_StackOverflow中文版can most easily install these in their copy of my app, allowing them to use the cloud storage.

A key is a 20 character alphanumeric string, and an associated secret is a 40 character Base-64 encoded string. It is clearly impractical for the user to enter these manually. Cut and paste across activities seems way awkward to me. How do you suggest getting two strings from a web page to two activity EditText fields - or to a tmp file I can read and then dispose - or ??

thanks.


The best way to go about it would be the API from Google


If you have access to a web page, there are these values are residing, you can download it, parse, and get these values.


Since it doesn't look like Google provides an API specifically for getting keys, your best bet would probably be to use an HTTP GET to pull the web page containing the keys and secret keys.

If you need to be authenticated with Google to do this (presumably you'd have to be), you could use SignPost to handle OAuth and make secure HTTP requests. After you pull the page, parse through the HttpResponse content and store the keys in a text file or a SharedPreferences file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜