@@ -0,0 +1,1560 @@
+package com.example.profbola.bakingtime.services;%0A%0Aimport android.app.IntentService;%0Aimport android.content.Context;%0Aimport android.content.Intent;%0Aimport android.support.annotation.Nullable;%0A%0Aimport com.example.profbola.bakingtime.models.Recipe;%0Aimport com.example.profbola.bakingtime.utils.RecipeNetworkUtil;%0Aimport com.example.profbola.bakingtime.utils.RecipeParser;%0A%0Aimport org.json.JSONArray;%0A%0Aimport java.util.List;%0A%0A/**%0A * Created by prof.BOLA on 7/5/2017.%0A */%0A%0Apublic class RecipeService extends IntentService %7B%0A%0A%0A    private static final String NAME = RecipeService.class.getName();%0A%0A    public static final String ACTION_SYC_RECIPES%0A            = %22com.example.profbola.bakingtime.services.action.sync_recipes%22;%0A    /**%0A     * Creates an IntentService.  Invoked by the superclass's constructor.%0A     */%0A    public RecipeService() %7B%0A        super(NAME);%0A    %7D%0A%0A    @Override%0A    protected void onHandleIntent(@Nullable Intent intent) %7B%0A        if (intent != null) %7B%0A            final String action = intent.getAction();%0A            if (ACTION_SYC_RECIPES.equals(action)) %7B%0A                handleActionSynRecipes();%0A            %7D%0A        %7D%0A    %7D%0A%0A    private void handleActionSynRecipes() %7B%0A        JSONArray jsonArray = RecipeNetworkUtil.getRecipeFromApi();%0A        List%3CRecipe%3E mRecipes = RecipeParser.parse(jsonArray);%0A%0A    %7D%0A%0A    public static void startActionSyncRecipes(Context context) %7B%0A        Intent intent = new Intent(context, RecipeService.class);%0A        intent.setAction(ACTION_SYC_RECIPES);%0A        context.startService(intent);%0A    %7D%0A%7D%0A

Add RecipeService