Partage
  • Partager sur Facebook
  • Partager sur Twitter

Android - java

Chargement JSON depuis serveur web

Sujet résolu
    31 mai 2019 à 18:49:06

    Bonjour, 

    J'essaie de charger des données depuis phpmyadmin sur mon téléphone. Mon application se lance mais les données ne sont pas chargées. 

    J'ai un message d'erreur qui m'indique: 

    2019-05-31 18:27:12.177 16784-16784/? E/Zygote: isWhitelistProcess - Process is Whitelisted

    2019-05-31 18:27:12.179 16784-16784/? E/Zygote: accessInfo : 1

    2019-05-31 18:43:50.699 18917-18917/fr.camille.applicationfinale W/plicationfinal: JIT profile information will not be recorded: profile file does not exits.

    J'ai crée une page principale MainActivity qui possède différents boutons. Tous les boutons fonctionnent, sauf celui pour le chargement des données. 

    J'ai fait différentes recherches concernant les messages d'erreur mais cela ne résout pas mon problème. 

    Je joins mes fichiers ainsi que des screenshots pour que cela soit plus parlant. 

    Quelqu'un aurait-il une idée sur ce qui peut poser problème? 

    // affichageDonnees.php
    
    <?php
    
    // connexion serveur
            define('SERVER','localhost');
            define('USER','root');
            define('PASSWORD','');
            define('BASE','test_bdd');
    
    
    try{
        $connexion = new PDO('mysql:host='.SERVER.';dbname='.BASE.';charset=UTF8', USER, PASSWORD);
    }
    catch (Exception $e){
        die("Erreur lors de l'accès à la base de données: " .$e->getMessage());
    }
    
    
    // requête permettant de récupérer les infos de la table voyages
    $requete = "SELECT PaysId, NomPays, ContinentPays FROM voyages";
    var_dump($requete);
    
    // entête de la liste des pays
    $jsonString = '{"VOYAGES": [';
    try{
        $resultat = $connexion->query($requete);
        var_dump($resultat);
    
        if ($resultat) {
            $liste = $resultat->fetchAll(PDO::FETCH_ASSOC);
            if(count($liste)>0){
                foreach($liste as $voyage){
                    $jsonString .= toJson(json_encode($voyage)).',';
                }
            }
            else{
                $jsonString .= '"PaysId":"","NomPays":"","ContinentPays":""';
            }        
        }
        else {
            var_dump($connexion->errorInfo());
        }
    
    
    }
    catch (Exception $e){
        die('Erreur : ' . $e->getMessage());
    }
    
    // fin de la liste des pays
    $jsonString = substr($jsonString, 0, strlen($jsonString)-1);
    $jsonString .= ']}';
    echo $jsonString;
    
    function toJson($liste){
        $liste = str_replace("[{","",$liste);
        $liste = str_replace("}]","",$liste);
        return $liste;
    }
    
    // MainActivity.java
    package fr.camille.applicationfinale;
    
    import android.content.Intent;
    import android.content.SharedPreferences;
    import android.graphics.Color;
    import android.util.Log;
    import android.view.Menu;
    import android.view.MenuItem;
    import android.preference.PreferenceManager;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.TextView;
    
    public class MainActivity extends AppCompatActivity {
    
        private TextView activity_main_titre;
    
        private final static int OPTION_MENU_1 = 1;
        private final static int OPTION_MENU_2 = 2;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
            activity_main_titre = findViewById(R.id.activity_main_titre);
            doPreferences();
    
            Button button1 = (Button) findViewById(R.id.main_activity_bouton_radio);
            Button button2 = (Button) findViewById(R.id.main_activity_liste);
            Button button3 = (Button) findViewById(R.id.main_activity_contact);
            Button button4 = (Button) findViewById(R.id.main_activity_tache_asynchrone);
            Button button5 = (Button) findViewById(R.id.main_activity_bloc_note);
            Button button6 = (Button) findViewById(R.id.main_activity_chargement_JSON_depuis_serveur_web);
            Button button7 = (Button) findViewById(R.id.main_activity_SQLite);
    
        button1.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                Intent intent1 = new Intent(MainActivity.this, SecondActivity.class);
                startActivity(intent1);
            }
        });
    
        button2.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                Intent intent2 = new Intent(MainActivity.this, ThirdActivity.class);
                startActivity(intent2);
            }
        });
    
        button3.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                Intent intent3 = new Intent(MainActivity.this, FourthActivity.class);
                startActivity(intent3);
            }
        });
    
        button4.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                Intent intent4 = new Intent(MainActivity.this, FifthActivity.class);
                startActivity(intent4);
            }
        });
    
        button5.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                Intent intent5 = new Intent(MainActivity.this, SixthActivity.class);
                startActivity(intent5);
            }
        });
    
        button6.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                Intent intent6 = new Intent(MainActivity.this, SeventhActivity.class);
                startActivity(intent6);
            }
        });
    
        button7.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                Intent intent7 = new Intent(MainActivity.this, EighthActivity.class);
                startActivity(intent7);
            }
        });
    
        }
    
        @Override
        protected void onRestart(){
            super.onRestart();
            doPreferences();
        }
    
        private void doPreferences(){
            SharedPreferences preferences =
                    PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
            Log.w("MyApp", "Toutes les préférences partagées => " + preferences.getAll());
            Log.w("MyApp", "titre " + preferences.getString("title", ""));
    
            boolean checkboxValue =
                    preferences.getBoolean("display",true);
            if(checkboxValue){
                Log.w("MyApp", "La checkbox display est à true => " + checkboxValue);
                activity_main_titre.setText(preferences.getString("title",""));
            }
            else{
                Log.w("MyApp", "La checkbox display est à false => " + checkboxValue);
                activity_main_titre.setText(" ");
            }
            switch (preferences.getString("color", "")){
                case "red":
                    Log.w("MyApp", "Je mets mon texte en rouge ");
                    activity_main_titre.setTextColor(Color.RED);
                    break;
                case "blue":
                    Log.w("MyApp", "Je mets mon texte en bleu ");
                    activity_main_titre.setTextColor(Color.BLUE);
                    break;
                case "green":
                    Log.w("MyApp", "Je mets mon texte en vert ");
                    activity_main_titre.setTextColor(Color.GREEN);
                    break;
                default:
                    Log.w("MyApp", "Je ne connais pas cette couleur" + preferences.getString("textColor", ""));
                    activity_main_titre.setTextColor(Color.GRAY);
                    break;
            }
        }
        @Override
        public boolean onCreateOptionsMenu(Menu menu){
            menu.add(0, OPTION_MENU_1, 0, "Préférences");
            menu.add(0, OPTION_MENU_2, 0, "Quitter");
            return super.onCreateOptionsMenu(menu);
        }
        @Override
        public boolean onOptionsItemSelected(MenuItem item){
            switch(item.getItemId()){
                case OPTION_MENU_1:
                    Intent displayPref = new Intent(this, PreferenceActivity.class);
                    startActivity(displayPref);
                    return true;
                case OPTION_MENU_2:
                    finish();
                    return true;
                default:
                    return super.onOptionsItemSelected(item);
            }
        }
    }
    
    
    // activity_main.xml
    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity">
    
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Mon titre"
            android:id="@+id/activity_main_titre"
            android:textAlignment="center"
            android:textSize="50dp"/>
    
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="vertical">
    
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center_horizontal|center_vertical"
                android:layout_weight="1"
                android:gravity="center_horizontal"
                android:orientation="horizontal">
    
                <TextView
                    android:id="@+id/main_activity_titre_text"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="Hello World!" />
    
            </LinearLayout>
    
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="horizontal">
    
                <Button
                    android:id="@+id/main_activity_bouton_radio"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="Bouton Radio" />
    
            </LinearLayout>
    
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="horizontal">
    
                <Button
                    android:id="@+id/main_activity_liste"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="Liste" />
            </LinearLayout>
    
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="horizontal">
    
                <Button
                    android:id="@+id/main_activity_contact"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="Contacts" />
    
            </LinearLayout>
    
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="horizontal">
    
                <Button
                    android:id="@+id/main_activity_tache_asynchrone"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="Tache asynchrone" />
    
            </LinearLayout>
    
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="horizontal">
    
                <Button
                    android:id="@+id/main_activity_bloc_note"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="Bloc Note" />
    
            </LinearLayout>
    
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="horizontal">
    
                <Button
                    android:id="@+id/main_activity_chargement_JSON_depuis_serveur_web"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="Chargement JSON depuis serveur web" />
    
            </LinearLayout>
    
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="horizontal">
    
                <Button
                    android:id="@+id/main_activity_SQLite"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="Ecriture en base de données SQLite" />
    
            </LinearLayout>
    
        </LinearLayout>
    
    </RelativeLayout>
    // seventhActivity.java
    package fr.camille.applicationfinale;
    
    import android.os.AsyncTask;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.view.Menu;
    import android.view.MenuItem;
    import android.widget.ListView;
    import android.widget.Toast;
    
    import org.json.JSONArray;
    import org.json.JSONException;
    import org.json.JSONObject;
    
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.UnsupportedEncodingException;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.util.ArrayList;
    
    public class SeventhActivity extends AppCompatActivity {
    
        private ArrayList<User> userArrayList;
        private ListView listView;
        private UserAdapter userAdapter;
    
        // option menu
        private final static int MENU_OPTION_DOWNLOAD = 0;
        private final static int MENU_OPTION_QUIT = 1;
    
        // récupération des infos utilisateurs depuis JSON
        private String firstname;
        private String lastname;
        private String school;
        private String level;
    
        // objet pour chargement données en tâche asynchrone
        private Chargement chargement;
    
        @Override
        protected void onCreate(Bundle savedInstanceState){
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_seventh);
    
            // création liste utilisateurs
            userArrayList =  new ArrayList<User>();
    
            // création adaptateur
            userAdapter = new UserAdapter(this, userArrayList);
    
            // chargement liste avec tâche asynchrone interne
            userLoaded();
    
            listView = findViewById(R.id.activity_seventh_utilisateurs);
            listView.setAdapter(userAdapter);
        }
    
        // création menu avec options charger liste & quitter
        @Override
        public boolean onCreateOptionsMenu(Menu menu){
            menu.add(0, MENU_OPTION_DOWNLOAD, 0, "Charger");
            menu.add(0, MENU_OPTION_QUIT, 1, "Quitter");
            return super.onCreateOptionsMenu(menu);
        }
    
        // actions du menu
        @Override
        public boolean onOptionsItemSelected(MenuItem item){
            switch (item.getItemId()){
                case MENU_OPTION_DOWNLOAD:
                    Toast.makeText(SeventhActivity.this, "Chargement en cours...", Toast.LENGTH_SHORT).show();
                    userLoaded();
                    break;
                case MENU_OPTION_QUIT:
                    Toast.makeText(SeventhActivity.this, "A bientôt", Toast.LENGTH_SHORT).show();
                    finish();
                    break;
            }
            return super.onOptionsItemSelected(item);
        }
    
        // vérification existence objet chargement
        public void userLoaded(){
            userArrayList.clear();
            if(chargement == null || chargement.getStatus() == AsyncTask.Status.FINISHED){
                chargement = new Chargement();
            }
            if(chargement.getStatus() == AsyncTask.Status.PENDING){
                chargement.execute();
            }
        }
    
        // classe chargement
        public class Chargement extends AsyncTask{
            // récupération contenu fichier JSON
            @Override
            protected Object doInBackground(final Object[] params){
                try{
                    URL url = new URL("http://localhost/Android/avance_ex3/affichageDonnees.php");
    
                    HttpURLConnection connection = (HttpURLConnection) url.openConnection();
                    connection.setReadTimeout(10000);
                    connection.setConnectTimeout(15000);
                    connection.setRequestMethod("GET");
                    connection.connect();
                    InputStream is = connection.getInputStream();
                    return readIt(is);
                }
                catch (Exception e){
                    e.printStackTrace();
                    return null;
                }
            }
            // ajout contenu fichier à la liste des utilisateurs après lecture
            @Override
            protected void onPostExecute(Object listJSON){
                if(listJSON != null){
                    String jsonString = (String) listJSON;
                    try{
                        JSONObject jsonRootObject = new JSONObject(jsonString);
                        JSONArray jsonArray = jsonRootObject.optJSONArray("USERS");
    
                        for(int i = 0; i < jsonArray.length(); i++){
                            JSONObject jsonObject = jsonArray.getJSONObject(i);
                            firstname = jsonObject.optString("firstname");
                            lastname = jsonObject.optString("lastname");
                            school = jsonObject.optString("school");
                            level = jsonObject.optString("level");
                            User user = new User(firstname, lastname, school, level);
                            userArrayList.add(user);
                        }
                    }
                    catch(JSONException e){
                        e.printStackTrace();
                    }
                    userAdapter.notifyDataSetChanged();
                }
            }
        }
    
        private String readIt(InputStream stream) throws IOException, UnsupportedEncodingException{
            StringBuilder builder = new StringBuilder();
            BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
            String line;
            while ((line = reader.readLine()) != null){
                builder.append(line + "\n");
            }
            return builder.toString();
        }
    }
    
    // User.java
    package fr.camille.applicationfinale;
    
    public class User {
        private String firstname;
        private String lastname;
        private String school;
        private String level;
    
        public User(String firstname, String lastname, String school, String level){
            this.firstname = firstname;
            this.lastname = lastname;
            this.school = school;
            this.level = level;
        }
    
        public String getFirstname(){
            return firstname;
        }
        public void setFirstname(String firstname){
            this.firstname = firstname;
        }
    
        public String getLastname(){
            return lastname;
        }
        public void setLastname(String lastname){
            this.lastname = lastname;
        }
    
        public String getSchool(){
            return school;
        }
        public void setSchool(String school){
            this.school = school;
        }
    
        public String getLevel(){
            return level;
        }
        public void setLevel(String level){
            this.level = level;
        }
    }
    
    
    // UserAdapter.java
    package fr.camille.applicationfinale;
    
    import android.content.Context;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.BaseAdapter;
    import android.widget.TextView;
    import java.util.ArrayList;
    
    public class UserAdapter extends BaseAdapter {
        private ArrayList<User> userArrayList;
        private LayoutInflater mInflater;
        public UserAdapter(Context context, ArrayList<User> userArrayList){
            this.mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            this.userArrayList = userArrayList;
        }
        @Override
        public int getCount(){
            return userArrayList.size();
        }
        @Override
        public User getItem(int position){
            return userArrayList.get(position);
        }
        @Override
        public long getItemId(int position){
            return position;
        }
        @Override
        public View getView(int position, View rowView, ViewGroup parent){
            ViewHolder viewHolder;
            if (rowView == null){
                rowView = mInflater.inflate(R.layout.user_cell, null);
                viewHolder = new ViewHolder();
                viewHolder.user_cell_firstname = (TextView) rowView.findViewById(R.id.user_cell_firstname);
                viewHolder.user_cell_lastname = (TextView) rowView.findViewById(R.id.user_cell_lastname);
                rowView.setTag(viewHolder);
            }
            else{
                viewHolder = (ViewHolder) rowView.getTag();
            }
            User user = getItem(position);
            viewHolder.user_cell_firstname.setText(user.getFirstname());
            viewHolder.user_cell_lastname.setText(user.getLastname());
            return rowView;
        }
        public class ViewHolder{
            public TextView user_cell_firstname;
            public TextView user_cell_lastname;
        }
    }
    
    // activity_seventh.xml
    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity">
    
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/app_name"
            android:textAlignment="center"
            android:textSize="25sp"
            android:id="@+id/activity_seventh_titre"/>
    
        <ListView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:listitem="@layout/user_cell"
            android:id="@+id/activity_seventh_utilisateurs"
            android:layout_below="@+id/activity_seventh_titre"
            android:stackFromBottom="false"/>
    </RelativeLayout>
    // user_cell.xml
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Prénom"
            android:id="@+id/user_cell_firstname"
            android:layout_weight="2"
            android:textSize="15sp"/>
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Nom"
            android:id="@+id/user_cell_lastname"
            android:layout_weight="2"
            android:textSize="15sp"
            android:layout_gravity="left"/>
    </LinearLayout>
    // AndroidManifest
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:tools="http://schemas.android.com/tools"
        package="fr.camille.applicationfinale"
        xmlns:android="http://schemas.android.com/apk/res/android">
    
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    
        <uses-permission android:name="android.permission.INTERNET"/>
    
        <application
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:supportsRtl="true"
            android:theme="@style/AppTheme"
            tools:ignore="AllowBackup,GoogleAppIndexingWarning">
            <activity android:name=".MainActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name=".SecondActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN"/>
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name=".ThirdActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN"/>
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name=".FourthActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN"/>
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name=".FifthActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN"/>
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name=".SixthActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN"/>
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name=".SeventhActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN"/>
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
            <activity android:name=".EighthActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN"/>
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
    
            <activity android:name=".PreferenceActivity">
            </activity>
    
        </application>
    
    </manifest>

    Données format JSONRendu de l'appliChargement données


    Merci bcp 

    Camille 

    -
    Edité par CamilleClodius 31 mai 2019 à 20:11:33

    • Partager sur Facebook
    • Partager sur Twitter
      31 mai 2019 à 20:23:43

      Salut,

      Tu ne peux pas exécuter de code php sur une application mobile.

      ÉDIT : j’avais vu que le premier fichier mea culpa. Y’a un peu trop à lire ceci dit.

      -
      Edité par Geda 31 mai 2019 à 20:25:42

      • Partager sur Facebook
      • Partager sur Twitter
        1 juin 2019 à 9:48:07

        Geda a écrit:

        Salut,

        Tu ne peux pas exécuter de code php sur une application mobile.

        ÉDIT : j’avais vu que le premier fichier mea culpa. Y’a un peu trop à lire ceci dit.

        -
        Edité par Geda il y a environ 13 heures


        Je suis désolée pour la longueur du post mais au moins, il devrait y avoir toutes les infos pour avoir une réponse qui correspond à mon problème... ;)
        • Partager sur Facebook
        • Partager sur Twitter
          1 juin 2019 à 19:42:35

          Mouai. C’est assez décourageant quand on voit des trucs énormes comme ça. C’est important de savoir isoler le problème. Ta classe User ou tes xml par exemple... mouai. En revanche il aurait été utile d’envoyer la stack complete (je pense qu’il y a plus de 3 messages )

          CECI DIT ! Je vois que tu passes par localhost. Il faut savoir que le localhost du simulateur et de ta machine sont différents. 10.0.2.2 pour accéder au localhost de ta machine.

          Je rebondis sur le premier paragraphe : je suis sur mobile donc ça fait vraiment lourd les 15 fichiers. Le localhost je l’avais raté quand j’ai survolé la première fois

          Un peu de doc : https://developer.android.com/studio/run/emulator-networking

          -
          Edité par Geda 1 juin 2019 à 19:47:54

          • Partager sur Facebook
          • Partager sur Twitter
            1 juin 2019 à 20:38:20

            Geda a écrit:

            Mouai. C’est assez décourageant quand on voit des trucs énormes comme ça. C’est important de savoir isoler le problème. Ta classe User ou tes xml par exemple... mouai. En revanche il aurait été utile d’envoyer la stack complete (je pense qu’il y a plus de 3 messages )

            CECI DIT ! Je vois que tu passes par localhost. Il faut savoir que le localhost du simulateur et de ta machine sont différents. 10.0.2.2 pour accéder au localhost de ta machine.

            Je rebondis sur le premier paragraphe : je suis sur mobile donc ça fait vraiment lourd les 15 fichiers. Le localhost je l’avais raté quand j’ai survolé la première fois

            Un peu de doc : https://developer.android.com/studio/run/emulator-networking

            -
            Edité par Geda il y a environ 1 heure


            Je veux bien te transmettre l'intégralité des logs mais si tu trouves mon code décourageant, ce n'est pas les logs qui vont être plaisants à voir... même si j'imagine que ce sera plus simple pour comprendre d'où vient l'erreur: 

            2019-06-01 20:36:15.363 26931-26931/? E/Zygote: isWhitelistProcess - Process is Whitelisted

            2019-06-01 20:36:15.368 26931-26931/? E/Zygote: accessInfo : 1

            2019-06-01 20:36:15.370 26931-26931/? I/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c186,c257,c512,c768, pkgname=fr.camille.applicationfinale 

            2019-06-01 20:36:15.377 26931-26931/? I/plicationfinal: Late-enabling -Xcheck:jni

            2019-06-01 20:36:15.561 26931-26931/fr.camille.applicationfinale D/ConnectivityManager_URSP: Ursp sIsUrsp=false, sIsCheckUrsp=false, uid=10442

            2019-06-01 20:36:15.569 26931-26931/fr.camille.applicationfinale D/Proxy: urspP is null: 10442

            2019-06-01 20:36:15.713 26931-26931/fr.camille.applicationfinale W/plicationfinal: JIT profile information will not be recorded: profile file does not exits.

            2019-06-01 20:36:15.715 26931-26931/fr.camille.applicationfinale I/chatty: uid=10442(fr.camille.applicationfinale) identical 10 lines

            2019-06-01 20:36:15.715 26931-26931/fr.camille.applicationfinale W/plicationfinal: JIT profile information will not be recorded: profile file does not exits.

            2019-06-01 20:36:15.758 26931-26931/fr.camille.applicationfinale I/InstantRun: starting instant run server: is main process

            2019-06-01 20:36:15.901 26931-26967/fr.camille.applicationfinale D/libEGL: loaded /vendor/lib64/egl/libGLES_mali.so

            2019-06-01 20:36:16.146 26931-26931/fr.camille.applicationfinale W/plicationfinal: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)

            2019-06-01 20:36:16.147 26931-26931/fr.camille.applicationfinale W/plicationfinal: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)

            2019-06-01 20:36:16.355 26931-26931/fr.camille.applicationfinale W/MyApp: Toutes les préférences partagées => {color=red, title=je t'aime, display=true}

            2019-06-01 20:36:16.355 26931-26931/fr.camille.applicationfinale W/MyApp: titre je t'aime

            2019-06-01 20:36:16.356 26931-26931/fr.camille.applicationfinale W/MyApp: La checkbox display est à true => true

            2019-06-01 20:36:16.356 26931-26931/fr.camille.applicationfinale W/MyApp: Je mets mon texte en rouge 

            2019-06-01 20:36:16.424 26931-26931/fr.camille.applicationfinale D/OpenGLRenderer: Skia GL Pipeline

            2019-06-01 20:36:16.430 26931-26931/fr.camille.applicationfinale D/EmergencyMode: [EmergencyManager] android createPackageContext successful

            2019-06-01 20:36:16.467 26931-26931/fr.camille.applicationfinale D/InputTransport: Input channel constructed: fd=75

            2019-06-01 20:36:16.469 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@eb70a91[MainActivity]: setView = DecorView@64dddf6[MainActivity] TM=true MM=false

            2019-06-01 20:36:16.502 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@eb70a91[MainActivity]: dispatchAttachedToWindow

            2019-06-01 20:36:16.560 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@eb70a91[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x7 surface={valid=true 510233911296} changed=true

            2019-06-01 20:36:16.574 26931-27008/fr.camille.applicationfinale I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0

            2019-06-01 20:36:16.574 26931-27008/fr.camille.applicationfinale I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0

            2019-06-01 20:36:16.574 26931-27008/fr.camille.applicationfinale I/OpenGLRenderer: Initialized EGL, version 1.4

            2019-06-01 20:36:16.574 26931-27008/fr.camille.applicationfinale D/OpenGLRenderer: Swap behavior 2

            2019-06-01 20:36:16.593 26931-27008/fr.camille.applicationfinale D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000

            2019-06-01 20:36:16.593 26931-27008/fr.camille.applicationfinale D/OpenGLRenderer: eglCreateWindowSurface = 0x76c2077400, 0x76cc4fa010

            2019-06-01 20:36:16.765 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@eb70a91[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1

            2019-06-01 20:36:16.779 26931-26931/fr.camille.applicationfinale D/InputMethodManager: prepareNavigationBarInfo() DecorView@64dddf6[MainActivity]

            2019-06-01 20:36:16.779 26931-26931/fr.camille.applicationfinale D/InputMethodManager: getNavigationBarColor() -855310

            2019-06-01 20:36:16.789 26931-26931/fr.camille.applicationfinale D/InputMethodManager: prepareNavigationBarInfo() DecorView@64dddf6[MainActivity]

            2019-06-01 20:36:16.789 26931-26931/fr.camille.applicationfinale D/InputMethodManager: getNavigationBarColor() -855310

            2019-06-01 20:36:16.789 26931-26931/fr.camille.applicationfinale D/InputMethodManager: startInputInner - Id : 0

            2019-06-01 20:36:16.789 26931-26931/fr.camille.applicationfinale I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus

            2019-06-01 20:36:16.800 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@eb70a91[MainActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 2220) ci=Rect(0, 63 - 0, 126) vi=Rect(0, 63 - 0, 126) or=1

            2019-06-01 20:36:16.801 26931-26951/fr.camille.applicationfinale D/InputTransport: Input channel constructed: fd=86

            2019-06-01 20:36:16.802 26931-26931/fr.camille.applicationfinale D/InputMethodManager: prepareNavigationBarInfo() DecorView@64dddf6[MainActivity]

            2019-06-01 20:36:16.802 26931-26931/fr.camille.applicationfinale D/InputMethodManager: getNavigationBarColor() -855310

            2019-06-01 20:36:16.802 26931-26931/fr.camille.applicationfinale D/InputMethodManager: startInputInner - Id : 0

            2019-06-01 20:36:24.607 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@eb70a91[MainActivity]: ViewPostIme pointer 0

            2019-06-01 20:36:24.705 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@eb70a91[MainActivity]: ViewPostIme pointer 1

            2019-06-01 20:36:24.765 26931-26931/fr.camille.applicationfinale W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@14a2e7e

            2019-06-01 20:36:24.851 26931-27224/fr.camille.applicationfinale D/NetworkSecurityConfig: No Network Security Config specified, using platform default

            2019-06-01 20:36:24.856 26931-27224/fr.camille.applicationfinale I/System.out: (HTTPLog)-Static: isSBSettingEnabled false

            2019-06-01 20:36:24.856 26931-27224/fr.camille.applicationfinale W/System.err: java.io.IOException: Cleartext HTTP traffic to localhost not permitted

            2019-06-01 20:36:24.856 26931-27224/fr.camille.applicationfinale W/System.err:     at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)

            2019-06-01 20:36:24.856 26931-27224/fr.camille.applicationfinale W/System.err:     at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:467)

            2019-06-01 20:36:24.856 26931-27224/fr.camille.applicationfinale W/System.err:     at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)

            2019-06-01 20:36:24.857 26931-27224/fr.camille.applicationfinale W/System.err:     at fr.camille.applicationfinale.SeventhActivity$Chargement.doInBackground(SeventhActivity.java:108)

            2019-06-01 20:36:24.857 26931-27224/fr.camille.applicationfinale W/System.err:     at android.os.AsyncTask$2.call(AsyncTask.java:333)

            2019-06-01 20:36:24.857 26931-27224/fr.camille.applicationfinale W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:266)

            2019-06-01 20:36:24.857 26931-27224/fr.camille.applicationfinale W/System.err:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)

            2019-06-01 20:36:24.857 26931-27224/fr.camille.applicationfinale W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)

            2019-06-01 20:36:24.857 26931-27224/fr.camille.applicationfinale W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)

            2019-06-01 20:36:24.857 26931-27224/fr.camille.applicationfinale W/System.err:     at java.lang.Thread.run(Thread.java:764)

            2019-06-01 20:36:24.866 26931-26931/fr.camille.applicationfinale D/InputTransport: Input channel constructed: fd=87

            2019-06-01 20:36:24.867 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@541f8c7[SeventhActivity]: setView = DecorView@7cdbef4[SeventhActivity] TM=true MM=false

            2019-06-01 20:36:24.869 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@eb70a91[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 0 1

            2019-06-01 20:36:24.869 26931-26931/fr.camille.applicationfinale D/InputMethodManager: prepareNavigationBarInfo() DecorView@64dddf6[MainActivity]

            2019-06-01 20:36:24.869 26931-26931/fr.camille.applicationfinale D/InputMethodManager: getNavigationBarColor() -855310

            2019-06-01 20:36:24.876 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@541f8c7[SeventhActivity]: dispatchAttachedToWindow

            2019-06-01 20:36:24.896 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@541f8c7[SeventhActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x7 surface={valid=true 509837398016} changed=true

            2019-06-01 20:36:24.903 26931-27008/fr.camille.applicationfinale D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000

            2019-06-01 20:36:24.903 26931-27008/fr.camille.applicationfinale D/OpenGLRenderer: eglCreateWindowSurface = 0x76b4a3bb00, 0x76b4ad5010

            2019-06-01 20:36:24.906 26931-26931/fr.camille.applicationfinale D/AbsListView:  in onLayout changed 

            2019-06-01 20:36:24.938 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@541f8c7[SeventhActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1

            2019-06-01 20:36:24.958 26931-26931/fr.camille.applicationfinale D/InputMethodManager: prepareNavigationBarInfo() DecorView@7cdbef4[SeventhActivity]

            2019-06-01 20:36:24.958 26931-26931/fr.camille.applicationfinale D/InputMethodManager: getNavigationBarColor() -855310

            2019-06-01 20:36:24.961 26931-26931/fr.camille.applicationfinale D/InputMethodManager: prepareNavigationBarInfo() DecorView@7cdbef4[SeventhActivity]

            2019-06-01 20:36:24.961 26931-26931/fr.camille.applicationfinale D/InputMethodManager: getNavigationBarColor() -855310

            2019-06-01 20:36:24.961 26931-26931/fr.camille.applicationfinale D/InputMethodManager: startInputInner - Id : 0

            2019-06-01 20:36:24.961 26931-26931/fr.camille.applicationfinale I/InputMethodManager: startInputInner - mService.startInputOrWindowGainedFocus

            2019-06-01 20:36:24.963 26931-26931/fr.camille.applicationfinale D/InputTransport: Input channel constructed: fd=98

            2019-06-01 20:36:24.963 26931-26931/fr.camille.applicationfinale D/InputTransport: Input channel destroyed: fd=86

            2019-06-01 20:36:24.967 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@541f8c7[SeventhActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1080, 2220) ci=Rect(0, 63 - 0, 126) vi=Rect(0, 63 - 0, 126) or=1

            2019-06-01 20:36:25.270 26931-27008/fr.camille.applicationfinale W/libEGL: EGLNativeWindowType 0x76cc4fa010 disconnect failed

            2019-06-01 20:36:25.270 26931-27008/fr.camille.applicationfinale D/OpenGLRenderer: eglDestroySurface = 0x76c2077400, 0x76cc4fa000

            2019-06-01 20:36:25.280 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@eb70a91[MainActivity]: Relayout returned: old=[0,0][1080,2220] new=[0,0][1080,2220] result=0x5 surface={valid=false 0} changed=true

            2019-06-01 20:36:25.283 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@eb70a91[MainActivity]: Surface release. android.view.WindowManagerGlobal.setStoppedState:669 android.app.Activity.performStop:7646 android.app.ActivityThread.callActivityOnStop:4352 android.app.ActivityThread.performStopActivityInner:4330 android.app.ActivityThread.handleStopActivity:4405 android.app.servertransaction.StopActivityItem.execute:41 android.app.servertransaction.TransactionExecutor.executeLifecycleState:145 android.app.servertransaction.TransactionExecutor.execute:70 

            2019-06-01 20:36:27.879 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@541f8c7[SeventhActivity]: ViewPostIme pointer 0

            2019-06-01 20:36:27.930 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@541f8c7[SeventhActivity]: ViewPostIme pointer 1

            2019-06-01 20:36:27.963 26931-26931/fr.camille.applicationfinale W/plicationfinal: Accessing hidden method Landroid/widget/PopupWindow;->setClipToScreenEnabled(Z)V (light greylist, reflection)

            2019-06-01 20:36:27.964 26931-26931/fr.camille.applicationfinale W/plicationfinal: Accessing hidden method Landroid/widget/PopupWindow;->setEpicenterBounds(Landroid/graphics/Rect;)V (light greylist, reflection)

            2019-06-01 20:36:27.964 26931-26931/fr.camille.applicationfinale W/plicationfinal: Accessing hidden method Landroid/widget/PopupWindow;->setTouchModal(Z)V (light greylist, reflection)

            2019-06-01 20:36:28.037 26931-26931/fr.camille.applicationfinale W/plicationfinal: Accessing hidden field Landroid/widget/AbsListView;->mIsChildViewEnabled:Z (light greylist, reflection)

            2019-06-01 20:36:28.053 26931-26931/fr.camille.applicationfinale D/InputTransport: Input channel constructed: fd=89

            2019-06-01 20:36:28.054 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@287a253[PopupWindow:dd8cd24]: setView = android.widget.PopupWindow$PopupDecorView{6679790 V.E...... R.....I. 0,0-0,0} TM=true MM=false

            2019-06-01 20:36:28.079 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@287a253[PopupWindow:dd8cd24]: dispatchAttachedToWindow

            2019-06-01 20:36:28.093 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@287a253[PopupWindow:dd8cd24]: Relayout returned: old=[0,63][1080,2094] new=[555,73][1070,325] result=0x7 surface={valid=true 510233501696} changed=true

            2019-06-01 20:36:28.096 26931-27008/fr.camille.applicationfinale D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000

            2019-06-01 20:36:28.096 26931-27008/fr.camille.applicationfinale D/OpenGLRenderer: eglCreateWindowSurface = 0x76b4b8c100, 0x76cc496010

            2019-06-01 20:36:28.128 26931-26931/fr.camille.applicationfinale D/AbsListView:  in onLayout changed 

            2019-06-01 20:36:28.137 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@287a253[PopupWindow:dd8cd24]: MSG_WINDOW_FOCUS_CHANGED 1 1

            2019-06-01 20:36:28.162 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@287a253[PopupWindow:dd8cd24]: MSG_RESIZED: frame=Rect(555, 73 - 1070, 325) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1

            2019-06-01 20:36:28.162 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@541f8c7[SeventhActivity]: MSG_WINDOW_FOCUS_CHANGED 0 1

            2019-06-01 20:36:28.162 26931-26931/fr.camille.applicationfinale D/InputMethodManager: prepareNavigationBarInfo() DecorView@7cdbef4[SeventhActivity]

            2019-06-01 20:36:28.162 26931-26931/fr.camille.applicationfinale D/InputMethodManager: getNavigationBarColor() -855310

            2019-06-01 20:36:28.829 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@287a253[PopupWindow:dd8cd24]: ViewPostIme pointer 0

            2019-06-01 20:36:28.871 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@287a253[PopupWindow:dd8cd24]: ViewPostIme pointer 1

            2019-06-01 20:36:28.872 26931-26931/fr.camille.applicationfinale D/AbsListView: onTouchUp() mTouchMode : 0

            2019-06-01 20:36:29.004 26931-27267/fr.camille.applicationfinale I/System.out: (HTTPLog)-Static: isSBSettingEnabled false

            2019-06-01 20:36:29.005 26931-27267/fr.camille.applicationfinale W/System.err: java.io.IOException: Cleartext HTTP traffic to localhost not permitted

            2019-06-01 20:36:29.005 26931-27267/fr.camille.applicationfinale W/System.err:     at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:115)

            2019-06-01 20:36:29.005 26931-27267/fr.camille.applicationfinale W/System.err:     at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:467)

            2019-06-01 20:36:29.005 26931-27267/fr.camille.applicationfinale W/System.err:     at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)

            2019-06-01 20:36:29.005 26931-27267/fr.camille.applicationfinale W/System.err:     at fr.camille.applicationfinale.SeventhActivity$Chargement.doInBackground(SeventhActivity.java:108)

            2019-06-01 20:36:29.005 26931-27267/fr.camille.applicationfinale W/System.err:     at android.os.AsyncTask$2.call(AsyncTask.java:333)

            2019-06-01 20:36:29.005 26931-27267/fr.camille.applicationfinale W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:266)

            2019-06-01 20:36:29.005 26931-27267/fr.camille.applicationfinale W/System.err:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)

            2019-06-01 20:36:29.005 26931-27267/fr.camille.applicationfinale W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)

            2019-06-01 20:36:29.005 26931-27267/fr.camille.applicationfinale W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)

            2019-06-01 20:36:29.005 26931-27267/fr.camille.applicationfinale W/System.err:     at java.lang.Thread.run(Thread.java:764)

            2019-06-01 20:36:29.015 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@287a253[PopupWindow:dd8cd24]: Relayout returned: old=[555,73][1070,325] new=[555,73][1070,325] result=0x1 surface={valid=true 510233501696} changed=false

            2019-06-01 20:36:29.032 26931-26931/fr.camille.applicationfinale D/InputTransport: Input channel constructed: fd=91

            2019-06-01 20:36:29.032 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@5554797[Toast]: setView = android.widget.LinearLayout{6e9ad84 V.E...... ......I. 0,0-0,0} TM=true MM=false

            2019-06-01 20:36:29.033 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@541f8c7[SeventhActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1

            2019-06-01 20:36:29.034 26931-26931/fr.camille.applicationfinale D/InputMethodManager: prepareNavigationBarInfo() DecorView@7cdbef4[SeventhActivity]

            2019-06-01 20:36:29.034 26931-26931/fr.camille.applicationfinale D/InputMethodManager: getNavigationBarColor() -855310

            2019-06-01 20:36:29.037 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@287a253[PopupWindow:dd8cd24]: MSG_WINDOW_FOCUS_CHANGED 0 1

            2019-06-01 20:36:29.040 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@5554797[Toast]: dispatchAttachedToWindow

            2019-06-01 20:36:29.053 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@5554797[Toast]: Relayout returned: old=[0,63][1080,2094] new=[283,1810][797,1926] result=0x7 surface={valid=true 509539217408} changed=true

            2019-06-01 20:36:29.055 26931-27008/fr.camille.applicationfinale D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000

            2019-06-01 20:36:29.055 26931-27008/fr.camille.applicationfinale D/OpenGLRenderer: eglCreateWindowSurface = 0x76b4b8c800, 0x76a2e77010

            2019-06-01 20:36:29.096 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@5554797[Toast]: MSG_RESIZED: frame=Rect(283, 1810 - 797, 1926) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1

            2019-06-01 20:36:29.350 26931-27008/fr.camille.applicationfinale W/libEGL: EGLNativeWindowType 0x76cc496010 disconnect failed

            2019-06-01 20:36:29.351 26931-27008/fr.camille.applicationfinale D/OpenGLRenderer: eglDestroySurface = 0x76b4b8c100, 0x76cc496000

            2019-06-01 20:36:29.351 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@287a253[PopupWindow:dd8cd24]: dispatchDetachedFromWindow

            2019-06-01 20:36:29.352 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@287a253[PopupWindow:dd8cd24]: Surface release. android.view.ViewRootImpl.doDie:7931 android.view.ViewRootImpl.die:7899 android.view.WindowManagerGlobal.removeViewLocked:497 android.view.WindowManagerGlobal.removeView:435 android.view.WindowManagerImpl.removeViewImmediate:124 android.widget.PopupWindow.dismissImmediate:2242 android.widget.PopupWindow.access$200:118 android.widget.PopupWindow$3.onTransitionEnd:2181 

            2019-06-01 20:36:29.361 26931-26931/fr.camille.applicationfinale D/InputTransport: Input channel destroyed: fd=89

            2019-06-01 20:36:31.004 26931-27008/fr.camille.applicationfinale W/libEGL: EGLNativeWindowType 0x76a2e77010 disconnect failed

            2019-06-01 20:36:31.004 26931-27008/fr.camille.applicationfinale D/OpenGLRenderer: eglDestroySurface = 0x76b4b8c800, 0x76a2e77000

            2019-06-01 20:36:31.004 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@5554797[Toast]: dispatchDetachedFromWindow

            2019-06-01 20:36:31.006 26931-26931/fr.camille.applicationfinale D/ViewRootImpl@5554797[Toast]: Surface release. android.view.ViewRootImpl.doDie:7931 android.view.ViewRootImpl.die:7899 android.view.WindowManagerGlobal.removeViewLocked:497 android.view.WindowManagerGlobal.removeView:435 android.view.WindowManagerImpl.removeViewImmediate:124 android.widget.Toast$TN.handleHide:1129 android.widget.Toast$TN$1.handleMessage:917 android.os.Handler.dispatchMessage:106 

            2019-06-01 20:36:31.022 26931-26931/fr.camille.applicationfinale D/InputTransport: Input channel destroyed: fd=91

            • Partager sur Facebook
            • Partager sur Twitter
              2 juin 2019 à 18:18:34

              Effectivement c’est peu encourageant :D. Normalement on peut filtrer sur les logs d’erreurs

              Et le 10.0.2.2 ça ne marche pas ?

              • Partager sur Facebook
              • Partager sur Twitter
                3 juin 2019 à 9:17:44

                Hum... ce qui est étonnant c'est que j'ai reproduit exactement le même code qu'un exercice précédent qui fonctionnait très bien. J'ai les mêmes noms de fichiers, le même code car je fais référence à la même table en BDD etc. Le seul truc qui change c'est la façon dont j'ai nommé mon application. Et mon exercice était fonctionnel aussi bien sur le serveur distant de mon organisme de formation que sur mon ordinateur en local et sans avoir essayé le 10.0.2.2. C'est pas un peu bizarre non?
                • Partager sur Facebook
                • Partager sur Twitter

                Android - java

                × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
                × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
                • Editeur
                • Markdown