Android Open Source - spots Fetch Spots






From Project

Back to project page spots.

License

The source code is released under:

MIT License

If you think the Android project spots 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 com.dcc.matc89.spots.network;
//from   ww  w.  j  a  v a2  s  .c o  m
import java.util.List;

import android.annotation.TargetApi;
import android.os.AsyncTask;
import android.os.Build;

import com.dcc.matc89.spots.model.Spot;

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public class FetchSpots {
  
  public FetchSpots() {
  }

  public void getSpots(OnSpotsReceiver receiver) {
    fetchSpots(receiver, null);
  }

  public void getSpots(OnSpotsReceiver receiver, long fromGroup) {
    String params[] = {"fromGroup", String.valueOf(fromGroup)};
    fetchSpots(receiver, params);
  }

  public void getSpots(OnSpotsReceiver receiver, double latitude, double longitude, int limit, int offset) {
    String params[] = {"latitude", String.valueOf(latitude),
        "longitude", String.valueOf(longitude),
        "limit", String.valueOf(limit),
        "offset", String.valueOf(offset)};
    fetchSpots(receiver, params);
  }

  private void fetchSpots(OnSpotsReceiver receiver, String[] params) {
    if(receiver == null)
      return;
    FetchSpotsAsyncTask task = new FetchSpotsAsyncTask(receiver);
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
      task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params);
    else
      task.execute(params);
  }
  
  public interface OnSpotsReceiver{
    void onSpotsReceived(List<Spot> spots);
  }
}




Java Source Code List

com.dcc.matc89.spots.activity.GroupDetailActivity.java
com.dcc.matc89.spots.activity.GroupEditActivity.java
com.dcc.matc89.spots.activity.GroupListActivity.java
com.dcc.matc89.spots.activity.LoginActionBarActivity.java
com.dcc.matc89.spots.activity.LoginActivity.java
com.dcc.matc89.spots.activity.MainActivity.java
com.dcc.matc89.spots.activity.MyGroupsListActivity.java
com.dcc.matc89.spots.activity.SpotDetailActivity.java
com.dcc.matc89.spots.activity.SpotEditActivity.java
com.dcc.matc89.spots.activity.SpotListActivity.java
com.dcc.matc89.spots.activity.UserDetailActivity.java
com.dcc.matc89.spots.activity.UserListActivity.java
com.dcc.matc89.spots.model.Group.java
com.dcc.matc89.spots.model.Sport.java
com.dcc.matc89.spots.model.Spot.java
com.dcc.matc89.spots.model.StaticDatabase.java
com.dcc.matc89.spots.model.User.java
com.dcc.matc89.spots.network.FetchGroupsAsyncTask.java
com.dcc.matc89.spots.network.FetchGroups.java
com.dcc.matc89.spots.network.FetchSportsAsyncTask.java
com.dcc.matc89.spots.network.FetchSports.java
com.dcc.matc89.spots.network.FetchSpotsAsyncTask.java
com.dcc.matc89.spots.network.FetchSpots.java
com.dcc.matc89.spots.network.FetchUsersAsyncTask.java
com.dcc.matc89.spots.network.FetchUsers.java
com.dcc.matc89.spots.network.OnResultReceiver.java
com.dcc.matc89.spots.network.PostGroupsAsyncTask.java
com.dcc.matc89.spots.network.PostGroups.java
com.dcc.matc89.spots.network.PostLinkSpotGroupAsyncTask.java
com.dcc.matc89.spots.network.PostLinkSpotGroup.java
com.dcc.matc89.spots.network.PostSpotsAsyncTask.java
com.dcc.matc89.spots.network.PostSpots.java
com.dcc.matc89.spots.network.PostUsersAsyncTask.java
com.dcc.matc89.spots.network.PostUsers.java
com.dcc.matc89.spots.network.Utils.java
com.dcc.matc89.spots.social.FacebookFragment.java
com.dcc.matc89.spots.social.LoginFragment.java
com.dcc.matc89.spots.social.OnUserLoginListener.java
com.dcc.matc89.spots.view.CheckboxesDropdownView.java
com.dcc.matc89.spots.view.DropdownView.java