IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

API standards et tierces Android Discussion :

Problème Socket Android


Sujet :

API standards et tierces Android

  1. #1
    Invité
    Invité(e)
    Par défaut Problème Socket Android
    Bonjour,



    Je développe actuellement une application android avec des sockets et quand je la lance elle s'arrête.Cette application permet d'envoyer des commandes d'une Nexus 7 sous Android KitKat vers un boitier domotique (IPX 800) via le protocole M2M. L'application fonctionne très bien sous Android 2.2 mais pas sur 4.4.2.



    Voici le logCat qd je lance l'application :

    01-30 07:25:06.183: W/dalvikvm(995): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
    01-30 07:25:06.273: E/AndroidRuntime(995): FATAL EXCEPTION: main
    01-30 07:25:06.273: E/AndroidRuntime(995): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.domotique/com.android.domotique.Admin}: java.lang.NullPointerException
    01-30 07:25:06.273: E/AndroidRuntime(995): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
    01-30 07:25:06.273: E/AndroidRuntime(995): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
    01-30 07:25:06.273: E/AndroidRuntime(995): at android.app.ActivityThread.access$600(ActivityThread.java:141)
    01-30 07:25:06.273: E/AndroidRuntime(995): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
    01-30 07:25:06.273: E/AndroidRuntime(995): at android.os.Handler.dispatchMessage(Handler.java:99)
    01-30 07:25:06.273: E/AndroidRuntime(995): at android.os.Looper.loop(Looper.java:137)
    01-30 07:25:06.273: E/AndroidRuntime(995): at android.app.ActivityThread.main(ActivityThread.java:5041)
    01-30 07:25:06.273: E/AndroidRuntime(995): at java.lang.reflect.Method.invokeNative(Native Method)
    01-30 07:25:06.273: E/AndroidRuntime(995): at java.lang.reflect.Method.invoke(Method.java:511)
    01-30 07:25:06.273: E/AndroidRuntime(995): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
    01-30 07:25:06.273: E/AndroidRuntime(995): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
    01-30 07:25:06.273: E/AndroidRuntime(995): at dalvik.system.NativeStart.main(Native Method)
    01-30 07:25:06.273: E/AndroidRuntime(995): Caused by: java.lang.NullPointerException
    01-30 07:25:06.273: E/AndroidRuntime(995): at com.android.domotique.Admin.onCreate(Admin.java:117)
    01-30 07:25:06.273: E/AndroidRuntime(995): at android.app.Activity.performCreate(Activity.java:5104)
    01-30 07:25:06.273: E/AndroidRuntime(995): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
    01-30 07:25:06.273: E/AndroidRuntime(995): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
    01-30 07:25:06.273: E/AndroidRuntime(995): ... 11 more




    voici le code java de mon application :



    Code Java : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    package com.android.domotique;
     
     
    import java.io.BufferedReader;
     
    import java.io.BufferedWriter;
     
    import java.io.IOException;
     
    import java.io.InputStreamReader;
     
    import java.io.OutputStreamWriter;
     
    import java.io.PrintWriter;
     
    import java.net.Inet4Address;
     
    import java.net.InetAddress;
     
    import java.net.Socket;
     
    import java.net.UnknownHostException;
     
     
    import android.os.Bundle;
     
    import android.view.View;
     
    import android.widget.Button;
     
    import android.widget.ToggleButton;
     
     
    public class Admin extends MainActivity {
     
     
        private Button bPrecedent;
     
        private Button bSuivant;
     
        private ToggleButton Relai1;//Eclairage 1
     
        private ToggleButton Relai2;//Eclairage Ext
     
        private ToggleButton Relai3;//Eclairage Degagement
     
        private ToggleButton Relai4;//Portail
     
     
        String AdresseIP = "10.129.101.193";
     
        int Port = 9870;
     
        Socket SocketIPX;
     
        PrintWriter BuffW;
     
        BufferedReader BuffR;
     
     
        @Override
     
        protected void onCreate(Bundle savedInstanceState) {
     
            super.onCreate(savedInstanceState);
     
     
            bPrecedent = new Button(this);
     
            Relai1 = new ToggleButton(this);
     
            Relai2 = new ToggleButton(this);
     
            Relai3 = new ToggleButton(this);
     
            Relai4 = new ToggleButton(this);
     
     
            setContentView(R.layout.admin);
     
     
            bPrecedent = (Button) findViewById(R.id.Buttonpre);
     
            Relai1 = (ToggleButton) findViewById(R.id.toggleButton1);
     
            Relai2 = (ToggleButton) findViewById(R.id.toggleButton2);
     
            Relai3 = (ToggleButton) findViewById(R.id.toggleButton3);
     
            Relai4 = (ToggleButton) findViewById(R.id.toggleButton4);
     
     
            bPrecedent.setOnClickListener(new View.OnClickListener() {
     
     
                @Override
     
                public void onClick(View v) {
     
    // TODO Auto-generated method stub
     
                    finish();
     
     
                }
     
            });
     
     
            Relai1.setOnClickListener(new View.OnClickListener() {
     
     
                @Override
     
                public void onClick(View v) {
     
    // TODO Auto-generated method stub
     
                    Thread tTest = new Thread() {
     
                        public void run() {
     
                            if (Relai1.isChecked())
     
                                CommunicationIPX("Set11");
     
                            else
     
                                CommunicationIPX("Set10");
     
                        }
     
                    };
     
                    tTest.start();
     
     
                }
     
            });
     
     
            Relai2.setOnClickListener(new View.OnClickListener() {
     
     
                @Override
     
                public void onClick(View v) {
     
    // TODO Auto-generated method stub
     
                    if (Relai2.isChecked())
     
                        CommunicationIPX("Set21");
     
                    else
     
                        CommunicationIPX("Set20");
     
                }
     
            });
     
     
            Relai3.setOnClickListener(new View.OnClickListener() {
     
     
                @Override
     
                public void onClick(View v) {
     
    // TODO Auto-generated method stub
     
                    if (Relai3.isChecked())
     
                        CommunicationIPX("Set31");
     
                    else
     
                        CommunicationIPX("Set30");
     
                }
     
            });
     
     
            Relai4.setOnClickListener(new View.OnClickListener() {
     
     
                @Override
     
                public void onClick(View v) {
     
    // TODO Auto-generated method stub
     
                    if (Relai1.isChecked())
     
                        CommunicationIPX("Set41");
     
                    else
     
                        CommunicationIPX("Set40");
     
                }
     
            });
     
     
            bSuivant.setOnClickListener(new View.OnClickListener() {
     
     
                @Override
     
                public void onClick(View v) {
     
    // TODO Auto-generated method stub
     
     
                }
     
            });
     
     
            try {
     
                InetAddress serverAddr = Inet4Address.getByName(AdresseIP);
     
                SocketIPX = new Socket(serverAddr, Port);
     
            } catch (UnknownHostException e1) {
     
                e1.printStackTrace();
     
            } catch (IOException e1) {
     
                e1.printStackTrace();
     
            }
     
     
            //ouverture du buffeur pour envoyer dans le socket qu'on vient de créer
     
            try {
     
                BuffW = new PrintWriter(new BufferedWriter(new OutputStreamWriter(SocketIPX.getOutputStream())), true);
     
            } catch (IOException e) {
     
                // TODO Auto-generated catch block
     
                e.printStackTrace();
     
            }
     
     
            //idem pour recevoir
     
            try {
     
                BuffR = new BufferedReader(new InputStreamReader(SocketIPX.getInputStream()));
     
            } catch (IOException e) {
     
                // TODO Auto-generated catch block
     
                e.printStackTrace();
     
            }
     
     
        }
     
        public String CommunicationIPX(String Ordre) {
     
     
            String sClientMsg = "";
     
     
            //envoie l'ordre passé en argument de la fonction en l'état (si c'est un truc qui n'existe pas, l'IPX nous le dira)
     
            BuffW.println(Ordre);
     
            BuffW.flush();
     
     
            //lire la réponse
     
            try {
     
                sClientMsg = BuffR.readLine();
     
            } catch (IOException e) {
     
                // TODO Auto-generated catch block
     
                e.printStackTrace();
     
            }
     
     
            //return la réponse de l'IPX
     
            return sClientMsg;
     
        }//fin Communication IPX
     
     
    }
    Dernière modification par Hizin ; 30/01/2014 à 10h46. Motif: Merci d'utiliser la balise [code] (#) + indentation du code.

  2. #2
    Modérateur
    Avatar de Hizin
    Homme Profil pro
    Développeur mobile
    Inscrit en
    Février 2010
    Messages
    2 180
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France

    Informations professionnelles :
    Activité : Développeur mobile

    Informations forums :
    Inscription : Février 2010
    Messages : 2 180
    Points : 5 072
    Points
    5 072
    Par défaut
    Premièrement : pense à bien indenter ton code. C'est un raccourci sous la plupart des IDE et éditeur de texte. Cela le rend plus lisible et facilite le boulot de relecture pour tout le monde.

    Deuxièmement : Les conventions Java.
    • Classes en UpperCamelCase : débutent par une majuscule, suivi de minuscules, la première lettre de chaque mot est une majuscule.
    • Variables et méthodes en lowerCamelCase : débutent par une minuscule, première lettre de chaque mot en majuscule.
    • Constantes : écrites en majuscules avec des tirets bas en séparateur (seul endroit où ceux-ci sont autorisés).

    Les respecter aide aussi à la relecture.

    Au niveau de ton erreur, tu as une NullPointerException (NPE), l'exception la plus commune en Java. Elle indique que tu invoques une méthodes sur un objet null, ou que tu passes un objet null en paramètre d'une méthode qui ne le supporte pas.

    Caused by: java.lang.NullPointerException
    at com.android.domotique.Admin.onCreate(Admin.java:117)
    NPE dans le package com.android.domotique, classe Admin, méthode onCreate. L'erreur est levée dans le fichier Admin.java, ligne 117.

    Avec l'extrait de code que tu as fournis, la correspondance des lignes est KO.

    Outre ça, tu as beaucoup d'incohérences et de soucis dans ton code.

    Code Java : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
            bPrecedent = new Button(this);
     
            [...]
     
            setContentView(R.layout.admin);
     
             [...]
     
            bPrecedent = (Button) findViewById(R.id.Buttonpre);

    Tu initialises bPrecedent, tu fais un setContentView, et tu le remplaces. Multiplié par 5 puisque tu le fais sur chaque variable. Ce qui est avant setContentView est inutile.

    Code Java : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
            try {
     
                InetAddress serverAddr = Inet4Address.getByName(AdresseIP);
     
                SocketIPX = new Socket(serverAddr, Port);
     
            } catch (UnknownHostException e1) {
     
                e1.printStackTrace();
     
            } catch (IOException e1) {
     
                e1.printStackTrace();
     
            }
     
     
            //ouverture du buffeur pour envoyer dans le socket qu'on vient de créer
     
            try {
     
                BuffW = new PrintWriter(new BufferedWriter(new OutputStreamWriter(SocketIPX.getOutputStream())), true);
     
            } catch (IOException e) {
     
                // TODO Auto-generated catch block
     
                e.printStackTrace();
     
            }
     
     
            //idem pour recevoir
     
            try {
     
                BuffR = new BufferedReader(new InputStreamReader(SocketIPX.getInputStream()));
     
            } catch (IOException e) {
     
                // TODO Auto-generated catch block
     
                e.printStackTrace();
     
            }

    Tout ce code-là te fera obtenir une jolie NetworkOnMainThreadExpection, et il y a de bonnes chances que ce soit la source de ta NPE, la gestion des erreurs étant calamiteuse.

    Première chose : pas de printStackTrace sur Android. On ne sait pas où stderr sort. Préfère utiliser Log.e(TAG, message, e); où TAG te permet de filtrer facilement dans le LogCat, message te permet de décrire le log et e est l'exception.

    Pourquoi est-ce calamiteux ?

    Code Java : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
            try {
     
                InetAddress serverAddr = Inet4Address.getByName(AdresseIP);
     
                SocketIPX = new Socket(serverAddr, Port);
     
            } catch (UnknownHostException e1) {
     
                e1.printStackTrace();
     
            } catch (IOException e1) {
     
                e1.printStackTrace();
     
            }
     
     
            //ouverture du buffeur pour envoyer dans le socket qu'on vient de créer
     
            try {
     
                BuffW = new PrintWriter(new BufferedWriter(new OutputStreamWriter(SocketIPX.getOutputStream())), true);
     
            } catch (IOException e) {
     
                // TODO Auto-generated catch block
     
                e.printStackTrace();
     
            }

    Si tu as une exception dans le premier bloc, SocketIPX est null, mais c'est pas grave, on continue !
    Donc quand tu l'utilises ensuite => NPE !

    Un truc un peu mieux serait :
    Code Java : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    try {
     
                InetAddress serverAddr = Inet4Address.getByName(AdresseIP);
     
                SocketIPX = new Socket(serverAddr, Port);
     
                BuffW = new PrintWriter(new BufferedWriter(new OutputStreamWriter(SocketIPX.getOutputStream())), true);
     
                BuffR = new BufferedReader(new InputStreamReader(SocketIPX.getInputStream()));
     
            } catch (UnknownHostException e1) {
     
                Log.e("IPX Connection", "problem resolving host", e1);
     
            } catch (IOException e1) {
     
                Log.e("IPX Connection", "issue while reading", e1);
     
            }

    A coté de ça... la NetworkOnMainThreadException, qui va se révéler juste après.
    C'est une très mauvaise pratique que de faire des opérations longues dans le Thread graphique. Il faut faire en sorte que l'interface ne soit jamais gelée. Android, depuis HoneyComb (3.0) sanctionne chaque appel réseau sur le thread graphique par l'exception bien nommée : NetworkOnMainThreadException.

    Chaque opération potentiellement longue (dont font parti les appels réseaux) doivent être asynchrones. La classe AsyncTask permet de les réaliser assez facilement.
    C'est Android, PAS Androïd, ou Androïde didiou !
    Le premier est un OS, le second est la mauvaise orthographe du troisième, un mot français désignant un robot à forme humaine.

    Membre du comité contre la phrase "ça marche PAS" en titre et/ou explication de problème.

    N'oubliez pas de consulter les FAQ Android et les cours et tutoriels Android

  3. #3
    Invité
    Invité(e)
    Par défaut
    Merci pour votre réponse rapide. Je ne comprends pas pourquoi j'ai encore une NPE.

    LogCat :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    01-30 10:34:49.082: E/AndroidRuntime(1547): FATAL EXCEPTION: main
    01-30 10:34:49.082: E/AndroidRuntime(1547): java.lang.NullPointerException
    01-30 10:34:49.082: E/AndroidRuntime(1547): 	at com.android.domotique.Ipx800.Communication(Ipx800.java:57)
    01-30 10:34:49.082: E/AndroidRuntime(1547): 	at com.android.domotique.Admin$2.onClick(Admin.java:47)
    01-30 10:34:49.082: E/AndroidRuntime(1547): 	at android.view.View.performClick(View.java:4204)
    01-30 10:34:49.082: E/AndroidRuntime(1547): 	at android.widget.CompoundButton.performClick(CompoundButton.java:100)
    01-30 10:34:49.082: E/AndroidRuntime(1547): 	at android.view.View$PerformClick.run(View.java:17355)
    01-30 10:34:49.082: E/AndroidRuntime(1547): 	at android.os.Handler.handleCallback(Handler.java:725)
    01-30 10:34:49.082: E/AndroidRuntime(1547): 	at android.os.Handler.dispatchMessage(Handler.java:92)
    01-30 10:34:49.082: E/AndroidRuntime(1547): 	at android.os.Looper.loop(Looper.java:137)
    01-30 10:34:49.082: E/AndroidRuntime(1547): 	at android.app.ActivityThread.main(ActivityThread.java:5041)
    01-30 10:34:49.082: E/AndroidRuntime(1547): 	at java.lang.reflect.Method.invokeNative(Native Method)
    01-30 10:34:49.082: E/AndroidRuntime(1547): 	at java.lang.reflect.Method.invoke(Method.java:511)
    01-30 10:34:49.082: E/AndroidRuntime(1547): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
    01-30 10:34:49.082: E/AndroidRuntime(1547): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
    01-30 10:34:49.082: E/AndroidRuntime(1547): 	at dalvik.system.NativeStart.main(Native Method)
    Code du main, Admin.java :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    package com.android.domotique;
     
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.ToggleButton;
     
    public class Admin extends MainActivity {
     
    	private Button bPrecedent;
    	private ToggleButton relaiEclairage1;//Eclairage 1
    	private ToggleButton relaiEclairageExt;//Eclairage Ext
    	private ToggleButton relaiEclairageDeg;//Eclairage Degagement
    	private ToggleButton relaiPortail;//Portail
    	private ToggleButton relaiChauffage;//Chauffage
     
    	@Override
    	protected void onCreate(Bundle savedInstanceState) {
    			super.onCreate(savedInstanceState);
     
    		setContentView(R.layout.admin);
     
    		bPrecedent = (Button)findViewById(R.id.Buttonpre);
            relaiEclairage1 = (ToggleButton)findViewById(R.id.toggleButton1);
            relaiEclairageExt = (ToggleButton)findViewById(R.id.toggleButton2);
            relaiEclairageDeg = (ToggleButton)findViewById(R.id.toggleButton3);
            relaiPortail = (ToggleButton)findViewById(R.id.toggleButton4);
            relaiChauffage = (ToggleButton)findViewById(R.id.toggleButton5);
     
            bPrecedent.setOnClickListener(new View.OnClickListener() {
     
    			@Override
    			public void onClick(View v) {
    				// TODO Auto-generated method stub
    				finish();
     
    			}
    		});
     
            relaiEclairage1.setOnClickListener(new View.OnClickListener() {
     
    			@Override
    			public void onClick(View v) {
    				// TODO Auto-generated method stub
    				Ipx800 essaiIpx = new Ipx800();
    				essaiIpx.execute();
    				essaiIpx.communicationIpx("Set41");
    			}
    		});
     
            relaiEclairageExt.setOnClickListener(new View.OnClickListener() {
     
    			@Override
    			public void onClick(View v) {
    				// TODO Auto-generated method stub
     
    			}
    		});
     
            relaiEclairageDeg.setOnClickListener(new View.OnClickListener() {
     
    			@Override
    			public void onClick(View v) {
    				// TODO Auto-generated method stub
     
    			}
    		});
     
            relaiPortail.setOnClickListener(new View.OnClickListener() {
     
    			@Override
    			public void onClick(View v) {
    				// TODO Auto-generated method stub
     
    			}
    		});
     
            relaiChauffage.setOnClickListener(new View.OnClickListener() {
     
    			@Override
    			public void onClick(View v) {
    				// TODO Auto-generated method stub
     
    			}
    		});
     
    	} 
     
     
    }
    J'ai crée une classe pour utiliser AsyncTask, Ipx800.java

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    package com.android.domotique;
     
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.io.PrintWriter;
    import java.net.Inet4Address;
    import java.net.InetAddress;
    import java.net.Socket;
    import java.net.UnknownHostException;
     
    import android.os.AsyncTask;
    import android.util.Log;
     
    public class Ipx800 extends AsyncTask<Void, Void, Void> {
     
    	String adresseIP = "10.129.101.193";
    	int portIpx = 9870;
    	Socket socketIpx;
    	PrintWriter buffW ;
    	BufferedReader buffR ; 
     
    	@Override
    	protected Void doInBackground(Void... params) {
    		// TODO Auto-generated method stub
     
    			try {
     
    	            InetAddress serverAddr = Inet4Address.getByName(adresseIP);
     
    	            socketIpx = new Socket(serverAddr, portIpx);
     
    	            buffW = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socketIpx.getOutputStream())), true);
     
    	            buffR = new BufferedReader(new InputStreamReader(socketIpx.getInputStream()));
     
    	        } catch (UnknownHostException e1) {
     
    	            Log.e("IPX Connection", "problem resolving host", e1);
     
    	        } catch (IOException e1) {
     
    	            Log.e("IPX Connection", "issue while reading", e1);
     
    	        }
    		return null;
    	}
     
    	public String communicationIpx(String Ordre){
     
    		     String sClientMsg = "";
     
    		     //envoie l'ordre passé en argument de la fonction en l'état (si c'est un truc qui n'existe pas, l'IPX nous le dira)
    		     Log.e("Buffer", "Erreru Buf1");
    		     buffW.println(Ordre);
    		     Log.e("Buffer", "Erreru Buf2");
    		     buffW.flush();
    		     Log.e("Buffer", "Erreru Buf3");
     
    		     //lire la réponse
    		      try {
    		       sClientMsg = buffR.readLine();
    		    } catch (IOException e) {
    		       // TODO Auto-generated catch block
    		    	 Log.e("IPX Communicationn", "problem resolving host", e);
    		    }
     
    		      //return la réponse de l'IPX
    		     return sClientMsg;
    		  }//fin Communication IPX*/
    }
    L'erreur NPE semble être au niveau de la ligne buffW.printIn(Ordre) mais je ne comprends pas le problème ?

  4. #4
    Modérateur
    Avatar de Hizin
    Homme Profil pro
    Développeur mobile
    Inscrit en
    Février 2010
    Messages
    2 180
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France

    Informations professionnelles :
    Activité : Développeur mobile

    Informations forums :
    Inscription : Février 2010
    Messages : 2 180
    Points : 5 072
    Points
    5 072
    Par défaut
    Les paramètres suivent la même convention d'écriture que les variables :p

    Si c'est bien sur cette ligne, soit Ordre est null, soit buffW l'est.
    Tu n'as pas d'autres erreurs dans ton LogCat par hasard ?
    C'est Android, PAS Androïd, ou Androïde didiou !
    Le premier est un OS, le second est la mauvaise orthographe du troisième, un mot français désignant un robot à forme humaine.

    Membre du comité contre la phrase "ça marche PAS" en titre et/ou explication de problème.

    N'oubliez pas de consulter les FAQ Android et les cours et tutoriels Android

  5. #5
    Membre habitué
    Profil pro
    Inscrit en
    Décembre 2009
    Messages
    141
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2009
    Messages : 141
    Points : 177
    Points
    177
    Par défaut
    A mon avis, c'est plus l'appel

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    essaiIpx.communicationIpx("Set41");
    en dehors de l'async task (qui doit être finie) et donc les références tombent à null (ce que suggère Hizin avec buffW).

  6. #6
    Invité
    Invité(e)
    Par défaut
    Merci pour vos réponses, je vais tester avec ce que vous m'avez dit

  7. #7
    Invité
    Invité(e)
    Par défaut
    Bonjour,

    Pendant ce WE, j'ai codé l'AsyncTask, mais je ne comprends pas l'erreur que cela me génère.

    Code du main, Admin.java :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    package com.android.domotique;
     
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.Toast;
    import android.widget.ToggleButton;
     
    public class Admin extends MainActivity {
     
    	private Button bPrecedent;
    	private ToggleButton relaiEclairage1;//Eclairage 1
    	private ToggleButton relaiEclairageExt;//Eclairage Ext
    	private ToggleButton relaiEclairageDeg;//Eclairage Degagement
    	private ToggleButton relaiPortail;//Portail
    	private ToggleButton relaiChauffage;//Chauffage
     
    	@Override
    	protected void onCreate(Bundle savedInstanceState) {
    			super.onCreate(savedInstanceState);
     
    		setContentView(R.layout.admin);
     
    		bPrecedent = (Button)findViewById(R.id.Buttonpre);
            relaiEclairage1 = (ToggleButton)findViewById(R.id.toggleButton1);
            relaiEclairageExt = (ToggleButton)findViewById(R.id.toggleButton2);
            relaiEclairageDeg = (ToggleButton)findViewById(R.id.toggleButton3);
            relaiPortail = (ToggleButton)findViewById(R.id.toggleButton4);
            relaiChauffage = (ToggleButton)findViewById(R.id.toggleButton5);
     
            bPrecedent.setOnClickListener(new View.OnClickListener() {
     
    			@Override
    			public void onClick(View v) {
    				// TODO Auto-generated method stub
    				finish();
     
    			}
    		});
     
            relaiEclairage1.setOnClickListener(new View.OnClickListener() {
     
    			@Override
    			public void onClick(View v) {
    				// TODO Auto-generated method stub
    				Ipx800 essaiIpx = new Ipx800();
    				essaiIpx.execute("Set41");
     
    			}
    		});
     
            relaiEclairageExt.setOnClickListener(new View.OnClickListener() {
     
    			@Override
    			public void onClick(View v) {
    				// TODO Auto-generated method stub
     
    			}
    		});
     
            relaiEclairageDeg.setOnClickListener(new View.OnClickListener() {
     
    			@Override
    			public void onClick(View v) {
    				// TODO Auto-generated method stub
     
    			}
    		});
     
            relaiPortail.setOnClickListener(new View.OnClickListener() {
     
    			@Override
    			public void onClick(View v) {
    				// TODO Auto-generated method stub
     
    			}
    		});
     
            relaiChauffage.setOnClickListener(new View.OnClickListener() {
     
    			@Override
    			public void onClick(View v) {
    				// TODO Auto-generated method stub
     
    			}
    		});
     
    	} 
     
     
    }
    Code de la classe, Ipx800.java :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    package com.android.domotique;
     
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.io.PrintWriter;
    import java.net.Inet4Address;
    import java.net.InetAddress;
    import java.net.Socket;
    import java.net.UnknownHostException;
     
    import android.os.AsyncTask;
    import android.util.Log;
     
    public class Ipx800 extends AsyncTask<String, String,String> {
     
    	String adresseIP = "10.129.101.193";
    	int portIpx = 9870;
    	Socket socketIpx;
    	PrintWriter buffW ;
    	BufferedReader buffR ; 
     
    	protected String doInBackground(String... ordre) {
    		// TODO Auto-generated method stub
     
    			try {
     
    	            InetAddress serverAddr = Inet4Address.getByName(adresseIP);
     
    	            socketIpx = new Socket(serverAddr, portIpx);
     
    	            buffW = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socketIpx.getOutputStream())), true);
     
    	            buffR = new BufferedReader(new InputStreamReader(socketIpx.getInputStream()));
     
    	        } catch (UnknownHostException e1) {
     
    	            Log.e("IPX Connection", "problem resolving host", e1);
     
    	        } catch (IOException e1) {
     
    	            Log.e("IPX Connection", "issue while reading", e1);
     
    	        }
     
    			String sClientMsg = "";
     
    		     //envoie l'ordre passé en argument de la fonction en l'état (si c'est un truc qui n'existe pas, l'IPX nous le dira)
    		     Log.e("Buffer", "Erreru Buf1");
    		     buffW.println(ordre);
    		     Log.e("Buffer", "Erreru Buf2");
    		     buffW.flush();
    		     Log.e("Buffer", "Erreru Buf3");
     
    		     //lire la réponse
    		      try {
    		       sClientMsg = buffR.readLine();
    		    } catch (IOException e) {
    		       // TODO Auto-generated catch block
    		    	 Log.e("IPX Communicationn", "problem resolving host", e);
    		    }
    			return sClientMsg;
     
     
    	}
     
     
     
     
    }
    Et voici le LogCat :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    02-03 09:55:19.747: E/AndroidRuntime(1617): FATAL EXCEPTION: main
    02-03 09:55:19.747: E/AndroidRuntime(1617): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.domotique/com.android.domotique.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.app.ActivityThread.access$600(ActivityThread.java:141)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.os.Handler.dispatchMessage(Handler.java:99)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.os.Looper.loop(Looper.java:137)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.app.ActivityThread.main(ActivityThread.java:5041)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at java.lang.reflect.Method.invokeNative(Native Method)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at java.lang.reflect.Method.invoke(Method.java:511)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at dalvik.system.NativeStart.main(Native Method)
    02-03 09:55:19.747: E/AndroidRuntime(1617): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.view.LayoutInflater.createView(LayoutInflater.java:613)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.app.Activity.setContentView(Activity.java:1881)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at com.android.domotique.MainActivity.onCreate(MainActivity.java:28)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.app.Activity.performCreate(Activity.java:5104)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	... 11 more
    02-03 09:55:19.747: E/AndroidRuntime(1617): Caused by: java.lang.reflect.InvocationTargetException
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at java.lang.reflect.Constructor.constructNative(Native Method)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.view.LayoutInflater.createView(LayoutInflater.java:587)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	... 23 more
    02-03 09:55:19.747: E/AndroidRuntime(1617): Caused by: java.lang.OutOfMemoryError
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.content.res.Resources.loadDrawable(Resources.java:1965)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.view.View.<init>(View.java:3330)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.view.ViewGroup.<init>(ViewGroup.java:431)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.widget.LinearLayout.<init>(LinearLayout.java:176)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	at android.widget.LinearLayout.<init>(LinearLayout.java:172)
    02-03 09:55:19.747: E/AndroidRuntime(1617): 	... 26 more
    Merci de votre aide

  8. #8
    Modérateur
    Avatar de Hizin
    Homme Profil pro
    Développeur mobile
    Inscrit en
    Février 2010
    Messages
    2 180
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France

    Informations professionnelles :
    Activité : Développeur mobile

    Informations forums :
    Inscription : Février 2010
    Messages : 2 180
    Points : 5 072
    Points
    5 072
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
    Manifestement, tu as un problème dans ton layout "admin", il n'arrive pas à trouver la classe.
    Peux-tu nous le montrer (ou le corriger directement, pour le coup) s'il te plaît ?

    EDIT : si les lignes correspondent bien, un des ToggleButton serait mal écrit, ou tu es sur une version d'Android ne les supportant pas.

    EDIT bis : dérouler tout le LogCat, c'est mieux
    Le tout serait provoqué par une OOM ? Que tentes-tu de charger ? A priori, tu as une cascade d'erreur dont la source serait une trop grosse ressource.
    C'est Android, PAS Androïd, ou Androïde didiou !
    Le premier est un OS, le second est la mauvaise orthographe du troisième, un mot français désignant un robot à forme humaine.

    Membre du comité contre la phrase "ça marche PAS" en titre et/ou explication de problème.

    N'oubliez pas de consulter les FAQ Android et les cours et tutoriels Android

  9. #9
    Invité
    Invité(e)
    Par défaut
    Voici mon admin.xml :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    <?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="vertical" >
     
        <LinearLayout
            android:id="@+id/linearLayout1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >
     
            <Button
                android:id="@+id/Buttonpre"
                android:layout_width="180dp"
                android:layout_height="wrap_content"
                android:layout_gravity="left"
                android:layout_weight="1"
                android:text="@string/buttonpre" />
        </LinearLayout>
     
        <LinearLayout
            android:id="@+id/linearLayout2"
            android:layout_width="match_parent"
            android:layout_height="450dp"
            android:layout_marginBottom="10dp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="20dp"
            android:background="@drawable/planmaison"
            android:orientation="horizontal" >
     
        </LinearLayout>
     
        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:stretchColumns="1" >
     
            <TextView
                android:layout_gravity="center"
                android:gravity="center"
                android:text="@string/textviewtable1" />
     
            <TableRow
                android:id="@+id/tableRow1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" >
     
                <TextView
                    android:layout_gravity="center"
                    android:layout_weight="1"
                    android:text="@string/textviewtable2" />
     
                <ToggleButton
                    android:id="@+id/toggleButton1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="ToggleButton1"
                    android:textOff="Eteint"
                    android:textOn="Allumé" />
            </TableRow>
     
            <TableRow
                android:id="@+id/tableRow2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" >
     
                <TextView
                    android:layout_gravity="center"
                    android:text="@string/textviewtable3" />
     
                <ToggleButton
                    android:id="@+id/toggleButton2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="ToggleButton2"
                    android:textOff="Eteint"
                    android:textOn="Allumé" />
            </TableRow>
     
            <TableRow
                android:id="@+id/tableRow3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" >
     
                <TextView
                    android:layout_gravity="center"
                    android:text="@string/textviewtable4" />
     
                <ToggleButton
                    android:id="@+id/toggleButton3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="ToggleButton3"
                    android:textOff="Eteint"
                    android:textOn="Allumé" />
            </TableRow>
     
            <TableRow
                android:id="@+id/tableRow4"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" >
     
                <TextView
                    android:layout_gravity="center"
                    android:text="@string/textviewtable5" />
     
                <ToggleButton
                    android:id="@+id/toggleButton4"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="ToggleButton4"
                    android:textOff="Fermé"
                    android:textOn="Ouvert" />
            </TableRow>
     
            <TableRow
                android:id="@+id/tableRow5"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" >
     
                <TextView
                    android:layout_gravity="center"
                    android:text="@string/textviewtable6" />
     
                <ToggleButton
                    android:id="@+id/toggleButton5"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="ToggleButton5"
                    android:textOff="Fermé"
                    android:textOn="Ouvert" />
            </TableRow>
        </TableLayout>
     
    </LinearLayout>
    Et voici le logcat complet :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    02-03 11:07:42.926: D/AndroidRuntime(1294): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
    02-03 11:07:42.946: D/AndroidRuntime(1294): CheckJNI is ON
    02-03 11:07:43.066: D/dalvikvm(1294): Trying to load lib libjavacore.so 0x0
    02-03 11:07:43.096: D/dalvikvm(1294): Added shared lib libjavacore.so 0x0
    02-03 11:07:43.136: D/dalvikvm(1294): Trying to load lib libnativehelper.so 0x0
    02-03 11:07:43.136: D/dalvikvm(1294): Added shared lib libnativehelper.so 0x0
    02-03 11:07:43.136: D/dalvikvm(1294): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
    02-03 11:07:43.466: D/dalvikvm(1294): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
    02-03 11:07:44.446: E/memtrack(1294): Couldn't load memtrack module (No such file or directory)
    02-03 11:07:44.456: E/android.os.Debug(1294): failed to load memtrack module: -2
    02-03 11:07:44.906: D/AndroidRuntime(1294): Calling main entry com.android.commands.pm.Pm
    02-03 11:07:45.016: D/AndroidRuntime(1294): Shutting down VM
    02-03 11:07:45.016: D/dalvikvm(1294): Debugger has detached; object registry had 1 entries
    02-03 11:07:45.996: D/AndroidRuntime(1305): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
    02-03 11:07:46.006: D/AndroidRuntime(1305): CheckJNI is ON
    02-03 11:07:46.166: D/dalvikvm(1305): Trying to load lib libjavacore.so 0x0
    02-03 11:07:46.176: D/dalvikvm(1305): Added shared lib libjavacore.so 0x0
    02-03 11:07:46.226: D/dalvikvm(1305): Trying to load lib libnativehelper.so 0x0
    02-03 11:07:46.226: D/dalvikvm(1305): Added shared lib libnativehelper.so 0x0
    02-03 11:07:46.226: D/dalvikvm(1305): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
    02-03 11:07:46.566: D/dalvikvm(1305): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
    02-03 11:07:47.516: E/memtrack(1305): Couldn't load memtrack module (No such file or directory)
    02-03 11:07:47.516: E/android.os.Debug(1305): failed to load memtrack module: -2
    02-03 11:07:47.976: D/AndroidRuntime(1305): Calling main entry com.android.commands.am.Am
    02-03 11:07:48.106: I/ActivityManager(371): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.domotique/.MainActivity} from pid 1305
    02-03 11:07:48.446: D/gralloc(50): Registering a buffer in the process that created it. This may cause memory ordering problems.
    02-03 11:07:48.456: E/libEGL(50): called unimplemented OpenGL ES API
    02-03 11:07:48.456: E/libEGL(50): called unimplemented OpenGL ES API
    02-03 11:07:48.456: E/libEGL(50): called unimplemented OpenGL ES API
    02-03 11:07:48.456: E/libEGL(50): called unimplemented OpenGL ES API
    02-03 11:07:48.456: E/SurfaceFlinger(50): glCheckFramebufferStatusOES error 253896921
    02-03 11:07:48.456: E/SurfaceFlinger(50): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
    02-03 11:07:48.456: E/libEGL(50): called unimplemented OpenGL ES API
    02-03 11:07:48.456: E/libEGL(50): called unimplemented OpenGL ES API
    02-03 11:07:48.506: W/WindowManager(371): Screenshot failure taking screenshot for (343x201) to layer 21005
    02-03 11:07:48.566: D/AndroidRuntime(1305): Shutting down VM
    02-03 11:07:48.626: D/dalvikvm(1305): Debugger has detached; object registry had 1 entries
    02-03 11:07:48.646: D/dalvikvm(1316): Not late-enabling CheckJNI (already on)
    02-03 11:07:48.676: I/ActivityManager(371): Start proc com.android.domotique for activity com.android.domotique/.MainActivity: pid=1316 uid=10052 gids={50052, 3003}
    02-03 11:07:49.806: I/Choreographer(371): Skipped 49 frames!  The application may be doing too much work on its main thread.
    02-03 11:07:58.156: D/dalvikvm(1316): GC_FOR_ALLOC freed 53K, 5% free 2787K/2908K, paused 47ms, total 50ms
    02-03 11:07:58.176: I/dalvikvm-heap(1316): Forcing collection of SoftReferences for 14204944-byte allocation
    02-03 11:07:58.236: D/dalvikvm(1316): GC_BEFORE_OOM freed 11K, 5% free 2775K/2908K, paused 65ms, total 67ms
    02-03 11:07:58.236: E/dalvikvm-heap(1316): Out of memory on a 14204944-byte allocation.
    02-03 11:07:58.236: I/dalvikvm(1316): "main" prio=5 tid=1 RUNNABLE
    02-03 11:07:58.236: I/dalvikvm(1316):   | group="main" sCount=0 dsCount=0 obj=0xb4af5ca8 self=0xb718b380
    02-03 11:07:58.236: I/dalvikvm(1316):   | sysTid=1316 nice=0 sched=0/0 cgrp=apps handle=-1224867500
    02-03 11:07:58.236: I/dalvikvm(1316):   | state=R schedstat=( 8220000000 1090000000 164 ) utm=688 stm=134 core=0
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:587)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:422)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:840)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.content.res.Resources.loadDrawable(Resources.java:2110)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.view.View.<init>(View.java:3554)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.view.ViewGroup.<init>(ViewGroup.java:470)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.widget.LinearLayout.<init>(LinearLayout.java:176)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.widget.LinearLayout.<init>(LinearLayout.java:172)
    02-03 11:07:58.246: I/dalvikvm(1316):   at java.lang.reflect.Constructor.constructNative(Native Method)
    02-03 11:07:58.246: I/dalvikvm(1316):   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.view.LayoutInflater.createView(LayoutInflater.java:594)
    02-03 11:07:58.246: I/dalvikvm(1316):   at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.view.LayoutInflater.inflate(LayoutInflater.java:469)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
    02-03 11:07:58.246: I/dalvikvm(1316):   at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.app.Activity.setContentView(Activity.java:1929)
    02-03 11:07:58.246: I/dalvikvm(1316):   at com.android.domotique.MainActivity.onCreate(MainActivity.java:28)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.app.Activity.performCreate(Activity.java:5231)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.app.ActivityThread.access$800(ActivityThread.java:135)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.os.Handler.dispatchMessage(Handler.java:102)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.os.Looper.loop(Looper.java:136)
    02-03 11:07:58.246: I/dalvikvm(1316):   at android.app.ActivityThread.main(ActivityThread.java:5017)
    02-03 11:07:58.246: I/dalvikvm(1316):   at java.lang.reflect.Method.invokeNative(Native Method)
    02-03 11:07:58.246: I/dalvikvm(1316):   at java.lang.reflect.Method.invoke(Method.java:515)
    02-03 11:07:58.246: I/dalvikvm(1316):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
    02-03 11:07:58.246: I/dalvikvm(1316):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
    02-03 11:07:58.246: I/dalvikvm(1316):   at dalvik.system.NativeStart.main(Native Method)
    02-03 11:07:58.276: D/skia(1316): --- allocation failed for scaled bitmap
    02-03 11:07:58.336: D/AndroidRuntime(1316): Shutting down VM
    02-03 11:07:58.336: W/dalvikvm(1316): threadid=1: thread exiting with uncaught exception (group=0xb4af4ba8)
    02-03 11:07:58.396: E/AndroidRuntime(1316): FATAL EXCEPTION: main
    02-03 11:07:58.396: E/AndroidRuntime(1316): Process: com.android.domotique, PID: 1316
    02-03 11:07:58.396: E/AndroidRuntime(1316): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.domotique/com.android.domotique.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.app.ActivityThread.access$800(ActivityThread.java:135)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.os.Handler.dispatchMessage(Handler.java:102)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.os.Looper.loop(Looper.java:136)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.app.ActivityThread.main(ActivityThread.java:5017)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at java.lang.reflect.Method.invokeNative(Native Method)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at java.lang.reflect.Method.invoke(Method.java:515)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at dalvik.system.NativeStart.main(Native Method)
    02-03 11:07:58.396: E/AndroidRuntime(1316): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.view.LayoutInflater.createView(LayoutInflater.java:620)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:469)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.app.Activity.setContentView(Activity.java:1929)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at com.android.domotique.MainActivity.onCreate(MainActivity.java:28)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.app.Activity.performCreate(Activity.java:5231)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	... 11 more
    02-03 11:07:58.396: E/AndroidRuntime(1316): Caused by: java.lang.reflect.InvocationTargetException
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at java.lang.reflect.Constructor.constructNative(Native Method)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.view.LayoutInflater.createView(LayoutInflater.java:594)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	... 23 more
    02-03 11:07:58.396: E/AndroidRuntime(1316): Caused by: java.lang.OutOfMemoryError
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:587)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:422)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:840)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.content.res.Resources.loadDrawable(Resources.java:2110)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.view.View.<init>(View.java:3554)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.view.ViewGroup.<init>(ViewGroup.java:470)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.widget.LinearLayout.<init>(LinearLayout.java:176)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	at android.widget.LinearLayout.<init>(LinearLayout.java:172)
    02-03 11:07:58.396: E/AndroidRuntime(1316): 	... 26 more
    02-03 11:07:58.426: W/ActivityManager(371):   Force finishing activity com.android.domotique/.MainActivity
    02-03 11:07:58.896: E/WindowManager(371): Starting window AppWindowToken{b572f5b8 token=Token{b5437fa0 ActivityRecord{b5437e40 u0 com.android.domotique/.MainActivity t5}}} timed out
    02-03 11:07:59.016: I/WindowManager(371): Screenshot max retries 4 of Token{b5437fa0 ActivityRecord{b5437e40 u0 com.android.domotique/.MainActivity t5 f}} appWin=Window{b5222f38 u0 Starting com.android.domotique} drawState=0
    02-03 11:07:59.016: W/WindowManager(371): Screenshot failure taking screenshot for (1024x600) to layer 21010
    02-03 11:08:00.236: D/dalvikvm(371): GC_FOR_ALLOC freed 803K, 51% free 6271K/12668K, paused 223ms, total 232ms
    02-03 11:08:00.256: W/ActivityManager(371): Activity pause timeout for ActivityRecord{b5437e40 u0 com.android.domotique/.MainActivity t5 f}
    02-03 11:08:01.586: I/Process(1316): Sending signal. PID: 1316 SIG: 9
    02-03 11:08:01.686: E/SoundPool(371): error loading /system/media/audio/ui/Effect_Tick.ogg
    02-03 11:08:01.686: W/AudioService(371): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
    02-03 11:08:01.686: E/SoundPool(371): error loading /system/media/audio/ui/Effect_Tick.ogg
    02-03 11:08:01.686: W/AudioService(371): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
    02-03 11:08:01.686: E/SoundPool(371): error loading /system/media/audio/ui/Effect_Tick.ogg
    02-03 11:08:01.686: W/AudioService(371): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
    02-03 11:08:01.686: E/SoundPool(371): error loading /system/media/audio/ui/Effect_Tick.ogg
    02-03 11:08:01.686: W/AudioService(371): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
    02-03 11:08:01.686: E/SoundPool(371): error loading /system/media/audio/ui/Effect_Tick.ogg
    02-03 11:08:01.686: W/AudioService(371): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
    02-03 11:08:01.706: E/SoundPool(371): error loading /system/media/audio/ui/KeypressStandard.ogg
    02-03 11:08:01.706: W/AudioService(371): Soundpool could not load file: /system/media/audio/ui/KeypressStandard.ogg
    02-03 11:08:01.706: E/SoundPool(371): error loading /system/media/audio/ui/KeypressSpacebar.ogg
    02-03 11:08:01.706: W/AudioService(371): Soundpool could not load file: /system/media/audio/ui/KeypressSpacebar.ogg
    02-03 11:08:01.706: E/SoundPool(371): error loading /system/media/audio/ui/KeypressDelete.ogg
    02-03 11:08:01.706: W/AudioService(371): Soundpool could not load file: /system/media/audio/ui/KeypressDelete.ogg
    02-03 11:08:01.706: E/SoundPool(371): error loading /system/media/audio/ui/KeypressReturn.ogg
    02-03 11:08:01.716: W/AudioService(371): Soundpool could not load file: /system/media/audio/ui/KeypressReturn.ogg
    02-03 11:08:01.716: E/SoundPool(371): error loading /system/media/audio/ui/KeypressInvalid.ogg
    02-03 11:08:01.716: W/AudioService(371): Soundpool could not load file: /system/media/audio/ui/KeypressInvalid.ogg
    02-03 11:08:01.716: W/AudioService(371): onLoadSoundEffects(), Error -1 while loading samples
    02-03 11:08:01.846: I/ActivityManager(371): Process com.android.domotique (pid 1316) has died.
    02-03 11:08:01.906: D/LightsService(371): Excessive delay setting light: 312ms
    02-03 11:08:02.016: D/LightsService(371): Excessive delay setting light: 116ms
    02-03 11:08:02.096: D/LightsService(371): Excessive delay setting light: 75ms
    02-03 11:08:02.776: I/Choreographer(707): Skipped 224 frames!  The application may be doing too much work on its main thread.
    02-03 11:08:03.056: I/Choreographer(371): Skipped 238 frames!  The application may be doing too much work on its main thread.
    02-03 11:08:03.416: I/Choreographer(371): Skipped 38 frames!  The application may be doing too much work on its main thread.
    02-03 11:08:03.616: I/Choreographer(371): Skipped 32 frames!  The application may be doing too much work on its main thread.
    02-03 11:08:03.616: W/InputMethodManagerService(371): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@b543c468 attribute=null, token = android.os.BinderProxy@b569cf70
    02-03 11:08:03.626: I/Choreographer(707): Skipped 69 frames!  The application may be doing too much work on its main thread.

  10. #10
    Modérateur
    Avatar de Hizin
    Homme Profil pro
    Développeur mobile
    Inscrit en
    Février 2010
    Messages
    2 180
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France

    Informations professionnelles :
    Activité : Développeur mobile

    Informations forums :
    Inscription : Février 2010
    Messages : 2 180
    Points : 5 072
    Points
    5 072
    Par défaut
    Troisième fois que je me fais mal comprendre aujourd'hui

    En fait, j'avais fait une première réponse sans regarder l'intégralité de ta stacktrace. En la regardant, on dirait que tes soucis sont causés par une OutOfMemory, indiquant que tu dépasses le seuil mémoire alloué pour l'application.

    Manifestement, tu essaies d'afficher une image quelconque avant d'afficher ton admin (ou pendant). Celle-ci serait beaucoup trop grosse.
    C'est Android, PAS Androïd, ou Androïde didiou !
    Le premier est un OS, le second est la mauvaise orthographe du troisième, un mot français désignant un robot à forme humaine.

    Membre du comité contre la phrase "ça marche PAS" en titre et/ou explication de problème.

    N'oubliez pas de consulter les FAQ Android et les cours et tutoriels Android

  11. #11
    Expert éminent

    Homme Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Février 2007
    Messages
    4 253
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Février 2007
    Messages : 4 253
    Points : 7 618
    Points
    7 618
    Billets dans le blog
    3
    Par défaut
    Je penche pour "drawable/planmaison" qui est une bien trop grosse image...

    On peut avoir les détails de cette ressource ?
    N'oubliez pas de cliquer sur mais aussi sur si un commentaire vous a été utile !
    Et surtout

  12. #12
    Invité
    Invité(e)
    Par défaut
    Bonjour,

    Voici l'image plan maison que j'utilise :

    Images attachées Images attachées  
    Dernière modification par joel.drigo ; 04/02/2014 à 09h50. Motif: Rapatriement image (bouton trombone)

  13. #13
    Expert éminent

    Homme Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Février 2007
    Messages
    4 253
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Février 2007
    Messages : 4 253
    Points : 7 618
    Points
    7 618
    Billets dans le blog
    3
    Par défaut
    Ok... mais quelle taille ? Les versions ldpi, mdpi, hdpi, xhdpi, et xxhdpi sont présentes ? si oui lesquelles ?
    Peut importe les pixels dedans !
    N'oubliez pas de cliquer sur mais aussi sur si un commentaire vous a été utile !
    Et surtout

  14. #14
    Invité
    Invité(e)
    Par défaut
    Merci de votre réponse mais j'ai réussi à résoudre mon problème

  15. #15
    Modérateur
    Avatar de Hizin
    Homme Profil pro
    Développeur mobile
    Inscrit en
    Février 2010
    Messages
    2 180
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France

    Informations professionnelles :
    Activité : Développeur mobile

    Informations forums :
    Inscription : Février 2010
    Messages : 2 180
    Points : 5 072
    Points
    5 072
    Par défaut
    Et comment as-tu fait ?
    Pour la postérité, toi-même et potentiellement les autres personnes tombant sur ce sujet

    Ps : pense à marquer cette discussion en "résolue" à l'aide du bouton
    C'est Android, PAS Androïd, ou Androïde didiou !
    Le premier est un OS, le second est la mauvaise orthographe du troisième, un mot français désignant un robot à forme humaine.

    Membre du comité contre la phrase "ça marche PAS" en titre et/ou explication de problème.

    N'oubliez pas de consulter les FAQ Android et les cours et tutoriels Android

  16. #16
    Invité
    Invité(e)
    Par défaut
    Bonjour,

    J'ai simplement redimensionner l'image car elle était en 4400*3200 et donc saturée la mémoire.

  17. #17
    Modérateur
    Avatar de Hizin
    Homme Profil pro
    Développeur mobile
    Inscrit en
    Février 2010
    Messages
    2 180
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France

    Informations professionnelles :
    Activité : Développeur mobile

    Informations forums :
    Inscription : Février 2010
    Messages : 2 180
    Points : 5 072
    Points
    5 072
    Par défaut
    Merci, donc nous avions vu juste finalement

    Pour information, Android garanti 16 Mo de RAM à une application. La taille est variable selon les terminaux (constructeur, version, surcouche, phase de la lune).
    C'est Android, PAS Androïd, ou Androïde didiou !
    Le premier est un OS, le second est la mauvaise orthographe du troisième, un mot français désignant un robot à forme humaine.

    Membre du comité contre la phrase "ça marche PAS" en titre et/ou explication de problème.

    N'oubliez pas de consulter les FAQ Android et les cours et tutoriels Android

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Problème socket Android
    Par hannibal813 dans le forum API standards et tierces
    Réponses: 1
    Dernier message: 05/04/2013, 02h28
  2. Problème Socket
    Par karl2mil1 dans le forum C++Builder
    Réponses: 3
    Dernier message: 13/09/2005, 00h35
  3. Problème socket raw ? bizarre :~
    Par MonsieurAk dans le forum Windows
    Réponses: 2
    Dernier message: 12/07/2005, 15h12
  4. [MFC] Problème Socket + Connexion SQL
    Par BananaUltra3C dans le forum MFC
    Réponses: 6
    Dernier message: 20/05/2005, 17h41
  5. [Réseau] Problème socket
    Par neenee dans le forum Entrée/Sortie
    Réponses: 14
    Dernier message: 18/01/2005, 16h26

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo