Android Talker(3)Go on with the REST Sample with Real Device


Eclipse Error Message:
Errors occurred during the build.

Errors running builder 'Maven Project Builder' on product 'xxxxx'.

java.lang.NullPointerException


Solution:
I do not know why there are 2 maven dependency plugins in my STS, so I try to remove the project configuration.

Click the project and choose:

Maven ----> Disable Maven Dependencies

Maven ----> Disable Maven Nature



After remove 2 maven dependencies, and then add the first maven dependency back.



And we need to make sure we add android path to our eclipse:

Run Configuration -----> Envrionment ---->

ANDROID_HOME /opt/android-sdk

SDK_ROOT /opt/android-sdk/tools



I will go on to learn the projects spring-android-showcase-client, spring-android-showcase-server.



Error Message:
org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation


Solution:
Add these converter

<beanid="handlerAdapter"class="com.sillycat.easygroovyplugin.servlet.proxy.ProxyAwareAnnotationMethodHandlerAdapter"]]>
<propertyname="messageConverters"]]>
<list]]>
<refbean="jsonConverter"/>
</list]]>
</property]]>
</bean]]>


<beanid="jsonConverter"
class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"]]>
<propertyname="supportedMediaTypes"value="application/json"/>
</bean]]>


I changed my easyrestserver side to use groovy controller, velocity for view.



I changed my EasyRestClientAndroid working with both get all persons and get one person.



I am using maven on my eclipse, so my command will be

>clean install android:deploy android:run



references:
http://developer.android.com/training/index.html

http://www.mkyong.com/spring-mvc/spring-3-mvc-contentnegotiatingviewresolver-example/



更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android的消息机制——Handler的工作过程
  2. android 消息传递机制
  3. 如何进行android开发
  4. Android(安卓)Activity加载Fragment的一
  5. Android NDK Hello
  6. Android Training - 运行你的程序
  7. Android res/raw文件;raw与res/assets异
  8. Android 6.0 运行时权限的处理
  9. katalon设置Android(安卓)SDK路径
  10. Android studio 入门笔记