Ubidots Community

Android Studio App

Hi, I followed the steps of this tutorial: Android SDK to make an app with connection to Ubidots. I don’t understand very well what can I do to send any other variable besides the percentage of my battery, and also, how can I send the data every two seconds? Thanks.

Hello @alexmgpk,

I had a look to that piece of documentation and I can see that’s very outdated, not only from the Android version perspective, but also from Ubidots’ UI.
With this in mind:

  1. I’m wondering, can you walk me through about how you got to that link?

  2. After consulting internally with our team, I’ve been advised that we are no longer providing support for that tutorial, neither for the associated Java library.
    We will, to prevent other users from hitting this wall, put a “DEPRECATED NO LONGER” banner in the website

All the best,

-Juan David Tangarife-

Thanks for the response. I was aware of the outdated tutorial but it worked fine and I found it just by searching for ubidots and android studio app.

Since the info on the link is outdated, is there any other tutorial or information about an android studio app (java) and ubidots? I’m looking for it because I want to send data from the app to the platform.

Solved using the following thread [SOLVED] Send data from Android Studio.

Since the variable I’m sending varies, I changed the function as follows:

private void sendRequestAndPrintResponse() {
        mRequestQueue = Volley.newRequestQueue(this);
        String url = "https://industrial.ubidots.com/api/v1.6/devices/YourDevice/?token=YourToken&_method=post&YourVariable="+txtData.getText().toString();
        stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>()
        {
            @Override
            public void onResponse(String response)
            {
                Log.i(TAG1,"Response : " + response.toString());
            }
        },new Response.ErrorListener()
        {
            @Override
            public void onErrorResponse(VolleyError error)
            {
                Log.i(TAG1,"Error" + error.toString());
            }
        });
        mRequestQueue.add(stringRequest);
    }

I’m receiving the variable in a textview and when it changes, the value is sent to the platform.