Android Open Source - Broadsheet.ie-Android Broadsheet Application






From Project

Back to project page Broadsheet.ie-Android.

License

The source code is released under:

Copyright (c) 2013 Karl Monaghan (http://karlmonaghan.com/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Soft...

If you think the Android project Broadsheet.ie-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

package ie.broadsheet.app;
//from w w w . ja  va2s  .c om
import ie.broadsheet.app.model.json.Post;

import java.util.ArrayList;
import java.util.List;

import android.app.Application;
import android.content.Context;

import com.crashlytics.android.Crashlytics;
import com.google.analytics.tracking.android.GoogleAnalytics;
import com.google.analytics.tracking.android.Tracker;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;

public class BroadsheetApplication extends Application {
    private static BroadsheetApplication mApp = null;

    private List<Post> posts;

    public List<Post> getPosts() {
        return posts;
    }

    private Tracker mGaTracker;

    private GoogleAnalytics mGaInstance;

    public void setPosts(List<Post> posts) {
        if ((this.posts == null) || (posts == null)) {
            this.posts = posts;
        } else if (this.posts.size() > 0) {
            // this.posts.addAll(posts);
            for (Post post : posts) {
                this.posts.add(post);
            }
        } else {
            this.posts = posts;
        }
    }

    @Override
    public void onCreate() {
        super.onCreate();

        // Create global configuration and initialize ImageLoader with this configuration
        ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext()).build();
        ImageLoader.getInstance().init(config);

        this.posts = new ArrayList<Post>();

        Crashlytics.start(this);

        mGaInstance = GoogleAnalytics.getInstance(this);

        mGaTracker = mGaInstance.getTracker("UA-5653857-3");

        mApp = this;
    }

    public Tracker getTracker() {
        return mGaTracker;
    }

    public static Context context() {
        return mApp.getApplicationContext();
    }

}




Java Source Code List

ie.broadsheet.app.BaseFragmentActivity.java
ie.broadsheet.app.BroadsheetApplication.java
ie.broadsheet.app.CommentListActivity.java
ie.broadsheet.app.PostDetailActivity.java
ie.broadsheet.app.PostListActivity.java
ie.broadsheet.app.adapters.CommentAdapter.java
ie.broadsheet.app.adapters.PostListAdapter.java
ie.broadsheet.app.adapters.PostListEndlessAdapter.java
ie.broadsheet.app.client.http.MultipartFormDataContent.java
ie.broadsheet.app.dialog.AboutDialog.java
ie.broadsheet.app.dialog.MakeCommentDialog.java
ie.broadsheet.app.dialog.TipDialog.java
ie.broadsheet.app.dialog.WebViewDialog.java
ie.broadsheet.app.fragments.PostDetailFragment.java
ie.broadsheet.app.fragments.PostListFragment.java
ie.broadsheet.app.model.json.AttachmentItem.java
ie.broadsheet.app.model.json.Attachments.java
ie.broadsheet.app.model.json.Author.java
ie.broadsheet.app.model.json.Category.java
ie.broadsheet.app.model.json.Comment.java
ie.broadsheet.app.model.json.Image.java
ie.broadsheet.app.model.json.PostList.java
ie.broadsheet.app.model.json.Post.java
ie.broadsheet.app.model.json.ResponseData.java
ie.broadsheet.app.model.json.SinglePost.java
ie.broadsheet.app.model.json.SubmitTipResponse.java
ie.broadsheet.app.model.json.Tag.java
ie.broadsheet.app.requests.DownloadFileRequest.java
ie.broadsheet.app.requests.MakeCommentRequest.java
ie.broadsheet.app.requests.PostListRequest.java
ie.broadsheet.app.requests.PostRequest.java
ie.broadsheet.app.requests.SubmitTipRequest.java
ie.broadsheet.app.services.BroadsheetServices.java