× Graphical User Interface

Others errata

Plus d'informations
il y a 12 ans 4 mois #24 par mseguy
COM_KUNENA_MESSAGE_CREATED_NEW
Hello,
:oops:
Some errors have been found, below you can find the corrections:
  1. GUI is the acronym of Graphical User Interface
  2. Below the schema that shows the life cycle of an activity, the legend is missing: developer.android.com/guide/topics/fundamentals/activities.html, but you should have recognize it.
  3. Page 28,
    public void onTextChanged(CharSequence s, int start, int before, int count) {
    autoCompleteTextView.setText(textView.getText());
    }


    has to be modified by:
    public void onTextChanged(CharSequence s, int start, int before, int count) {
    textView.setText(autoCompleteTextView.getText());
    }


    (thanks to renaudm)
  4. Page 68,

    In the activity OtherActivty, the way to send back information to the calling activity is missing.
    To do that you can add a method setResultsForCaller. Then, when you want to save data (anywhere in your activity), just call this method. You can also use the method's body anywhere to do the same thing (store information that will be send back to the calling activity) :
    protected void setResultsForCaller () {
    	//I define an Intent to add the data
        Intent result = new Intent();
    	//I use a Bundle to store those data
        Bundle b = new Bundle();
    	//I add data i want to send back to the calling activity within the bundle
        b.putParcelableArray("com.whatever.data", items);
    	//I store the bundle in the Intent
        result.putExtras(b);
    	//And i ask to reminber this Intent as the result of my activity
        setResult(Activity.RESULT_OK, result);
    }


  5. Page 87,

    In the definition of the ListPreference in the preference.xml file,i wrote :
    <ListPreference 
          android:key="@string/list" 
          android:title="Choice dialog" 
          android:summary="Click to open a list of choices"
    android:entries="@array/i_like_array"
    android:dialogTitle="Choose what you like" />


    but you have to write:
    <ListPreference 
          android:key="@string/list" 
          android:title="Choice dialog" 
          android:summary="Click to open a list of choices"
    android:entries="@array/i_like_array"

    android:entryValues="@array/i_like_array"
    android:dialogTitle="Choose what you like" />


    or, you can write:
    <ListPreference 
          android:key="@string/list" 
          android:title="Choice dialog" 
          android:summary="Click to open a list of choices" 
    android:entries="@array/i_like_array"

    android:entryValues="@array/i_like_array_values"
          android:dialogTitle="Choose what you like" />


    In the first case, the entries (the list of characters displayed to the user) and the entryValues (the list of returned objects when a selection is done) are identical, in the second case, it's two different arrays.
    The usefulness of having a entryValues ??is to return an integer, a string or other. Most of the time entries and entryValues may be the same.


    The second mistake of this paragraph is where to declare the i_like_array. If you do that in the string.xml file, it doesn't work. You need to declare them (i_like_array et i_like_array_values) in a specific file : res\values\arrays.xml (beside the string.xml file).

    So the correct way to do that is:

    The string.xml file:
    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <string name="hello">Hello World, PreferenceSimpleTuto!</string>
        <string name="app_name">PreferenceSimpleTuto</string>
        <string name="checkbox">Check Box</string>
        <string name="ringtone">Ring Tone</string>
        <string name="checkbox2">Check Box2</string>
        <string name="text">Text</string>
        <string name="list">List</string>
    </resources>


    the arrays.xml file:
    <?xml version="1.0" encoding="utf-8"?>
    <resources>
    	<string-array name="i_like_array">
    		<item>chocolate</item>
    		<item>television</item>
    		<item>internet</item>
    		<item>nicotine</item>
    		<item>hug</item>
    		<item>Santa Claus</item>
    	</string-array>
    	<string-array name="i_like_array_values">
    		<item>chocolate</item>
    		<item>television</item>
    		<item>internet</item>
    		<item>nicotine</item>
    		<item>hug</item>
    		<item>SantaClaus</item>
    	</string-array>
    </resources>


  6. Page 215,

    I wrote

    "In the case of your production key, enter:
    $ keytool -list -alias alias_name -keystore my-release-key.keystore
    "


    I should have write:
    "In the case of your production key, enter:
    $ keytool -list -alias alias_name -keystore my-release-key.keystore -storepass my-keystore-password -keypass my-key-password
    "
  7. Page 222, 269:

    I wrote :

    <groupId>android</groupId>

    <artifactId>android</artifactId>



    The first groupId is wrong, I should have write:


    <groupId>com.google.android</groupId>

    <artifactId>android</artifactId>


Mathias Séguy
Cette adresse e-mail est protégée contre les robots spammeurs. Vous devez activer le JavaScript pour la visualiser.
Auteur Android2ee.com
Docteur en Mathématiques Fondamentales
Directeur Technique & Avant-vente
Expert Technique de l'Agence Nationale de la Recherche
Rédacteur sur Developpez.com

S'il vous plaît Connexion ou Créer un compte à se joindre à la conversation.

Sauvegarder
Choix utilisateur pour les Cookies
Nous utilisons des cookies afin de vous proposer les meilleurs services possibles. Si vous déclinez l'utilisation de ces cookies, le site web pourrait ne pas fonctionner correctement.
Tout accepter
Tout décliner
Essential
Ces cookies sont nécessaires au bon fonctionnement du site, vous ne pouvez pas les désactiver.
Affichage
Accepter
Analytics
Outils utilisés pour analyser les données de navigation et mesurer l'efficacité du site internet afin de comprendre son fonctionnement.
Google Analytics
Accepter
Décliner