R
R
rusgayfer2019-04-01 23:01:09
Java
rusgayfer, 2019-04-01 23:01:09

How to get json from website?

Here is the info_apps.java file code

package com.apps.new;

import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class Info_apps extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_info_apps);

    }

        // Проверка обновлений
        public void onClick (View view){
        
            // Выводим
            Snackbar.make(view, "Данная функция в разработке.\nОбновляйте приложение на site.ru/app", Snackbar.LENGTH_LONG)
                    .setAction("Action", null).show();
        }

}

It is necessary that when the button onClickis clicked, the json version of the application on the server is checked, if the version is greater than the current one, then we display a confirmation for downloading.
Tried on org.json, the application is restarted when the button is clicked.
I can’t output any json at all, all the time there are some errors.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question