Android Open Source - demo-flickr-feed-android App






From Project

Back to project page demo-flickr-feed-android.

License

The source code is released under:

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...

If you think the Android project demo-flickr-feed-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * This is free and unencumbered software released into the public domain.
 */*  w ww  .  j  a v  a  2  s  . c o  m*/
 * Anyone is free to copy, modify, publish, use, compile, sell, or
 * distribute this software, either in source code form or as a compiled
 * binary, for any purpose, commercial or non-commercial, and by any
 * means.
 *
 * In jurisdictions that recognize copyright laws, the author or authors
 * of this software dedicate any and all copyright interest in the
 * software to the public domain. We make this dedication for the benefit
 * of the public at large and to the detriment of our heirs and
 * successors. We intend this dedication to be an overt act of
 * relinquishment in perpetuity of all present and future rights to this
 * software under copyright law.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * For more information, please refer to <http://unlicense.org/>
 */

package uk.org.tomek.flickrfeed;

import com.orm.SugarApp;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import uk.org.tomek.flickrfeed.rest.MockRestClient;
import uk.org.tomek.flickrfeed.rest.RealRestClient;
import uk.org.tomek.flickrfeed.rest.RestClient;


/**
 * Main Application class.
 * <p/>
 * Created by tomek on 12/10/14.
 */
public class App extends SugarApp {

    private static final boolean IS_MOCK_ENABLED = false;
    private static RestClient mRestClient;
    private static ExecutorService mSingleThreadPool;

    @Override
    public void onCreate() {
        super.onCreate();
        if (IS_MOCK_ENABLED) {
            mRestClient = new MockRestClient(getApplicationContext());
        } else {
            mRestClient = new RealRestClient();
        }
    }

    /**
     * Returns REST client for this application.
     */
    public static RestClient getRestClient() {
        return mRestClient;
    }

    /**
     * Returns lazy initialized thread pool with 1 thread.
     */
    public static Executor getSingleThreadPool() {
        if (mSingleThreadPool == null) {
            mSingleThreadPool = Executors.newSingleThreadExecutor();
        }
        return mSingleThreadPool;
    }
}




Java Source Code List

tomek.co.uk.flickrfeed.ApplicationTest.java
uk.org.tomek.flickrfeed.App.java
uk.org.tomek.flickrfeed.activity.ImageDetailsActivity.java
uk.org.tomek.flickrfeed.activity.MainActivity.java
uk.org.tomek.flickrfeed.activity.SettingsActivity.java
uk.org.tomek.flickrfeed.adapter.FeedAdapter.java
uk.org.tomek.flickrfeed.fagment.SettingsFragment.java
uk.org.tomek.flickrfeed.fagment.StartingFragment.java
uk.org.tomek.flickrfeed.model.Feed.java
uk.org.tomek.flickrfeed.model.Item.java
uk.org.tomek.flickrfeed.model.Media.java
uk.org.tomek.flickrfeed.rest.FlickrConverter.java
uk.org.tomek.flickrfeed.rest.MockRestClient.java
uk.org.tomek.flickrfeed.rest.RealRestClient.java
uk.org.tomek.flickrfeed.rest.RestClient.java
uk.org.tomek.flickrfeed.rest.RestUtils.java
uk.org.tomek.flickrfeed.rest.service.FlickrPostsService.java
uk.org.tomek.flickrfeed.utils.Logger.java
uk.org.tomek.flickrfeed.utils.StringUtils.java