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

Android Discussion :

Incompatibilité CSS/JS/HTML/Android Java entre Android 4.4.4/5.0 & 4.2


Sujet :

Android

  1. #1
    Membre averti

    Homme Profil pro
    Développeur Web
    Inscrit en
    Janvier 2014
    Messages
    153
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Janvier 2014
    Messages : 153
    Points : 316
    Points
    316
    Par défaut Incompatibilité CSS/JS/HTML/Android Java entre Android 4.4.4/5.0 & 4.2
    Bonjour

    L'application que je développe est pratiquement terminée mais il y a encore des bug.
    Un des plus "étrange" est le comportement différent suivant la version android.

    Voici l'illustration du problème:
    A droite : AVD en 4.2
    A gauche: AVD en 5.0 (comportement identique sur mon xpéria en 4.4.4)

    Pardon pour la taille de l'image

    Nom : Screen Shot 2015-04-27 at 20.30.43.png
Affichages : 830
Taille : 574,4 Ko


    Je peux poster à la demande mes différents code vu que je n'ai aucune idée de la source du problème

    Merci d'avance
    Ma plateforme de formations digitales (développement Web, cybersécurité, SEO, Marketing digital)

    https://monformateurindependant.com

  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
    Oui, il les faudra car nos boules de cristal sont inopérantes depuis 160 ans
    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
    Membre averti

    Homme Profil pro
    Développeur Web
    Inscrit en
    Janvier 2014
    Messages
    153
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Janvier 2014
    Messages : 153
    Points : 316
    Points
    316
    Par défaut
    Effectivement,

    Bon avec du retard, je me lance

    Code CSS

    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
     
    @charset "UTF-8";
    body {
    	background:#BDBDBD; top:0; left:0px; right:0px; bottom:0; padding:0; margin:0;
    }
    #ecran {
    	position:absolute; width:100%; height:100%;
    	overflow:hidden; background:#E9E9E9; min-width:500px;
    }
    #view_connexion {
    	position:absolute;
    	left:0; top:0;
    	width:100%; height:100%;
    }
    #formulaire_connexion {
    	position:absolute;
    	top:calc(50% - 140px); left:20px; right:20px;
    	height:280px;
    }
    #ecran2 {
    	position:absolute;
    	left:680px; top:20px;
    	width:640px; height:1136px;
    	overflow:hidden;
    }
    #effet_ecran2 {
    	position:absolute;
    	left:0; top:0;
    	width:100%; height:100%;
    	background:#26396B; opacity:0.7;
    }
    #view_inscription {
    	position:absolute;
    	right:-100%; top:0;
    	width:100%; height:100%;
    }
    #effet_inscription {
    	position:absolute;
    	top:27.5%; left:20px; right:20px;
    	height:45%;
    	background:#151A28; opacity:0.7;
    	border-radius:10px;
    }
    #formulaire_inscription {
    	position:absolute;
    	top:calc(50% - 305px); left:20px; right:20px;
    	height:547px;
    }
    .c_popup {
    	position:absolute; width:100%; height:100%; z-index:8; display:none; overflow:hidden;
    }
    .popup {
    	position:absolute; width:90%; height:350px; z-index:9; left:5%; top:calc(50% - 175px); 
    	background:#282c35; border-radius:10px; overflow:hidden;
    }
    .text_popup {
    	position:absolute; width:90%; height:65px; font-size:30px; color:#fff; left:5%; 
    	top:50px; font-family:MyriadPro-Regular; text-align:center;
    }
    .choix2 {
    	padding-top:30px; padding-bottom:30px; padding-left:20px; padding-right:20px; 
    	width:calc(100% - 40px); text-align:center; position:absolute;
    	color:#fff; font-family:MyriadPro-Regular; font-size:30px; 
    	border-top:1px solid #212121; bottom:0; 
    }

    Code HTML

    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
    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
     
    <!doctype html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Inscription</title>
    <!--<script type="text/javascript" src="jquery.js"></script>-->
    <link href="Inscription.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js   jquery-1.8.0.min.js</script> 
    </head>
     
    <body>
     
    	<div id="ecran">
    	<div id="view_connexion">
     
    <div id="c_mail_no" class="c_popup">
    <div style="background:#fff;opacity:0.5;positon:absolute;width:100%;height:100%;"></div>
    <div id="popup_mail_no" style="top:calc(50% - 125px);height:250px;" class="popup">
    <div class="text_popup">Les mails ne correspondent pas</div>
    <div id="annuler_mail_no" class="choix2">Fermer</div>
    </div></div>
     
    <div id="c_mdp_no" class="c_popup">
    <div style="background:#fff;opacity:0.5;positon:absolute;width:100%;height:100%;"></div>
    <div id="popup_mdp_no" style="top:calc(50% - 125px);height:250px;" class="popup">
    <div class="text_popup">Les mots de passe ne correspondent pas</div>
    <div id="annuler_mdp_no" class="choix2">Fermer</div>
    </div></div>
     
    <div id="c_id_space" class="c_popup">
    <div style="background:#fff;opacity:0.5;positon:absolute;width:100%;height:100%;"></div>
    <div id="popup_mdp_no" style="top:calc(50% - 125px);height:250px;" class="popup">
    <div class="text_popup">Saisir un pseudo, sans espace(s)</div>
    <div id="annuler_id_space" class="choix2">Fermer</div>
    </div></div>	
     
        <div id="formulaire_connexion">
    	<form id="form_connection" method="POST" action="connexion.php">
    	<div style="overflow:hidden;width:calc(100% - 24px);height:84px;border-top-left-radius:10px;border-top-right-radius:10px;position:absolute;left:10px;top:10px;border:2px #CCCCCC solid;">
    	<input style="padding-left:10px;padding-right:10px;width:100%;height:100%;border:none;position:absolute;font-family:MyriadPro-Regular;font-size:30px;"  type="mail" name="mail" value="">
        <input type="button" class="verif" style="z-index:1;position:absolute;right:0;height:83px;width:70px;border:none;background:#fff;font-size:30px;text-align:center;" value=""></div>
     
    	<div style="overflow:hidden;width:calc(100% - 24px);height:84px;border-bottom-left-radius:10px;border-bottom-right-radius:10px;position:absolute;left:10px;top:95px;border:2px #CCCCCC solid;">
        <input style="padding-left:10px;padding-right:10px;width:100%;height:100%;border:none;position:absolute;font-family:MyriadPro-Regular;font-size:30px;" required x-moz-errormessage="Entrez un mot de passe" type="password" placeholder="Mot de passe" name="password" value=""></div>
     
    	<input name="connexion" type="submit" id="connection" value="Se connecter" style="background:#7ED3AA;overflow:hidden;width:calc(100% - 20px);height:90px;border:2px #328236 solid;border-radius:10px;position:absolute;left:10px;top:197px;font-size:30px;color:#fff;">
    	</form></div>
     
    	<div id="l_inscription" style="width:300px;color:#8C8C8C;font-size:30px;height:30px;bottom:50px;position:absolute;text-align:center;left:calc(50% - 150px);font-family:MyriadPro-Regular;">Pas encore inscrit ?</div>
    	</div>
     
    	 <div id="view_inscription">
         <div id="formulaire_inscription">
    	 <form id="form_principal" method="POST" action="creationcompte.php">
     
    	 <div style="overflow:hidden;width:calc(100% - 24px);height:84px;border-top-left-radius:10px;border-top-right-radius:10px;position:absolute;left:10px;top:10px;border:2px #CCCCCC solid;">
         <input style="padding-left:10px;padding-right:10px;width:100%;height:100%;border:none;position:absolute;font-family:MyriadPro-Regular;font-size:30px;"  type="mail" name="mail1" required x-moz-errormessage="Entre ton mail" placeholder="E-mail" ton mail"" value="">
         <input type="button"  class="verif" style="z-index:1;position:absolute;right:0;height:83px;width:70px;border:none;font-size:30px;text-align:center;background:#fff;" value=""></div>
     
         <div style="overflow:hidden;width:calc(100% - 24px);height:84px;position:absolute;left:10px;top:95px;border:2px #CCCCCC solid;">
         <input style="padding-left:10px;padding-right:10px;width:100%;height:100%;border:none;position:absolute;font-family:MyriadPro-Regular;font-size:30px;" type="mail" placeholder="Confirmation E-mail" name="mail2" required x-moz-errormessage="Confirme ton mail" value="">
         <input type="button" class="verif" style="z-index:1;position:absolute;right:0;height:83px;width:70px;border:none;font-size:30px;text-align:center;background:#fff;" value=""></div>
     
         <div style="overflow:hidden;width:calc(100% - 24px);height:84px;position:absolute;left:10px;top:180px;border:2px #CCCCCC solid;">
         <input style="padding-left:10px;padding-right:10px;width:100%;height:100%;border:none;position:absolute;font-family:MyriadPro-Regular;font-size:30px;"  type="password" name="password1" required x-moz-errormessage="Entre ton mot de passe" placeholder="Mot de passe" value="">
         <input type="button" class="verif" style="z-index:1;position:absolute;right:0;height:83px;width:70px;background:#fff;border:none;font-size:30px;text-align:center;" value=""></div>
     
         <div style="overflow:hidden;width:calc(100% - 24px);height:84px;position:absolute;left:10px;top:265px;border:2px #CCCCCC solid;">
         <input style="padding-left:10px;padding-right:10px;width:100%;height:100%;border:none;position:absolute;font-family:MyriadPro-Regular;font-size:30px;" type="password" name="password2" required x-moz-errormessage="Confirme ton mot de passe" placeholder="Confirmation mot de passe" value="">
         <input type="button" class="verif" style="z-index:1;position:absolute;right:0;height:83px;width:70px;background:#fff;border:none;font-size:30px;text-align:center;" value=""></div>
     
         <div style="overflow:hidden;width:calc(100% - 24px);height:83px;border-bottom-left-radius:10px;border-bottom-right-radius:10px;position:absolute;left:10px;top:350px;border:2px #CCCCCC solid;">
         <input style="padding-left:10px;padding-right:10px;width:100%;height:100%;border:none;position:font-family:MyriadPro-Regular;font-size:30px;" type="text" name="identifiant" required x-moz-errormessage="Inserez un identifiant" placeholder="Identifiant (ex : Cassie29)" value=""></div>
     
         <input name="connexion" type="button" id="creation" value="Inscription" style="background:#7ED3AA;overflow:hidden;width:calc(100% - 20px);height:90px;border:2px #328236 solid;border-radius:10px;position:absolute;left:10px;top:451.5px;font-size:30px;color:#fff;">
     
         <div style="position:absolute;top:555px;width:calc(100% - 20px);left:10px;height:10px;">
         <div style="text-align:center;color:#8C8C8C;font-family:MyriadPro-Regular;font-size:20px;">En cliquant sur inscription vous acceptez les conditions d'utilisations</div>
         </div>
         </form>
         </div>
     
    	 <div id="l_connexion" style="width:300px;color:#8C8C8C;font-size:30px;height:30px;bottom:50px;position:absolute;text-align:center;left:calc(50% - 150px);font-family:MyriadPro-Regular;">Retour vers connexion</div>
    	 </div>
     
    	 </div>
     
    </body>
     
    <script>
    	$("#l_inscription").on('click', function () {
    	$('#view_inscription').css({'right':'0%','transition':'all .2s'});
    	$('#view_connexion').css({'left':'-100%','transition':'all .2s'});
    });
    	$("#l_connexion").on('click', function () {
    	$('#view_inscription').css({'right':'-100%','transition':'all .2s'});
    	$('#view_connexion').css({'left':'0%','transition':'all .2s'});
    });
     
     
    regex = /^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$/;
     
    $("input[name='mail1']").on("change", function () {
    	mail1 = $(this).val();
    	if(regex.test(mail1)) { $(this).parent('div').children('.verif').css('color', '#26396B').val(''); } else {$(this).parent('div').children('.verif').css('color', '#BE1621').val('X');}
     
    });
    $("input[name='mail']").on("change", function () {
    	mail = $(this).val();
    	if(regex.test(mail)) { $(this).parent('div').children('.verif').css('color', '#26396B').val(''); } else {$(this).parent('div').children('.verif').css('color', '#BE1621').val('X');}
     
    });
     
     
    $("input[name='mail2']").on("change", function () {
    	mail2 = $(this).val();
    	if(regex.test(mail2)) { $(this).parent('div').children('.verif').css('color', '#26396B').val(''); } else {$(this).parent('div').children('.verif').css('color', '#BE1621').val('X');}
    	if(mail1 == mail2) { } else { Android.showToast("les mails de correspondent pas"); }
    });
     
    $("input[name='password2']").on("change", function () {
    	password2 = $(this).val();
    	password1 = $("input[name='password1']").val();
    	if(password1 == password2) { 
    		$(this).parent('div').children('.verif').css('color', '#26396B').val('');
    		$("input[name='password1']").parent('div').children('.verif').css('color', '#26396B').val('');
    	} else {
    		$(this).parent('div').children('.verif').css('color', '#BE1621').val('X');
    		$("input[name='password1']").parent('div').children('.verif').css('color', '#BE1621').val('X');
    	}
    });
     
    $("input[name='identifiant']").on('keyup', function () {
    	if($(this).val().length > 17) $(this).css({'color':'RED'});
    	if($(this).val().length < 17) $(this).css({'color':'BLACK'});
    });
     
    // création d'un compte
    $("#creation").on('click', function () {
    	password2 	= $("input[name='password2']").val();
    	password1 	= $("input[name='password1']").val();
    	pseudo		= $("input[name='identifiant']").val();
     
    	if(pseudo == "") return false;
    	car = pseudo.length - 17;
    	if(pseudo.length > 17) { trop_car(car); }
    	regex = /^[a-zA-Z0-9.-_]+$/;
    	if(!regex.test(pseudo)) { try { Android.showToast('saisir un identifiant sans espace'); return false; }
    			catch (e) { alert('saisir un identifiant sans espace'); return false;}
    		}
    	//alert(password2);
    	if(password1 == password2) { 
    		mail1 = $("input[name='mail1']").val();
    		mail2 = $("input[name='mail2']").val();
    		if(password1 == "" || password2 == "" || mail1 == "" || mail2 == "") return false;
    		if(mail1 == mail2) { 
    			$.ajax({
    				type : 'POST',
    				url : 'creationcompte.php',
    				data : 'test_pseudo='+ pseudo +'&test_mail='+mail1,
    				success: function(text) {
    					if(text == 'o') {
    						$("#form_principal").submit(); 
    					} else {
    						 try { Android.showToast(text); }
    						 catch (e) { alert(text);}
    					}Android.showToast('saisir un identifiant sans espace');
    				}
    			});
    			//
     
    		} else { 
    			try {Android.showToast("Les mails ne correspondent pas"); return false;}
    			catch (e) {alert("Les mails ne correspondent pas"); return false;}
    		}
    	} else { 
    			try {Android.showToast("Les mots de passe ne correspondent pas"); return false;}
    			catch (e) { alert("Les mots de passe ne correspondent pas"); return false;}
    		}
    });
     
    $('#annuler_mail_no').on('click', function () {
    	$('#c_popup_mail_no').css({'display':'none'});
    });
    $('#annuler_mdp_no').on('click', function () {
    	$('#c_popup_mdp_no').css({'display':'none'});
    });
    $('#annuler_id_space').on('click', function () {
    	$('#c_popup_id_space').css({'display':'none'});
    });
     
    function trop_car(car){
    	alert("il y a "+ car +" caractères de trop dans l'identifiant");
    	$("input[name='identifiant']").css({'color':'RED'}); 
    	return false;
    }
     
    $("#connection").on('click', function () {
    	mail = $("input[name='mail']").val();
    	if($("input[name='password']").val() == "") return false;
    	if(regex.test(mail)) { $("#form_connection").submit(); } else {$(this).parent('div').children('.verif').css('color', '#BE1621').val('X');}
     
    });
     
     
    </script>
     
    </html>
    COde natif:

    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
     
     
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            webView();
     
     
     
            Intent i = new Intent(MainActivity.this, Majnotif.class);
            i.putExtra(EXTRA_COMPTEUR, mCompteur);
     
            //mCompteur ++;
     
     
            startService(i);
     
     
        }
     
     
       public final void webView() {
           //Unimplemented WebView method onKeyDown called from: android.webkit.WebView.onKeyDown(WebView.java:2178)
           ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
           NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
           if (networkInfo != null && networkInfo.isAvailable() && networkInfo.isConnected()) {
               WebView myWebView = (WebView) findViewById(R.id.webView);
               myWebView.setVisibility(0);
               WebSettings parametre = myWebView.getSettings();
               parametre.setJavaScriptEnabled(true);
               parametre.setUseWideViewPort(true);//utilise le meta view port du html
               parametre.getLoadWithOverviewMode();
               parametre.setTextZoom(100);
               parametre.setSupportZoom(false);
               myWebView.loadUrl("http://test.com/Inscription.php");
               myWebView.setInitialScale(100);
               myWebView.setWebViewClient(new WebViewClient());
               myWebView.addJavascriptInterface(new WebAppInterface(this), "Android");// affiche les alert en toast
               myWebView.canGoBack();
               // Tous les liens s'ouvriront directement depuis la WebView
               myWebView.setWebChromeClient(new WebChromeClient()
               {
                   @SuppressWarnings("unused")
     
                   public void openFileChooser(ValueCallback<Uri> uploadMsg, String AcceptType, String capture) {
     
                       this.openFileChooser(uploadMsg);
     
                   }
     
                   @SuppressWarnings("unused")
     
                   public void openFileChooser(ValueCallback<Uri> uploadMsg, String AcceptType) {
     
                       this.openFileChooser(uploadMsg);
     
                   }
     
                   public void openFileChooser(ValueCallback<Uri> uploadMsg) {
     
                       mUploadMessage = uploadMsg;
     
                       pickFile();
     
                   }
               });
           }
     
       }
    Ma plateforme de formations digitales (développement Web, cybersécurité, SEO, Marketing digital)

    https://monformateurindependant.com

Discussions similaires

  1. problème de compatibilité entre java et android
    Par LEGOLAS19 dans le forum Android
    Réponses: 7
    Dernier message: 25/02/2015, 18h35
  2. Réponses: 5
    Dernier message: 06/10/2011, 15h43
  3. incompatibilité css entre ie firefox
    Par mitmit dans le forum Mise en page CSS
    Réponses: 2
    Dernier message: 20/06/2007, 17h50
  4. [Débutant] Dialogue Java entre les frames pour client HTML
    Par Carrel dans le forum Général Java
    Réponses: 4
    Dernier message: 03/06/2004, 11h39

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