Android Open Source - android-wear-GoPro-Remote Go Pro Request






From Project

Back to project page android-wear-GoPro-Remote.

License

The source code is released under:

Apache License

If you think the Android project android-wear-GoPro-Remote 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.pascalwelsch.goprowearremote.net;
/*from   w ww. j a  v  a 2  s.c om*/
import com.android.volley.NetworkResponse;
import com.android.volley.Request;
import com.android.volley.Response;

import android.text.TextUtils;
import android.util.Log;

/**
 * @author Pascal Welsch
 * @since 25.06.14.
 */
public class GoProRequest extends Request {

    private static final String TAG = GoProRequest.class.getSimpleName();

    public GoProRequest(final String password, final String type, final String code,
            final boolean isBacpacRequest,
            final Response.ErrorListener error) {
        super(Method.GET, buildUrl(password, type, code, isBacpacRequest), error);
        Log.v(TAG, "url: " + getUrl());
        setShouldCache(false);
    }

    @Override
    protected void deliverResponse(final Object data) {
        // not handled
    }

    @Override
    protected Response parseNetworkResponse(final NetworkResponse networkResponse) {
        return Response.success("success", null);
    }

    @Override
    public int compareTo(final Object another) {
        return 0;
    }

    private static String buildUrl(final String password, final String method,
            final String param, final boolean bacpacRequest) {

        String path = "camera";
        if (bacpacRequest) {
            path = "bacpac";
        }

        String url = "http://10.5.5.9/" + path + "/" + method + "?t=" + password;

        if (!TextUtils.isEmpty(param)) {
            url += "&p=%" + param;
        }
        return url;
    }
}




Java Source Code List

com.pascalwelsch.goprowearremote.net.GoProAction.java
com.pascalwelsch.goprowearremote.net.GoProNotificationCmdReceiver.java
com.pascalwelsch.goprowearremote.net.GoProRequest.java
com.pascalwelsch.goprowearremote.ui.home.HomeActivity.java
com.pascalwelsch.goprowearremote.ui.home.HomeFragment.java
com.pascalwelsch.goprowearremote.ui.notifications.GoProNotificaionManager.java
com.pascalwelsch.goprowearremote.utils.ViewHelper.java