Android CacheManager - 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 CacheManager class.

This code example shows how to use the following methods:addPersister
 * @author sni 
 */ 
public class JacksonGoogleHttpClientSpiceService extends GoogleHttpClientSpiceService {
    @Override 
    public CacheManager createCacheManager(Application application) throws CacheCreationException {
        CacheManager cacheManager = new CacheManager();
        cacheManager.addPersister(new JacksonObjectPersisterFactory(application));
        return cacheManager;
    } 
 
} 
9
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:addPersister
 
    private static final int DEFAULT_NUM_THREADS = 3;
 
    @Override 
    public CacheManager createCacheManager(Application application) throws CacheCreationException {
        CacheManager cacheManager = new CacheManager();
        InFileBitmapObjectPersister inFileBitmapObjectPersister = new InFileBitmapObjectPersister(application);
        cacheManager.addPersister(inFileBitmapObjectPersister);
 
        return cacheManager;
    } 
 
    @Override 
    public int getThreadCount() { 
        return DEFAULT_NUM_THREADS;
    } 
 
} 
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:addPersister
This code example shows how to use the following methods:addPersister
 * @author sni 
 */ 
public class Jackson2GoogleHttpClientSpiceService extends GoogleHttpClientSpiceService {
    @Override 
    public CacheManager createCacheManager(Application application) throws CacheCreationException {
        CacheManager cacheManager = new CacheManager();
        cacheManager.addPersister(new Jackson2ObjectPersisterFactory(application));
        return cacheManager;
    } 
 
} 
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:addPersister
 
    private static final int DEFAULT_NUM_THREADS = 3;
 
    @Override 
    public CacheManager createCacheManager(Application application) throws CacheCreationException {
        CacheManager cacheManager = new CacheManager();
        InFileBitmapObjectPersister inFileBitmapObjectPersister = new InFileBitmapObjectPersister(application);
        cacheManager.addPersister(inFileBitmapObjectPersister);
 
        return cacheManager;
    } 
 
    @Override 
    public int getThreadCount() { 
        return DEFAULT_NUM_THREADS;
    } 
 
} 
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:addPersister
 */ 
public class GsonGoogleHttpClientSpiceService extends GoogleHttpClientSpiceService {
 
    @Override 
    public CacheManager createCacheManager(Application application) throws CacheCreationException {
        CacheManager cacheManager = new CacheManager();
        cacheManager.addPersister(new GsonObjectPersisterFactory(application));
        return cacheManager;
    } 
 
} 
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:addPersister
 
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(); 
    } 
 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:addPersister
 * @author sni 
 */ 
public class XmlSpringAndroidSpiceService extends SpringAndroidSpiceService { 
    @Override 
    public CacheManager createCacheManager(Application application) throws CacheCreationException { 
        CacheManager cacheManager = new CacheManager(); 
        cacheManager.addPersister(new SimpleSerializerObjectPersisterFactory(application)); 
        return cacheManager; 
    } 
 
    @Override 
    public RestTemplate createRestTemplate() { 
        RestTemplate restTemplate = new RestTemplate(); 
 
        // web services support xml responses 
        SimpleXmlHttpMessageConverter jsonConverter = new SimpleXmlHttpMessageConverter(); 
        final List<HttpMessageConverter<?>> listHttpMessageConverters = restTemplate.getMessageConverters(); 
 
        listHttpMessageConverters.add(jsonConverter); 
        restTemplate.setMessageConverters(listHttpMessageConverters); 
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:addPersister
        return true; 
    } 
 
    @Override 
    public CacheManager createCacheManager( Application application ) { 
        CacheManager cacheManager = new CacheManager(); 
        List< Class< ? >> classCollection = new ArrayList< Class< ? >>(); 
 
        // add persisted classes to class collection 
        classCollection.add( Entry.class ); 
        classCollection.add( Feed.class ); 
 
        // init 
        RoboSpiceDatabaseHelper databaseHelper = new RoboSpiceDatabaseHelper( application, DATABASE_NAME, DATABASE_VERSION ); 
        InDatabaseObjectPersisterFactory inDatabaseObjectPersisterFactory = new InDatabaseObjectPersisterFactory( application, databaseHelper, classCollection ); 
        cacheManager.addPersister( inDatabaseObjectPersisterFactory ); 
        return cacheManager; 
    } 
 
    @Override 
    public RestTemplate createRestTemplate() { 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:addPersister
 * @author sni 
 */ 
public class JacksonSpringAndroidSpiceService extends SpringAndroidSpiceService { 
    @Override 
    public CacheManager createCacheManager(Application application) throws CacheCreationException { 
        CacheManager cacheManager = new CacheManager(); 
        cacheManager.addPersister(new JacksonObjectPersisterFactory(application)); 
        return cacheManager; 
    } 
 
    @Override 
    public RestTemplate createRestTemplate() { 
        RestTemplate restTemplate = new RestTemplate(); 
 
        // web services support json responses 
        MappingJacksonHttpMessageConverter jsonConverter = new MappingJacksonHttpMessageConverter(); 
        final List<HttpMessageConverter<?>> listHttpMessageConverters = restTemplate.getMessageConverters(); 
 
        listHttpMessageConverters.add(jsonConverter); 
        restTemplate.setMessageConverters(listHttpMessageConverters); 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Android CacheManager Methods: