Android和GSON [英] Android and GSon

查看:151
本文介绍了Android和GSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始看谷歌的GSON。的,因为它被输入,在最后一行的GSON无法识别以下code的错误。进口都OK等什么我缺少什么?

 进口com.google.gson *。
导入com.google.gson.stream *。公共类BuildJsonObject {
    GSON myGson =新GSON();
}


解决方案

你的GSON JAR添加到您的构建路径?

右键单击(项目) - >构建路径 - >配置构建路径... - >去'图书馆'选项卡 - >点击添加外部JAR ...,然后选择GSON jar文件

I am starting to look at google's Gson. The following code errors as it is entered in that the Gson in the last line is not recognised. The imports are ok so what am I missing?

import com.google.gson.*;
import com.google.gson.stream.*;

public class BuildJsonObject {
    Gson myGson = new Gson();
}

解决方案

Did you add the GSON Jar to your build path?

Right Click (Project) -> Build Path -> Configure Build Path... -> Go To 'Libraries' Tab -> Click 'Add External JARs...' then select the GSON jar file?

这篇关于Android和GSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆