ITeye博客

Android Framework(I)Android Spring Json

sillycat · 2011-05-30 23:50 · Mobile Platform · 编程语言 · Git · Spring · Mobile · json · Android · Markdown

Android Framework(I)Android Spring Json 1. Backgroud of Spring Android and Json First, learn from spring. Spring Mobile project that provides extensions to Spring MVC for developing mobile web apps. Spring Android project that supports the development of native Android clients that communicate with spring-based back-ends. Spring Mobile 1. A HandlerInterceptor that uses a DeviceResolver to detect the Device that originated the current HttpServletRequest. 2. The ability to inject the detected Device into @Controller methods and view templates to vary logic by device type. Interceptor /WEB-INF/spring/appServlet/servlet-context.xml JSP template: Please try again or ">sign up Tiles-based page layout: vi pom.xml add sdk path and platform to them /home/luohua/tools/android-sdk-linux_x86 7 G7 Another example: svn checkout http://geonames-android.googlecode.com/svn/trunk/ geonames-android-read-only spring android samples: git clone git://github.com/SpringSource/spring-android-samples.git spring-android-samples spring android source: git clone --recursive git://github.com/SpringSource/spring-android.git spring-android 2. Spring Android and Maven Maven Configuration Maven Android Plugin Android applications are deployed to the device as an apk file, not a jar. You must specify this in the packageing configuration. apk ...snip... ...snip... Build Enviroment >vi /etc/enviroment ANDROID_HOME=/home/luohua/tools/android-sdk-linux_x86 PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/luohua/tools/android-sdk-linux_x86/tools: /home/luohua/tools/android-sdk-linux_x86/platform-tools" Configure an Android Virtual Device ...snip... Sample Application >git clone git://git.springsource.org/spring-mobile/samples.git spring-mobile-samples >cd spring-android-showcase start the server side >cd server >mvn install >cp /home/luohua/.m2/repository/org/springframework/android/spring-android-showcase-server /1.0.0-BUILD-SNAPSHOT/spring-android-showcase-server-1.0.0-BUILD-SNAPSHOT.war /home/luohua/tools/apache-tomcat-7.0.12/webapps/spring-android-showcase-server.war >bin/startup.sh verify the server side with this URL http://localhost:8080/spring-android-showcase-server/ run the Android Client modify the pom.xml >mvn clean install >mvn android:emulator-start problem here, the window of the emulator is too big solution: >telnet localhost 5554 >window scale 0.65 >quit >mvn android:deploy Problem: pkg: /data/local/tmp/spring-android-showcase-client.apkFailure [INSTALL_FAILED_OLDER_SDK] That is only because of the version. verify the AndroidManifest.xml modify the pom.xml: 10 10 I find an app named spring-android >adb logcat we can see the logs. 3. Spring Android and Eclipse IDE Installing Plugins using the Eclipse Marketplace Client Help ----> Eclipse Marketplace... m2eclipse-android click 'Go' and 'Install' egit click 'Go' and 'Install' And in another way, we can install this manly ADT https://dl-ssl.google.com/android/eclipse MAVEN2 http://m2eclipse.sonatype.org/sites/m2e MAVEN2-ANDROID https://svn.codespot.com/a/eclipselabs.org/m2eclipse-android-integration/updates/m2eclipse-android-integration/ Fetch the Sample Project >git clone git://git.springsource.org/spring-mobile/samples.git spring-mobile-samples create a Android Project in existing directory of spring-android-showcase/client enable mavenmanagement create a Dynamic Web Project in existing directory of spring-android-showcase/server enable mavenmanagement references: http://www.makeurownrules.com/rest-spring-maven-android http://code.google.com/p/geonames-android/ http://blog.springsource.com/2010/12/17/spring-android-and-maven-part-1/ http://www.springsource.org/spring-android

评论(1)

  1. #1 楼 · xiaowangzaixian · 2011-10-31 18:27

    能不能把源代码贡献出 阿

评论功能维护中,当前仅展示历史评论。