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

Composants graphiques Android Discussion :

Importer une image HTML - iframe sur internet dans appli android


Sujet :

Composants graphiques Android

  1. #1
    Membre régulier
    Homme Profil pro
    operateur nucléaire
    Inscrit en
    Janvier 2017
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France, Ardennes (Champagne Ardenne)

    Informations professionnelles :
    Activité : operateur nucléaire
    Secteur : Distribution

    Informations forums :
    Inscription : Janvier 2017
    Messages : 9
    Par défaut Importer une image HTML - iframe sur internet dans appli android
    Bonjour,

    J'ai récupéré un projet android Github, mais celui-ci est en Anglais et l'ensemble des donnée récupéré sur internet proviens de source Anglaise...
    Le but est de modifier l'ensemble de cette application en Français, j'ai déjà bien avancé mais je bloque....

    Je souhaiterai insérer dans cette application une image (.png) récupéré sur internet en HTML - iframe (afin de modifier la couler d’arrière plan et couleur de texte), qu'elle soit mise a jours toute les 10 minutes...

    • Origine de l'image :



    Format du widget de type "Horizontal" - exemple ci-dessous

    Prévisions complètes pour Vireux-Molhain

    <div style="width:510px;color:#000;border:1px solid #F2F2F2;">
    <iframe height="85" frameborder="0" width="510" scrolling="no" src="http://www.prevision-meteo.ch/services/html/vireux-molhain/horizontal" allowtransparency="true"></iframe>
    <a style="text-decoration:none;font-size:0.75em;" title="Météo Vireux-Molhain à 4 jours" href="http://www.prevision-meteo.ch/meteo/localite/vireux-molhain">Météo Vireux-Molhain à 4 jours</a>
    </div>
    Merci de bien vouloir laisser le lien menant vers prevision-meteo.ch si possible en dehors de la frame.

    Vous pouvez personnaliser la couleur de ces vignettes en indiquant les paramètres suivants :

    Couleur du fond : bg=hexadecimal
    Couleur du texte : txtcol=hexadecimal
    Couleur des températures minimales : tmpmin=hexadecimal
    Couleur des températures maximales : tmpmax=hexadecimal

    • copie d’écran de la source :


    Nom : Capture.JPG
Affichages : 362
Taille : 106,0 Ko

    • Voici mon code actuel (vide):


    Nom : Capture.JPG
Affichages : 318
Taille : 97,5 Ko



    Merci d'avance pour votre aide...
    Aurélien

  2. #2
    Membre très actif Avatar de jmonga
    Homme Profil pro
    Développeur Java
    Inscrit en
    Novembre 2014
    Messages
    175
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : Congo-Kinshasa

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2014
    Messages : 175
    Par défaut
    regardez ici.
    http://stackoverflow.com/questions/2...on-android-app

    si ça va faites signe

  3. #3
    Membre régulier
    Homme Profil pro
    operateur nucléaire
    Inscrit en
    Janvier 2017
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France, Ardennes (Champagne Ardenne)

    Informations professionnelles :
    Activité : operateur nucléaire
    Secteur : Distribution

    Informations forums :
    Inscription : Janvier 2017
    Messages : 9
    Par défaut Re
    Bonjour Jonathan,

    j'essai la solution sur le liens que tu ma donné et je te tiens informé du résultat...

    Merci pour ta réponse.

  4. #4
    Membre très actif Avatar de jmonga
    Homme Profil pro
    Développeur Java
    Inscrit en
    Novembre 2014
    Messages
    175
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : Congo-Kinshasa

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2014
    Messages : 175
    Par défaut
    Ok merci

  5. #5
    Membre régulier
    Homme Profil pro
    operateur nucléaire
    Inscrit en
    Janvier 2017
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France, Ardennes (Champagne Ardenne)

    Informations professionnelles :
    Activité : operateur nucléaire
    Secteur : Distribution

    Informations forums :
    Inscription : Janvier 2017
    Messages : 9
    Par défaut tjrs pas trouvé ma solution
    Voici mon code :
    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
    package net.maxbraun.mirror;
     
    import android.app.Activity;
    import android.os.Bundle;
    import android.webkit.WebSettings;
    import android.webkit.WebView;
     
    /**
     * Created by XXXXXXX on 23/02/2017.
     *  * Météo Carré récupéré sur prévision-météo.ch :
     * <a href="http://www.prevision-meteo.ch/services/html/vireux-molhain/square?bg=000000&txtcol=FEFEFE&tmpmin=fff000&tmpmax=378ADF" target="_blank">http://www.prevision-meteo.ch/servic...&tmpmax=378ADF</a>
     *
     * Météo Horizontale récupéré sur prévision-météo.ch :
     * <a href="http://www.prevision-meteo.ch/services/html/vireux-molhain/horizontal?bg=000000&txtcol=FEFEFE&tmpmin=fff000&tmpmax=378ADF" target="_blank">http://www.prevision-meteo.ch/servic...&tmpmax=378ADF</a>
     *
     * ne pas oublier de configurer le WEBVIEW comme cette commande : android:id="@+id/webview"
     */
     
    public class MeteoFR extends Activity {
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_home);
     
            // Instanciation du WebView...
            WebView wvSite = (WebView)findViewById(R.id.webview);
     
            //...on active JavaScript...
            WebSettings webSettings = wvSite.getSettings();
            webSettings.setJavaScriptEnabled(true);
     
            //...et on charge la page
            wvSite.loadUrl("http://www.prevision-meteo.ch/services/html/vireux-molhain/horizontal?bg=000000&txtcol=FEFEFE&tmpmin=fff000&tmpmax=378ADF");
        }
    }
    Dans le Webview que j'ai créer dans activity_home avec l'ID webview ça affiche une couleur blanche même si j'ai mis l’arrière plan du webview en noir ?
    Je ne vois pas où est mon erreur.

    Quelqu'un peut m'aider ? Je suis débutant...

    Merci d'avance.

  6. #6
    Membre très actif Avatar de jmonga
    Homme Profil pro
    Développeur Java
    Inscrit en
    Novembre 2014
    Messages
    175
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : Congo-Kinshasa

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2014
    Messages : 175
    Par défaut
    voyons ton le code de ton layout

  7. #7
    Membre régulier
    Homme Profil pro
    operateur nucléaire
    Inscrit en
    Janvier 2017
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France, Ardennes (Champagne Ardenne)

    Informations professionnelles :
    Activité : operateur nucléaire
    Secteur : Distribution

    Informations forums :
    Inscription : Janvier 2017
    Messages : 9
    Par défaut Voici mon layout
    Bonjour Jonathan,

    voici mon layout

    Merci de ton aide
    Aurélien

    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
     
    <?xml version="1.0" encoding="utf-8"?>
     
    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:keepScreenOn="true"
        android:paddingLeft="@dimen/outside_padding"
        android:paddingRight="@dimen/outside_padding">
     
      <!-- Weather -->
     
      <TextView
          android:id="@+id/temperature"
          style="@style/TemperatureStyle"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:gravity="left"
          tools:text="72°"
          android:layout_alignParentTop="true"
          android:layout_toStartOf="@+id/time" />
     
      <ImageView
          android:id="@+id/icon"
          android:layout_width="96dp"
          android:layout_height="96dp"
          android:scaleType="fitXY"
          android:layout_alignBottom="@id/temperature"
          android:layout_marginBottom="15dp"
          android:layout_marginLeft="5dp"
          android:layout_toRightOf="@id/temperature"
          tools:src="@drawable/partly_cloudy_day"/>
     
      <TextView
          android:id="@+id/weather_summary"
          style="@style/WeatherTextStyle"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_below="@id/temperature"
          android:gravity="left"
          android:maxWidth="380dp"
          tools:text="Mostly cloudy until tomorrow evening"/>
     
      <TextView
          android:id="@+id/precipitation"
          style="@style/WeatherTextStyle"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_below="@id/weather_summary"
          android:layout_marginTop="@dimen/inter_group_margin"
          android:drawableLeft="@drawable/umbrella"
          android:drawablePadding="@dimen/icon_margin"
          tools:text="6%"/>
     
      <!-- Time and date -->
     
     
      <TextClock
          android:id="@+id/time"
          style="@style/TimeStyle"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_alignParentTop="true"
          android:format12Hour="h\uee01mm"
          android:format24Hour="H\uee01mm"
          android:gravity="right"/>
     
      <TextClock
          android:id="@+id/day_of_the_week"
          style="@style/DateStyle"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_below="@id/time"
          android:format12Hour="EEEE\nMMMM d"
          android:format24Hour="EEEE\nd MMMM"
          android:gravity="right"/>
     
      <!-- News -->
      <LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_alignParentLeft="true"
          android:orientation="vertical">
        <TextView
            android:id="@+id/news_1"
            style="@style/NewsStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="left"
            android:layout_marginBottom="@dimen/intra_group_margin"
            android:drawableLeft="@drawable/news_ap"
            android:drawablePadding="@dimen/icon_margin"
            tools:text="Obama, Sanders at the White House: Nice chat but that's all"/>
     
        <TextView
            android:id="@+id/news_2"
            style="@style/NewsStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="left"
            android:layout_marginBottom="@dimen/intra_group_margin"
            android:drawableLeft="@drawable/news_ap"
            android:drawablePadding="@dimen/icon_margin"
            tools:text="Debate feud injects fresh chaos into GOP primary"/>
     
        <TextView
            android:id="@+id/news_3"
            style="@style/NewsStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="left"
            android:layout_marginBottom="@dimen/intra_group_margin"
            android:drawableLeft="@drawable/news_ap"
            android:drawablePadding="@dimen/icon_margin"
            tools:text="Rancher killed in standoff vowed to die before going to jail"/>
     
        <TextView
            android:id="@+id/news_4"
            style="@style/NewsStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="left"
            android:layout_marginBottom="@dimen/intra_group_margin"
            android:drawableLeft="@drawable/news_ap"
            android:drawablePadding="@dimen/icon_margin"
            tools:text="Authorities: Last activists should leave wildlife preserve"/>
      </LinearLayout>
     
      <!-- Body -->
      <net.maxbraun.mirror.BodyView
          android:id="@+id/body"
          android:layout_width="250dp"
          android:layout_height="200dp"
          android:layout_alignParentRight="true"
          android:layout_alignParentBottom="true"
          android:layout_marginBottom="@dimen/intra_group_margin"/>
     
      <WebView
          android:id="@+id/webview"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_above="@+id/body"
          android:layout_alignEnd="@+id/icon" />
     
    </RelativeLayout>

Discussions similaires

  1. Réponses: 13
    Dernier message: 06/04/2012, 15h57
  2. Enregistrer une page html publiée sur Internet
    Par creezeer dans le forum Shell et commandes GNU
    Réponses: 1
    Dernier message: 20/11/2006, 17h43
  3. Réponses: 3
    Dernier message: 20/07/2006, 15h41
  4. importé une page HTML locale dans JSP !
    Par abd21 dans le forum Servlets/JSP
    Réponses: 5
    Dernier message: 20/06/2006, 11h01
  5. [FLASH 5]un bouton dans une image pour revenir sur une scene
    Par patato valdes dans le forum Flash
    Réponses: 7
    Dernier message: 28/04/2004, 20h21

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