Android SpringAndroidSpiceService - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android SpringAndroidSpiceService class.

This code example shows how to use the following methods:
import com.octo.android.robospice.SpringAndroidSpiceService; 
import com.octo.android.robospice.persistence.CacheManager; 
import com.octo.android.robospice.persistence.exception.CacheCreationException; 
import com.octo.android.robospice.persistence.springandroid.json.jackson.JacksonObjectPersisterFactory; 
 
public class SpringAndroidTestService extends SpringAndroidSpiceService { 
 
    @Override 
    public CacheManager createCacheManager(Application application) throws CacheCreationException { 
        CacheManager cacheManager = new CacheManager(); 
        cacheManager.addPersister(new JacksonObjectPersisterFactory(application, new File("/"))); 
        return cacheManager; 
    } 
 
    @Override 
    public RestTemplate createRestTemplate() { 
        return new RestTemplate(); 
    } 
 
} 
6
CodeRank
This code example shows how to use the following methods:
import com.octo.android.robospice.motivations.model.tweeter.xml.Feed; 
import com.octo.android.robospice.persistence.CacheManager; 
import com.octo.android.robospice.persistence.ormlite.InDatabaseObjectPersisterFactory; 
import com.octo.android.robospice.persistence.ormlite.RoboSpiceDatabaseHelper; 
 
public class TweeterXmlSpiceService extends SpringAndroidSpiceService { 
 
    private static final String DATABASE_NAME = "tweeter.db"; 
    private static final int DATABASE_VERSION = 1; 
    private static final int WEBSERVICES_TIMEOUT = 10000; 
 
    @Override 
    public int getThreadCount() { 
        return 3; 
    } 
 
    @Override 
    public boolean isFailOnCacheError() { 
        return true; 
    } 
5
CodeRank
This code example shows how to use the following methods:
 * Simple service 
 *  
 * @author sni 
 *  
 */ 
public class SampleSpiceService extends SpringAndroidSpiceService { 
 
    private static final int WEBSERVICES_TIMEOUT = 10000; 
 
    @Override 
    public CacheManager createCacheManager( Application application ) { 
        CacheManager cacheManager = new CacheManager(); 
        List< Class< ? >> classCollection = new ArrayList< Class< ? >>(); 
 
        // add persisted classes to class collection 
        classCollection.add( Weather.class ); 
        classCollection.add( CurrenWeather.class ); 
        classCollection.add( Day.class ); 
        classCollection.add( Forecast.class ); 
        classCollection.add( Night.class ); 
5
CodeRank
This code example shows how to use the following methods:
 * Simple service 
 *  
 * @author sni 
 *  
 */ 
public class SampleSpiceService extends SpringAndroidSpiceService { 
 
    private static final int WEBSERVICES_TIMEOUT = 10000; 
 
    @Override 
    public CacheManager createCacheManager( Application application ) { 
        CacheManager cacheManager = new CacheManager(); 
        List< Class< ? >> classCollection = new ArrayList< Class< ? >>(); 
 
        // add persisted classes to class collection 
        classCollection.add( Weather.class ); 
        classCollection.add( CurrenWeather.class ); 
        classCollection.add( Day.class ); 
        classCollection.add( Forecast.class ); 
        classCollection.add( Night.class ); 
5
CodeRank
This code example shows how to use the following methods:onCreate, getApplicationContext
    @Inject 
    private DbManager mDbManager; 
 
    @Override 
    public void onCreate() { 
        super.onCreate(); 
        RoboGuice.getInjector(getApplicationContext()).injectMembersWithoutViews(this); 
    } 
 
    public DbManager getDbManager() { 
        return mDbManager; 
    } 
 
    @Override 
    public CacheManager createCacheManager(Application application) throws CacheCreationException { 
        CacheManager cacheManager = new CacheManager(); 
 
        InFileStringObjectPersister inFileStringObjectPersister = new InFileStringObjectPersister(application); 
        InFileInputStreamObjectPersister inFileInputStreamObjectPersister = new InFileInputStreamObjectPersister( 
                application); 
5
CodeRank
This code example shows how to use the following methods:
 * Define a {@link RestTemplate} with json capabilities and cache manager with json and binary support (even if the sdk does not cache informations) 
 *  
 * @author Jerome Van Der Linden 
 *  
 */ 
public class AppaloosaSpiceService extends SpringAndroidSpiceService { 
 
	private static final String TAG_APPALOOSA = "APPALOOSA"; 
	 
	/** Timeout when calling a web service (in ms). */ 
	private static final int WEBSERVICES_TIMEOUT = 30000; 
 
	@Override 
	public RestTemplate createRestTemplate() { 
		RestTemplate restTemplate = new RestTemplate(); 
 
		MappingJacksonHttpMessageConverter jsonConverter = new MappingJacksonHttpMessageConverter(); 
		FormHttpMessageConverter formHttpMessageConverter = new FormHttpMessageConverter(); 
		StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter(); 
 
4
CodeRank
See Code Examples for Android SpringAndroidSpiceService Methods: