This repository has been archived by the owner on Jan 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 545
Starter guide
stephanenicolas edited this page Oct 24, 2012
·
28 revisions
You wanna see what RoboSpice looks like in action ? Great ! This is the page you are looking for.
Basically, you will want to add the RoboSpice library from maven central using this in your pom.xml file :
<dependency>
<groupId>com.octo.android.robospice</groupId>
<artifactId>robospice</artifactId>
<version>${robospice.version}</version>
</dependency>
If you want to perform REST requests (using spring android), then you will add this instead :
<dependency>
<groupId>com.octo.android.robospice</groupId>
<artifactId>robospice-spring-android</artifactId>
<version>${robospice.version}</version>
</dependency>
Now, you decide what kind of caching format you want to use :
Use one of these dependencies or a combination of them (version of dependencies are provided in the pom file of robospice-parent project:
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.simpleframework</groupId>
<artifactId>simple-xml</artifactId>
<exclusions>
<exclusion>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
</exclusion>
<exclusion>
<groupId>stax</groupId>
<artifactId>stax-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.j256.ormlite</groupId>
<artifactId>ormlite-core</artifactId>
</dependency>
<dependency>
<groupId>com.j256.ormlite</groupId>
<artifactId>ormlite-android</artifactId>
</dependency>
Add the RoboSpice jars from the download section to your libs folder.
TODO
To use RoboSpice in your application, there are 4 steps :
- 1 has to be performed once for all requests (creating a RoboSpice service) ;
- 1 has to be done for every Activity class (or only once for your project if you use a common base class for all your activities) ;
- and 2 steps have to be repeated for each requests (creating a request and a listener).