GithubHelp home page GithubHelp logo

stephanenicolas / robospice Goto Github PK

View Code? Open in Web Editor NEW
2.9K 214.0 545.0 70.37 MB

Repo of the Open Source Android library : RoboSpice. RoboSpice is a modular android library that makes writing asynchronous long running tasks easy. It is specialized in network requests, supports caching and offers REST requests out-of-the box using extension modules.

License: Apache License 2.0

Java 99.96% Shell 0.04%

robospice's Introduction

Overview Build Status on Travis: Maven Central

We froze RS last week, the library is not maintained anymore. Personnally, I now always use a mix of retrofit and Rx instead, RS has sailed a long way home and yes, the latest constraints in android O don't make it easy for RS at all, it's probably the last nail in its coffin. @stephanenicolas

Thx to all RS users for your warm support, it's been a pleasure to ofer this library to the community. Thx to @rciovati too for his important contributions to RS !


RoboSpice is a modular android library that makes writing asynchronous network requests easy !

To learn more about RoboSpice in 30 seconds, try [this infographics] (https://raw.github.com/stephanenicolas/robospice/master/gfx/RoboSpice-InfoGraphics.png).

If you want to start using RoboSpice right now, jump to the Wiki or the samples.

The Wiki has a fully detailed section to quickly setup you up whether you use Gradle, Maven or ant/eclipse.

Main features of RoboSpice

  • supports Android starting from SDK version 8 (Froyo / 2.2.x)
  • executes network requests asynchronously (in a background AndroidService)
  • supports REST out of the box (using Spring Android or Google Http Client or Retrofit).
  • is strongly typed ! You query webservices using POJOs as parameters and you get POJOs as request results.
  • enforces no constraints neither on POJOs used for requests nor on Activity classes you use in your projects
  • caches results in Json with both Jackson or Jackson2 or Gson, or Xml, or flat text files, or binary files, even using ORM Lite (still in beta)
  • notifies your activities (or any other context) of the result of the network request with respect to their lifecycles.
  • notifies your activities (or any other context) on the UI Thread
  • no memory leaks at all, like Android Loaders, unlike Android AsyncTasks
  • uses a simple but robust exception handling model
  • supports multi-threading of request executions
  • is stable, efficient and designed to respect Android philosophy
  • supports request cancelling, request priorization and requests aggregation
  • supports aggregation of different web services
  • is a full featured replacement for long �running AsyncTasks even if they are not related to networking.
  • is open source ;)
  • and tested (more than 200 tests)

RoboSpice is under Quality control on Sonar's Nemo instance. Thanks to Sonar Source.

To learn more about RoboSpice

To learn more, look at the presentation slides we created for DroidCon UK 2012, they are available in the download section.

A few links :

Example code & demo

The RoboSpice team proposes a lot of sample applications in their own GitHub repo.

We also propose a few demo :

A project initiated by Octo Technology

Octo Technology logo

RoboSpice has been incubated at Octo Technology, a french company based in Paris, focused on software design and quality. It offers its employees to work part time on Research & Development projects. RoboSpice was one of them.

RoboSpice is the news

RoboSpice has been featured in

RoboSpice has been presented at :

RoboSpice video at DroidConLondon

Robospice presentation by David Stemmer

License

Copyright (C) 2012 Octo Technology (http://www.octo.com)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Alternatives to RoboSpice

Projects related to RoboSpice

  • Blandware Android AtLeap Core is a library accelerating development. It contains universal Content Provider (for SQLite, ORMLite), Drawer, Account Authenticator, etc. AtLeap Sample is a good example of RoboSpice, Retrofit, ORMLite, Picasso integration.
  • SpiceAnnotations : using RoboSpice and Android Annotations by Daniel Dekanski. Also read his blog post.

robospice's People

Contributors

agrebnev avatar anton-pogonets avatar florianmski avatar gkylafas avatar intrications avatar jeromevdl avatar jmeiss avatar jorgevila avatar lionleaf avatar lukesleeman avatar mgamerz avatar mikegr avatar nkeskinov avatar pdegand avatar rciovati avatar richarth avatar seva-ask avatar shenwill avatar softwaremaverick avatar splatte avatar stephanenicolas avatar tannerperrien avatar weefbellington avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

robospice's Issues

addListenerIfPending bug

Hi,

According to the javadoc, using spiceManager.addListenerIfPending is supposed to do absolutely nothing if there's no actual request pending. However when I use it, the method onRequestProgressUpdate of my listener does get called with a PENDING status, even if I haven't launched any request at all.
This happens on the latest 1.2.1-SNAPSHOT.

Cheers

Caching not working for REST requests with JacksonSpringAndroidSpiceService

I have an android app set up following the sample code for using JacksonSpringAndroidSpiceService which is working to perform network requests, but doesn't seem to be caching the responses.

I'm setting up the SpiceManager like this:

 private SpiceManager mRestManager = new SpiceManager(JacksonSpringAndroidSpiceService.class);

Then, I'm executing the request like this:

mRestManager.execute(customSpiceRequest, requestCacheKey, 
            DurationInMillis.ALWAYS, new CustomRequestListener())

My customSpiceRequest extends SpringAndroidSpiceRequest. I've made certain that requestCacheKey is identical between requests too.

Is there something else I need to do to enable caching between requests?

Can't get progress update by setRequestProgressListener

I set a listener before request ,but the listener never call ..

public void request(CachedSpiceRequest<JsonObject> request,
            RequestListener<JsonObject> listener) {
        request.setRequestProgressListener(this);
        spiceManager.execute(request, listener);
    }

Can build from master

Hi,
This looks like a very useful library, but I can't get started. I've downloaded Maven and followed the rest of the instructions and get errors on mvn clean install from the robospice-master directory.

I'm new to Maven. Can you see what's wrong? I tried the non-maven users's instructions and that failed too. I saw mention on another issue about getting 1.3.1 but how do I get through Git?

Thanks!

Mark

[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-cache:jar:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-cache-test:apk:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-cache-parent:pom:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice:jar:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-core-test:apk:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-core-parent:pom:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-spring-android:jar:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-spring-android-test:apk:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-spring-android-parent:pom:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-google-http-client:jar:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-google-http-client-test:apk:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-google-http-client-parent:pom:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-ormlite:jar:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-ormlite-test:apk:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-ormlite-parent:pom:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-ui-spicelist:jar:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-ui-spicelist-test:apk:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-ui-spicelist-parent:pom:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ com.octo.android.robospice:robospice-parent:1.3.2-SNAPSHOT, C:\programs\robospice\robospice\pom.xml, line 470, column 12
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.octo.android.robospice:robospice-parent:pom:1.3.2-SNAPSHOT
[WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ line 470, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Robospice - Parent
[INFO] Robospice - Persistence Module Parent
[INFO] Robospice - Persistence Module
[INFO] Robospice - Persistence Module tests
[INFO] Robospice - Core Module Parent
[INFO] Robospice - Core
[INFO] Robospice - Core Module tests
[INFO] Robospice - Extension Spring Android Module Parent
[INFO] Robospice - Extension Spring Android Module
[INFO] Robospice - Extension Spring Android Module tests
[INFO] Robospice - Extension Google Http Java Client Module Parent
[INFO] Robospice - Extension Google Htpp Java Client Module
[INFO] Robospice - Extension Google Http Java Client Module tests
[INFO] Robospice - Extension ORMLite Module Parent
[INFO] Robospice - Extension ORMLite Module
[INFO] Robospice - Extension ORMLite Module tests
[INFO] Robospice - Extension UI SpiceList Parent
[INFO] Robospice - Extension UI SpiceList Module
[INFO] Robospice - Extension UI SpiceList Module tests
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Robospice - Parent 1.3.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ robospice-parent ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ robospice-parent ---
[INFO]
[INFO] --- maven-javadoc-plugin:2.9:jar (attach-javadoc) @ robospice-parent ---
[INFO] Not executing Javadoc as the project is not a Java classpath-capable package
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ robospice-parent ---
[INFO] Installing C:\programs\robospice\robospice\pom.xml to C:\Users\Mark Murphy.m2\repository\com\octo\android\robospice\robospice-parent\1.3.2-SNAPSHOT\robospice-parent-1.3.2-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Robospice - Persistence Module Parent 1.3.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ robospice-cache-parent ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ robospice-cache-parent ---
[INFO]
[INFO] --- maven-javadoc-plugin:2.9:jar (attach-javadoc) @ robospice-cache-parent ---
[INFO] Not executing Javadoc as the project is not a Java classpath-capable package
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ robospice-cache-parent ---
[INFO] Installing C:\programs\robospice\robospice\robospice-cache-parent\pom.xml to C:\Users\Mark Murphy.m2\repository\com\octo\android\robospice\robospice-cache-parent\1.3.2-SNAPSHOT\robospice-cache-parent-1.3.2-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Robospice - Persistence Module 1.3.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ robospice-cache ---
[INFO] Deleting C:\programs\robospice\robospice\robospice-cache-parent\robospice-cache\target
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ robospice-cache ---
[INFO]
[INFO] --- maven-checkstyle-plugin:2.9.1:check (default) @ robospice-cache ---
[INFO]
[INFO] There are 16 checkstyle errors.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Robospice - Parent ................................ SUCCESS [1.652s]
[INFO] Robospice - Persistence Module Parent ............. SUCCESS [0.025s]
[INFO] Robospice - Persistence Module .................... FAILURE [2.250s]
[INFO] Robospice - Persistence Module tests .............. SKIPPED
[INFO] Robospice - Core Module Parent .................... SKIPPED
[INFO] Robospice - Core .................................. SKIPPED
[INFO] Robospice - Core Module tests ..................... SKIPPED
[INFO] Robospice - Extension Spring Android Module Parent SKIPPED
[INFO] Robospice - Extension Spring Android Module ....... SKIPPED
[INFO] Robospice - Extension Spring Android Module tests . SKIPPED
[INFO] Robospice - Extension Google Http Java Client Module Parent SKIPPED
[INFO] Robospice - Extension Google Htpp Java Client Module SKIPPED
[INFO] Robospice - Extension Google Http Java Client Module tests SKIPPED
[INFO] Robospice - Extension ORMLite Module Parent ....... SKIPPED
[INFO] Robospice - Extension ORMLite Module .............. SKIPPED
[INFO] Robospice - Extension ORMLite Module tests ........ SKIPPED
[INFO] Robospice - Extension UI SpiceList Parent ......... SKIPPED
[INFO] Robospice - Extension UI SpiceList Module ......... SKIPPED
[INFO] Robospice - Extension UI SpiceList Module tests ... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.434s
[INFO] Finished at: Mon Jan 28 18:46:01 PST 2013
[INFO] Final Memory: 12M/21M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.9.1:check (default) on project robospice-cache: You have 16 Checkstyle violations. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :robospice-cache

Rank NOOB wants to use RoboSpice and needs help

Hello,

I am a long time C# developer and trying to get my feet wet with android and java. I have written a workflow web service and published it. Calling the service from .NET architectures is not a problem. I would like to call it from my android app (my first app aside from the typical hello world).

I am developing to android 2.3.3 using Eclipse. Looking at the 30 second image I understand the concept of RoboSpice and the failings of other technologies. But I am swimming in information on where to start. I figured getting the jar's I needed would be a good start then looking at some examples....but I got lost in the downloads as to which jars are needed.

So that would be my first request. How do I determine what jar's I need to communicate with a WCF web service that is returning a string??

My guess to this point is to use the 1.3.1 spring android jar but I know there are others I will need.

OK so now I am reading that I need to run RoboSpice from within an Android Service???

Unable to use RoboSpice (Non maven user) Need help.

Hi, I wish to use robo spice for my android application. I this read https://github.com/octo-online/robospice/wiki/Using-RoboSpice-without-Maven-2 for non maven users. I download sample expository of robospice for test purpose.
as mention in above link I tried first thing
1.android update project -p . and its work fine.
But when I tried next step its gives me error
2.mvn clean install -Pant
I already installed maven. It gives me following error :

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Robospice - Sample Core 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.octo.android.robospice:robospice:jar:1.3.2-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.351s
[INFO] Finished at: Mon Jan 21 15:15:55 IST 2013
[INFO] Final Memory: 10M/124M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project robospice-sample-core: Could not resolve dependencies for project com.octo.android.robospice:robospice-sample-core:apk:1.0.0-SNAPSHOT: Could not find artifact com.octo.android.robospice:robospice:jar:1.3.2-SNAPSHOT -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

What should I do to remove this error. I am using ubuntu 12.04. I want to create those lib files and use it into my application.. But I am not able to use that.... need help..
Thank you....
Nilkash.

Generate Javadoc and export to Github pages

This tasks consists of reviewing the maven system to ensure :

  • javadoc is generated properly for all core and extensions
  • javadoc doesn't include any test class
  • javadoc exports properly on github static pages

Need Some documentation regarding Database Part.

Hi I am new to android and as well new to robospice. I am just started using robospice and I implemented few network calls using robospice and its working. Now what I want to do i want to store it into my local device database. I check ormlite module. But I am not able get data base part properly from it. I don't know it storing my data into my data base permanently or not because it says that it caching pojo object in sqlite db. So need some help regarding those database part and also want to know whether supports data base calls like update delete tables or it jus handle caching in database and we have to implement database handle separately ...

What does removeDataFromCache(final Class<T> clazz)?

I expected that that function removes a specific response classtype from the cache but instead it removes all cached files?

Am I wrong with my presumption?

EDIT: I'm using it with the GsonPersister classes.

RequestListener.onRequestProgressUpdate callback ordering issue

Hi,

I've observed that under certain conditions, I receive a callback with a progress of COMPLETE, READING_FROM_CACHE, and finally PENDING in onRequestProgressUpdate(...).
I don't really know how to reproduce it : it always happens to that one request (nothing special) in my application, but when I step through the debugger to investigate I can't see anything wrong.

Cheers,
Vincent

How to update a cached result without invalidating the old one?

I've a cached result, with no expiration. When the user asks for a refresh, I need to execute a real request, bypassing the cache and, only if the new request is successful, I refresh also the cache. In case of failure I want to show an error dialog and retain the old cached data.

Could not unbind form service, service not registered

When trying to stop my spice manager in the onStop of my activity, I get the following error message:

13:29:09.357 main Could not unbind from service.
java.lang.IllegalArgumentException: Service not registered: null
at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:945)
at android.app.ContextImpl.unbindService(ContextImpl.java:1395)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:375)
at com.octo.android.robospice.SpiceManager.unbindFromService(SpiceManager.java:1006)
at com.octo.android.robospice.SpiceManager.shouldStop(SpiceManager.java:235)
at com.my.package.activity.SplashActivity.onStop(SplashActivity.java:41)
at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1266)
at android.app.Activity.performStop(Activity.java:4694)
at android.app.ActivityThread.handleSleeping(ActivityThread.java:3324)
at android.app.ActivityThread.access$2600(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1392)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)

This error doesn't always occur, but mainly after I install my app and it tries to start for the first time. Any idea on how to solve this?

java.lang.InterruptedException being thrown continuously

Getting the following trace every time a request is returned:

java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:1996)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2031)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
at com.octo.android.robospice.SpiceManager.run(SpiceManager.java:176)
at java.lang.Thread.run(Thread.java:856)

Since its internal I doubt if my code is needed for debugging. If required I'll try and replicate it.

From the code it looks like a harmless exception and probably should be suppressed.

Refactor class name inside tests

In our tests a few classes have non-standard class name (for instance, underscore inside class name).
Our checkstyle configuration has been teaked (in commit c048fc1) for allowing these names but those classes should be fixed to be compliant with the standard naming.

Make SpiceManager mockable

Currently the SpiceManager has mostly private methods making it difficult to mock it in robolectric.

As part for 1.4.1/1.5 can you make it easier to mock (trying with robolectric-2 which makes it much easier to do unit testing)

Is chunked encoding supported?

Hi,
I would like to use the library but I'm not sure I can get callback as I'm downloading from a chunked encoding. Is this supported?
Thanks in advance

can we save different data than returned from loadDataFromNetwork?

Hi

We have an app that does the following:
loadDataFromNetwork

  • Download json data from server.
  • Parse json data into object tree (manually, objectmapper directly to object is too slow).
  • Return parsed data.

We'd really like to just save the json data, rather than the complicated object tree. Is there any way we can do this cleanly?

(Right now we attach a hashmap of the data in the object, use a getRawData function and dump that to disk, but this feels very hackish).

Remove the invisible notification hack

And propose a better way to handle notification and putting service in the foreground.
If the app is n the foreground don't show notification.

It looks like Mark Murphy has a pattern for that based on broadcast receivers.
Idea form Nick Butcher

Multiple execute() requests return results out of order

I'm using 1.3.2 (complied from Maven a few days ago), targeting Android 2.3.3 and I'm seeing requests get the results destined for each other. E.g. if I call:

spiceManager.execute(...)
spiceManager.execute(...)

The second one's request will not be invoked, and its listener will get the first one's network result.

I'm not using caching. ( SpiceManager spiceManager = new SpiceManager(UncachedSpiceService.class); in my activity.) And I'm using the uncached execute: execute(SpiceRequest request, RequestListener requestListener)

getDataFromCache(...) not working

I tried to use getDataFromCache(final Class clazz, final String cacheKey) in onResume of an activity but the app ends in an ANR error.

The SpiceManger was started in onStart. I figured out that the service is never connected in this case (onServiceConnected isn't called) and so waitForServiceToBeBound ends in an infinite loop.

Can you please tell me whats the right time/place to call getDataFromCache?

Make request processor extendable and setable

It would be good to have this as settable/overridable method in the SpiceManager.
That way I could do some better request management, or more specific request processing based on what ExecutorService I am using or what I am asking the SpiceService to do.

Difficulties to parse a simple JSON List using Robospice

Hi,

I am trying to use one of the Google Http example you posted here:
https://github.com/octo-online/RoboSpice-samples/tree/release/robospice-sample-google-http-client/src/com/octo/android/robospice/sample/googlehttpclient

I didn't used Maven, but following your guide, it has been very easy to make it work.

I have change Jackson for GSon (added the lib, change of factory...).

The example compiles and works (with both Jackson and GSon), I got the temperature as expected.

Now I am trying to use my own JSON.

My JSON represents a very simple List of beans.

The Bean is just a class with few Strings. Something very very very simple.

I switched the example url to mine and replace the Weather parameter in the request by List .

I make the same thing where I needed to do it.

There is only ONE stupid thing I don't find how to do.

In the constructor of the request you have that in the example:

  public SampleSpiceRequest( String zipCode ) {
        super( WeatherResult.class );
        this.baseUrl = String.format( "http://www.myweather2.com/developer/forecast.ashx?uac=AQmS68n6Ku&query=%s&output=json", zipCode );
    }

My issue is replacing the super parameter! List.class doesn't work (as expected). List.class of course doesn't work too as a parameter is not part of a class.

In another of my project (not using Robospice, but just Gson only), I do something like that to give the type of Json to parse:

 protected Type getResultType() {
        return new TypeToken<ArrayList<Comments>>() {
        }.getType();
    }

and somewhere else I have:

    protected Object transformResult(HttpURLConnection response) throws ConnectException {
        //JSON parsing process
        String convert = "";
        Object result = null;
        try {
            Gson g = new Gson();
            convert = NetworkClass.readLinesWithoutNewLines(response);
            result = g.fromJson(convert, getResultType());
        } catch (JsonIOException e) {
            throw new ConnectException("Error connection during the JSON conversion - I/O.");
        } catch (JsonSyntaxException e) {
            throw new ConnectException("Error connection during the JSON conversion - Syntax: " + convert);
        } catch (NoSuchFieldError e){
            new ConnectException("NoSuchFieldError - HTC device with 2.3.5 ROM?");
        } finally {
            response.disconnect();
        }
        return result;
    }

    protected abstract Type getResultType();
}

But here, I really don't know how to do.

I have also tried to build a class with only one variable like List inside, but GSON throw an exception like it is expecting a Collection or an Array and I give it something else.

So my question:

How do I parse a parametrized List with RoboSpice?

Thank you a lot for your help

Regards

Polling for new requests in the queue leads to an high cpu usage

I noticed that leaving the service started the cpu usage goes to 100%.

Taking a look at the SpiceManager (https://github.com/octo-online/robospice/blob/master/robospice/src/com/octo/android/robospice/SpiceManager.java#L168-183) class i saw that you poll the request queue to check if it is empty or not. I think that this cause the high cpu usage i'm experiencing.

I would say that you could just use the .take() method and wait that a new request is available. This would put the thread in wait instead of actual run state.

What do you think about?
I understand that in this way the service will stay blocked but you could unblock it putting in the queue an "invalid" request when the stop() method is called. Or maybe just use the .poll() method.

Setup for non maven users missing jar

Not sure if this is just something missing from the documentation or if I have set something up incorrectly but either way I would like to know. I was following the setup for NON maven users for google http client and the first sample project would not compile until i added the google-http-client-1.13.1-beta jar from https://code.google.com/p/google-http-java-client/wiki/Setup#Download_Library_with_Dependencies. The doc made out I could grab all the required jars from the repositries branch. Should the wording be changed or have I gone wrong somewhere?

Thanks!

Make snapshot versions available in Maven?

Is it possible to access 1.3.2-SNAPSHOT in a project of mine? All of the examples reference 1.3.2 and use new features of it, but it isn't actually available in Maven from what I can tell.

Documentation of project setup

Project setup has to be explained correctly in the wiki pages :

  • setting up RoboSpice with Maven
  • setting up RoboSpice without Maven (in eclipse / ADT )
  • screenshots must be provided

Cannot override Ln behavior

The copied over Ln class from RoboGuice is missing the @Inject annotation which disallows overriding it during static injection pass.

Spring and Google HTTP lib

Hi,

For some unknown reason, on a project I compiled the Google HTTP example which worked, I modified it to use my own JSON which is a simple array of beans (few strings per objects).

For an unknown reason the result was an array of tons of null objects (tried Jackson 1, 2, and GSon).

I switch to Spring example, compiled it, switch to my JSON, made the needed modification and it worked in less than 30 minutes.

However, I need Google HTTP for other things, so I want to switch back to Google HTTP.

Each source code examples are implemented in a very different manner (more code in Google HTTP). I have not so much experience in Robospice, but I noticed that to switch from Jackson to Gson, I just needed to change of Robospice factory and very few other things, and it worked automagically.

May be I am doing something wrong, but it seems to me that this method doesn't work to switch from Spring to Google HTTP. Am I right? Does the use of one of these library implies a kind of implementation not compliant with the other, or am I stupid enough to not have found all the equivalent Robospice factories of Spring in Google HTTP Robospice implementation?

In other word, does the support of these library is symmetric in Robospice?

Regards

Do you plan to support self signed Ssl certificates?

I have my own certificate on my server and I want to use this one. For now I do it using lots of code. And I m using the ugly asynctask. Do you think you can add a kind of sslfactory setter? Or even better you ask me my keys tore ressource and the pwd and the lib managed everything, would be super cool.

Tape library support

Hi,

I am just beginning to play with Robospice, and I am wondering, have you heard about Tape library?

http://square.github.com/tape/

The idea is, if for some reason your request fails (application crash, closed by the user or lose the network for a long time), Tape helps you to save the request on the disk and reexecute it in the future.

I am heavily using other Square library, and they are very good quality, simple API...

I was thinking, it would be awesome to support - in a very easy way for the final dev - this library in Robospice, as ANYONE using Robospice for connection would benefit from the improvement.

I am aware you have already a kind of cache management to make data persistent (whis is an awesome function), but I don't think the request itself is concerned. There is a video from Square dev presenting use case for their library including Tape in connection issue context.

As I said, I am very newbee in using Robospice, I am now implementing the library in a small project, and after I will replace some of my code with it in a lot bigger one.

When I ll finish this process, I would be happy to help in this integration (if not already done by someone else :-)

Regards

Status of requests

Is it possible to check with the class an request cache key the status of a executed request?

Fatal Exception after cancel(request) [Bug]

Kills the app when trying to or after cancelling the request. sometimes. Or if passing a null listener through to the execute command.

Stack:

ERROR/AndroidRuntime(13335): FATAL EXCEPTION: main
        java.lang.NullPointerException
        at com.octo.android.robospice.request.RequestProcessor$ResultRunnable.run(RequestProcessor.java:496)
        at android.os.Handler.handleCallback(Handler.java:725)
        at android.os.Handler.dispatchMessage(Handler.java:92)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:5039)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
        at dalvik.system.NativeStart.main(Native Method)

2 SpiceRequests Results merged

I have implemented robospice 1.3.1 with spring and jackson into my project.

Story about the problem:

I have a viewpager with X-amount of fragments. When a fragment is created it will get the spicemanager from the "parent" activity and execute a SpiceRequest without caching. All of the SpiceRequests are from the same Class and therefore have the same resulttype but have a different endpoint url. When the first 2 fragments are created after the adapter has been created in the activity i can see the following happen:

  1. The 1st request is loading data from the network
  2. The 2nd request is pending
  3. 1st request is complete and the 2nd wants to start loading data from network
  4. 2nd request retrieves the result from the cache from the 1st request
    because the executor believes they are the same request.

I have have found a work around for me: using different cachekeys for each fragment
and clearing the cache when the application is closed.

Is this behavior as it should be?

NPE in RequestProcessor$ResultRunnable.run()

Hi,

I'm trying to implement a list with dynamically loaded images. After intensive scrolling back and forth (which involves cancelling old requests and creating new ones) RoboSpice has crashed my app, stack trace is below.

I'm using RoboSpice 1.4.0.

03-04 11:17:26.803: ERROR/AndroidRuntime(2533): FATAL EXCEPTION: main
        java.lang.NullPointerException
        at com.octo.android.robospice.request.RequestProcessor$ResultRunnable.run(RequestProcessor.java:496)
        at android.os.Handler.handleCallback(Handler.java:615)
        at android.os.Handler.dispatchMessage(Handler.java:92)
        at android.os.Looper.loop(Looper.java:137)
        at android.app.ActivityThread.main(ActivityThread.java:4921)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
        at dalvik.system.NativeStart.main(Native Method)

ConcurrentModificationException under load

Getting ConcurrentModificationException in 1.4.1-SNAPSHOT in a "list with images" implementation during extensive scrolling with a large list (requests being added and cancelled all the time).

03-04 12:08:26.853: ERROR/AndroidRuntime(4271): FATAL EXCEPTION: Thread-41029
        java.util.ConcurrentModificationException
        at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:350)
        at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:370)
        at com.octo.android.robospice.request.RequestProcessor.addRequest(RequestProcessor.java:111)
        at com.octo.android.robospice.SpiceService.addRequest(SpiceService.java:205)
        at com.octo.android.robospice.SpringAndroidSpiceService.addRequest(SpringAndroidSpiceService.java:38)
        at com.octo.android.robospice.SpiceManager.sendRequestToService(SpiceManager.java:207)
        at com.octo.android.robospice.SpiceManager.run(SpiceManager.java:188)
        at java.lang.Thread.run(Thread.java:856)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.