我正在测试通过谷歌访问令牌获取用户信息
点击登录按钮后,我被重定向到
https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=access_token_here
并获得这样的一些JSON数据
{
"issued_to": "my client id.apps.googleusercontent.com",
"audience": "my client id.apps.googleusercontent.com",
"user_id": "user id here",
"scope": "https://www.googleapis.com/auth/plus.login",
"expires_in": 3596,
"access_type": "online"
}
Run Code Online (Sandbox Code Playgroud)
现在我需要知道如何提取用户名,地址和电子邮件任何帮助吗?
提前致谢
我已经在StackOverflow和网页上搜索了这个问题的答案,但我找不到答案.当我在Gingerbread上运行我的应用程序时,它运行正常.但是当我在4.2.2上运行它时,我得到了这个错误:java.lang.IllegalStateException Cannot perform this operation because the connection pool has been closed
我有一个包含两个片段的SherlockFragmentActivity.
片段1:
public final class TodoFragment extends SherlockListFragment {
NotesDbAdapter db;
private static final int DELETE_ID = Menu.FIRST + 1;
public static TodoFragment newInstance(String s) {
TodoFragment fragment = new TodoFragment();
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
db = new NotesDbAdapter(getActivity());
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
if (container == null) {
return null;
}
return ll;
} …Run Code Online (Sandbox Code Playgroud) 我希望能够使用适用于Android 的Google Maps API在两个用户定义的地理点之间显示路线.我还希望能够让用户选择要显示的路线类型,无论是步行,骑车,汽车等.此外,我希望能够计算使用此路线所需的时间和距离.我试过在网上搜索并查看其他stackoverflow问题,但无济于事.我该怎么做?我怎么能编码这个.
// - - 编辑 - - //
我还想得到交通信息,如繁忙的路线,拥堵等.
java android google-maps google-maps-api-3 google-maps-api-2
我搜索了SO但找不到答案.我的PHP脚本正在通过http post接收一些JSON,如下所示:
{
"task": [
{
"task_id": "3",
"task_due": "Oct 26 11:25",
"task_completed": "FALSE",
"task_desc": "fff",
"task_time": "20131026_112531",
"task_name": "fff"
},
{
"task_id": "2",
"task_due": "Oct 26 11:25",
"task_completed": "FALSE",
"task_desc": "rff",
"task_time": "20131026_112522",
"task_name": "xff"
},
{
"task_id": "1",
"task_due": "Oct 26 11:25",
"task_completed": "FALSE",
"task_desc": "fggg",
"task_time": "20131026_112516",
"task_name": "ff"
}
]}
Run Code Online (Sandbox Code Playgroud)
正如您所看到的,有3个项目,但是当我将其转换为PHP数组对象并计算项目时,我返回1,当它应该是3时,这是我的PHP代码:
$json_tasks = $_POST["json_array"];
$task_array = json_decode($json_tasks,true);
echo count($task_array);
Run Code Online (Sandbox Code Playgroud)
并echo count打印出"1",而不是"3".
我试图用这个语句将一些数据插入到MySQL数据库中:
INSERT INTO tweets(tweeter,tweet)VALUES ('Lord_Sugar','RT @BTSport: This cerebral figure succeeds in insulting everyone’s intelligence. @CalvinBook looks at Kinnears impact on #NUFC http://t.…')
Run Code Online (Sandbox Code Playgroud)
但是我收到了这个错误:
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u2019' in position 119: ordinal not in range(256)
Run Code Online (Sandbox Code Playgroud)
我知道它在谈论哪个角色 - 它在推文末尾的'...',但不知道如何绕过它.
android ×2
java ×2
arrays ×1
database ×1
google-api ×1
google-maps ×1
google-oauth ×1
http-post ×1
json ×1
mysql ×1
php ×1
python ×1
python-2.7 ×1
signing ×1