@@ -0,0 +1,3627 @@
+package jeddsan.net.huetest;%0A%0Aimport android.content.Context;%0A%0Aimport java.io.BufferedInputStream;%0Aimport java.io.BufferedReader;%0Aimport java.io.FileInputStream;%0Aimport java.io.FileNotFoundException;%0Aimport java.io.FileOutputStream;%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.io.InputStreamReader;%0Aimport java.io.OutputStreamWriter;%0Aimport java.net.HttpURLConnection;%0Aimport java.net.ProtocolException;%0Aimport java.net.URL;%0A%0A/**%0A * Created by Julian on 18.08.2016.%0A */%0Apublic class Requests %7B%0A%0A%0A    public static String requestURL(URL url, String method, String body)%7B%0A        String result = %22%22;%0A        HttpURLConnection httpCon = null;%0A        try %7B%0A            httpCon = (HttpURLConnection) url.openConnection();%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A        assert httpCon != null;%0A        httpCon.setDoOutput(true);%0A        try %7B%0A            httpCon.setRequestMethod(method);%0A        %7D catch (ProtocolException e) %7B%0A            e.printStackTrace();%0A        %7D%0A        OutputStreamWriter out = null;%0A        try %7B%0A            out = new OutputStreamWriter(%0A                    httpCon.getOutputStream());%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A        try %7B%0A            assert out != null;%0A            out.write(body);%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A        try %7B%0A            out.close();%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A        try %7B%0A            httpCon.getInputStream();%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A%0A        InputStream is = null;%0A        result=%22%22;%0A        try %7B%0A            is = new BufferedInputStream(httpCon.getInputStream());%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A        BufferedReader br = new BufferedReader(new InputStreamReader(is));%0A        String inputLine = %22%22;%0A        try %7B%0A            while ((inputLine = br.readLine()) != null) %7B%0A                result+=inputLine;%0A            %7D%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A        return result;%0A    %7D%0A    public static boolean saveData(String filename, String content, Context ctx)%7B%0A        try %7B%0A            FileOutputStream fou = ctx.openFileOutput(filename, Context.MODE_PRIVATE);%0A            OutputStreamWriter osw = new OutputStreamWriter(fou);%0A            try %7B%0A                osw.write(content);%0A                osw.flush();%0A                osw.close();%0A            %7D catch (IOException e) %7B%0A                e.printStackTrace();%0A            %7D%0A            return true;%0A        %7D catch (FileNotFoundException e) %7B%0A            e.printStackTrace();%0A            return false;%0A        %7D%0A    %7D%0A    public static String loadData(String filename,Context ctx)%7B%0A        try %7B%0A            FileInputStream fis = ctx.openFileInput(filename);%0A            InputStreamReader isr = new InputStreamReader(fis);%0A            char%5B%5D data = new char%5B255%5D;%0A            String final_data = %22%22;%0A            int size;%0A            try %7B%0A                while ((size = isr.read(data)) %3E 0) %7B%0A                    String read_data = String.copyValueOf(data, 0, size);%0A                    final_data += read_data;%0A                    data = new char%5B255%5D;%0A                %7D%0A                return String.valueOf(final_data);%0A            %7D catch (IOException e) %7B%0A                e.printStackTrace();%0A                return null;%0A            %7D%0A        %7D catch (FileNotFoundException e) %7B%0A            e.printStackTrace();%0A            return null;%0A        %7D%0A    %7D%0A%7D%0A

Create Requests.java