robospice

Robospice storing object that extends ArrayList in database via Ormlite

别说谁变了你拦得住时间么 提交于 2019-12-12 09:40:04
问题 Background I have been trying to modify the Robospice Ormlite example code, which I have been successful to run. The only changes I have made is that I have a JSON response that contains an array of objects. I created 2 classes: public class Foos extends ArrayList<Foo> public class Foo I had initial problems, as my JSON response is a pure array with no outer container. I read via google groups that the way to solve this is to create a "fake" class (Foos) that extends an ArrayList. This

Gradle DSL method not found: 'compile()' when excluding support-v4 and/or commons-io

北城以北 提交于 2019-12-12 00:26:53
问题 I am having trouble with my project. I was getting this error and after applying the sugested solution I am getting this error, however the solution does not apply to me. Here is my build.gradle file: apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" packagingOptions { exclude 'META-INF/license.txt' exclude 'META-INF/notice.txt' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' } defaultConfig { applicationId "codechallenge.com

Android - How to get JSON format request and response in Robospice/retrofit

前提是你 提交于 2019-12-10 10:58:29
问题 I am new to the Robospice/retrofit libraries. I got some samples from the github. https://github.com/octo-online/RoboSpice-samples/tree/release/robospice-sample-retrofit. My Understanding: The request is "githubRequest" and the response is the "Contributor.List". The webservice is called by getSpiceManager().execute. Code Snippet: @Override protected void onStart() { super.onStart(); getSpiceManager().execute(githubRequest, "github", DurationInMillis.ONE_MINUTE, new

How can I get request string URL that sent to robospice retrofit?

蹲街弑〆低调 提交于 2019-12-08 11:13:16
问题 I searched but did not find a helpful information. Trying to deal with the REST API Client, I am use robospice in conjunction with retofit, I want to look at the request string that is sent to the service. Is it possible to pull an entire string URL from Robospice or Retrofit? Here is my interface: public interface GoogleSearchInterface { public static final String BASE_URL = "https://www.googleapis.com/customsearch"; public static final String API_KEY = "AIzaSyCCuxxVLzm2sZP

Jackson - reading a JSON array with Robospice using loadDataFromNetwork() method

岁酱吖の 提交于 2019-12-07 15:03:44
问题 I'm trying to read JSON array, which has the following format: [{"vehicle_id":"76","color":"red"},{"vehicle_id":"7","color":"blue"}] , following Robospice's Starter Guide. Vehicle.java public class Vehicle { @JsonProperty("vehicle_id") private int vehicleID; @JsonProperty("color") private String color; } (setters and getters follow) Class which is giving errors: VehiclesRequest.class public class VehiclesRequest extends SpringAndroidSpiceRequest<Vehicle> { private static final String METHOD =

Robospice upload file with SpringAndroidSpiceRequest

ⅰ亾dé卋堺 提交于 2019-12-06 11:54:13
问题 I am working with robospice. Now I want to upload file. I used SpringAndroidSpiceService and write my own request like this : public class UploadFileRequest extends SpringAndroidSpiceRequest<String>{ private static final String TAG = "UploadFileRequest"; private UploadRequestModel requestModel; private String link; public UploadFileRequest(UploadRequestModel model, String link) { super(String.class); requestModel = model; this.link = link; } @Override public String loadDataFromNetwork()

Android - How to get JSON format request and response in Robospice/retrofit

↘锁芯ラ 提交于 2019-12-06 08:17:59
I am new to the Robospice/retrofit libraries. I got some samples from the github. https://github.com/octo-online/RoboSpice-samples/tree/release/robospice-sample-retrofit . My Understanding: The request is "githubRequest" and the response is the "Contributor.List". The webservice is called by getSpiceManager().execute. Code Snippet: @Override protected void onStart() { super.onStart(); getSpiceManager().execute(githubRequest, "github", DurationInMillis.ONE_MINUTE, new ListContributorRequestListener()); } public final class ListContributorRequestListener implements RequestListener<Contributor

Robospice storing object that extends ArrayList in database via Ormlite

∥☆過路亽.° 提交于 2019-12-05 14:53:34
Background I have been trying to modify the Robospice Ormlite example code , which I have been successful to run. The only changes I have made is that I have a JSON response that contains an array of objects. I created 2 classes: public class Foos extends ArrayList<Foo> public class Foo I had initial problems, as my JSON response is a pure array with no outer container. I read via google groups that the way to solve this is to create a "fake" class (Foos) that extends an ArrayList. This produced the following code: public class FooRequest extends SpringAndroidSpiceRequest< Foos > { private

RoboSpice with Gson and Realm

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 08:18:53
I'm using RoboSpice with GsonSpringAndroidSpiceService. I also want to add Realm to save the data. the problem is that in realm each object has to extend realmObject, but the gson in the roboSpice trying to parse the realmObject instead of ignore it. I've tried to add exclusion stategy: Gson gson = new GsonBuilder() .setExclusionStrategies(new ExclusionStrategy() { @Override public boolean shouldSkipField(FieldAttributes f) { return f.getDeclaringClass().equals(RealmObject.class); } @Override public boolean shouldSkipClass(Class<?> clazz) { return false; } }) .create(); then

How does robospice manage activity lifecycle?

可紊 提交于 2019-12-05 03:06:49
I'm looking for a technical answer to how the android robospice library manages activity lifecycle. From the getting started page: https://github.com/octo-online/robospice/wiki/Starter-Guide "As an inner class of your Activity (or other context), add a RequestlListener that will update your UI. Don't worry about memory leaks, RoboSpice manages your activity's life cycle." My question is how does robospice automatically update the request listeners so that it still is able to call the correct listener with the correct context after a rotation and after the activity has been destroyed and