Home | History | Annotate | Download | only in porting
      1 page.title=Customization
      2 pdk.version=1.0
      3 doc.type=porting
      4 @jd:body
      5 
      6 <div id="qv-wrapper">
      7 <div id="qv">
      8 <h2>In this document</h2>
      9 <a name="toc"/>
     10 <ul>
     11 <li><a href="#androidBootScreenCustomization">Boot Screen Customization</a></li>
     12 <li><a href="#androidNetCustPlat">Network Customization Platform</a></li>
     13 <li><a href="#androidCustomizingPre-LoadedApps">Customizing pre-loaded applications</a></li> 
     14 <li><a href="#androidBrowserBookmarks">Customizing browser bookmarks</a></li> 
     15 <li><a href="#androidEmailProviderCustomization">Email Provider Customization</a></li>
     16 <li><a href="#androidThemes">Platform Themes</a></li>
     17 </ul>
     18 </div>
     19 </div>
     20 
     21 
     22  
     23 <a name="androidBootScreenCustomization"></a><h3>Boot Screen Customization</h3> 
     24  
     25 <p>At startup, Android displays a splashscreen image while booting the device. Do the following if you wish to modify the default splash screen:</p> 
     26 <p> 
     27 <ol><li>Create a 320x480 image, <code>splashscreen.jpg</code> in this example.</li> 
     28 <li>Using ImageMagick, convert your .jpg file to .r format:
     29 <pre class="prettify"> 
     30 convert screen.jpg screen.r
     31 </pre> 
     32 </li> 
     33 <li>Use the rgb2565 application to convert the image to 565 format:
     34 <pre class="prettify"> 
     35 rgb2565 < screen.rgb > screen.565
     36 </pre> 
     37 </li> 
     38 <li>Use fastboot to flash the image to the device:
     39 <pre class="prettify"> 
     40 fastboot flash splash1 screen.565
     41 </pre> 
     42 </li> 
     43 </ol> 
     44  
     45  
     46 <a name="androidNetCustPlat"></a><h3>Network Customization Platform</h3> 
     47  
     48  
     49  
     50 <a name="androidNetCustPlatNetworkConfig"></a><h4>Network Configuration</h4> 
     51  
     52 <p>Android stores network configurations as a resource that gets compiled into binary at form at build time. The XML representation of this resource is located at <code>//android/frameworks/base/core/res/res/xml/apns.xml</code>. This file does not include any configured APNs. You should not modify this file, but instead configure APNs by product at build time (see Build-time APN Configuration below).</p> 
     53 <p>Each network configuration is stored in an XML element following this syntax:</p> 
     54 <pre class="prettify"> 
     55 &lt;apn carrier="T-Mobile US"
     56          mcc="310"
     57          mnc="260"
     58          apn=" wap.voicestream.com"
     59          user="none"
     60          server="*"
     61          password="none"
     62          proxy=" 216.155.165.50"
     63          port="8080"
     64          mmsc="http://216.155.174.84/servlets/mms"
     65 /&gt;
     66 </pre> 
     67  
     68  
     69 <a name="androidNetCustPlatAPNConfig"></a><h4>Build-time APN configuration</h4> 
     70  
     71 <p>To set the APN configuration for a particular product target, add an <code>apns-conf.xml</code> file to the product configuration (do not modify the default platform APNs). This allows multiple products, all with different APNs, to be built off the same code base.  </p> 
     72  
     73 <p>To configure APNs at the product level, add a line to the product configuration file like the example below (<code>vendor/&lt;vendor_name&gt;/products/myphone-us.mk</code>): </p> 
     74  
     75 <pre class="prettify"> 
     76 PRODUCT_COPY_FILES := vendor/acme/etc/apns-conf-us.xml:system/etc/apns-conf.xml
     77 </pre> 
     78  
     79  
     80  
     81 <a name="androidNetCustPlatAPNRunTime"></a><h4>APN configuration at run time</h4> 
     82  
     83 <p>At runtime, the Android reads APNs from the following file:</p> 
     84 <pre class="prettify"> 
     85 system/etc/apns-conf.xml
     86 </pre> 
     87  
     88 <p>Android supports the following run-time network configuration methods to choose the appropriate APN from the list of configured APNs:</p> 
     89 <p><ul> 
     90 <li><b>Automatic Configuration</b>: At boot time, Android determines the correct network configuration based on the MCC and MNC from the SIM card and automatically configure all network settings.</li> 
     91 <li><b>Manual Configuration</b>: The platform will also support runtime (user) manual selection of network settings by name, for example, "Company Name US," and will support manual network configuration entry.</li> 
     92 <li><b>WAP / SMS Push Configuration</b>: The network configurations are standard Android resources. You can upgrade a resource at runtime by installing a new system resource APK package. It will be possible to develop a network configuration service which listens to a specific binary SMS port for binary SMS messages containing the network configurations.  NOTE: The implementation will likely be network operator dependent due to inconsistent SMS ports, binary SMS formats, etc.</li> 
     93 </ul> 
     94  
     95  
     96  
     97  
     98 <a name="androidCustomizingPre-LoadedApps"></a><h3>Customizing pre-loaded applications</h3> 
     99  
    100 <p>To customize the list of Android packages for a particular product (applications, input methods, providers, services, etc.), set <code>PRODUCT_PACKAGES</code> property in the product configuration, as illustrated below:</p> 
    101  
    102 <pre class="prettify"> 
    103 PRODUCT_PACKAGES := \
    104  &lt;company_name&gt;Mail \
    105     &lt;company_name&gt;IM \
    106  &lt;company_name&gt;HomeScreen \
    107  &lt;company_name&gt;Maps \
    108  &lt;company_name&gt;SystemUpdater
    109 </pre> 
    110  
    111 <p>Package names should correspond to the <code>LOCAL_PACKAGE_NAME</code> specified for each package's build target. For example, the <code>Android.mk</code> build target for &lt;company_name&gt;Mail, referenced above, could look like this:
    112  
    113 <pre class="prettify"> 
    114 # Build the &lt;company_name&gt;Mail application
    115 LOCAL_PATH:= $(call my-dir)
    116 include $(CLEAR_VARS)
    117  
    118 LOCAL_MODULE_TAGS := user development
    119  
    120 LOCAL_SRC_FILES := $(call all-java-files-under,src,tests)
    121  
    122 LOCAL_STATIC_JAVA_LIBRARIES := &lt;company_name&gt;login-client
    123  
    124 # Specify the package name
    125 LOCAL_PACKAGE_NAME := &lt;company_name&gt;Mail
    126  
    127 # Specify the certificate used to sign the application
    128 LOCAL_CERTIFICATE := vendor/&lt;company_name&gt;/certs/app
    129  
    130 include $(BUILD_PACKAGE)
    131  
    132 # Build the login client static library
    133 include $(LOCAL_PATH)/client/Android.mk
    134 </pre> 
    135  
    136 <p>Note that the home screen is just an Android application that can be replaced entirely or customized by changing source code and application resources (Java source, layouts, etc.).</p> 
    137  
    138  
    139  
    140 <a name="androidBrowserBookmarks"></a><h3>Customizing browser bookmarks</h3> 
    141  
    142 <p>Browser bookmarks are stored as string resources in the Browser application: <code>//android/packages/apps/Browser/res/values/strings.xml</code>.  Bookmarks are defined as simple value string arrays called &quot;bookmarks&quot;.  Each bookmark entry is stored as a pair of array values; the first represents the bookmark name and the second the bookmark URL.  For example:</p> 
    143 <pre class="prettify"> 
    144 &lt;!-- Bookmarks --&gt;
    145 &lt;string-array name=&quot;bookmarks&quot;&gt;
    146     &lt;item&gt;Google&lt;/item&gt;
    147     &lt;item&gt;http://www.google.com/</item>;
    148     &lt;item&gt;Yahoo!&lt;/item&gt;
    149     &lt;item&gt;http://www.yahoo.com/</item>;
    150     &lt;item&gt;MSN&lt;/item&gt;
    151     &lt;item&gt;http://www.msn.com/</item>;
    152     &lt;item&gt;MySpace&lt;/item&gt;
    153     &lt;item&gt;http://www.myspace.com/</item>;
    154     &lt;item&gt;Facebook&lt;/item&gt;
    155     &lt;item&gt;http://www.facebook.com/</item>;
    156     &lt;item&gt;Wikipedia&lt;/item&gt;
    157     &lt;item&gt;http://www.wikipedia.org/</item>;
    158     &lt;item&gt;eBay&lt;/item&gt;
    159     &lt;item&gt;http://www.ebay.com/</item>;
    160     &lt;item&gt;CNN&lt;/item&gt;
    161     &lt;item&gt;http://www.cnn.com/</item>;
    162     &lt;item&gt;New York Times&lt;/item&gt;
    163     &lt;item&gt;http://www.nytimes.com/</item>;
    164     &lt;item&gt;ESPN&lt;/item&gt;
    165     &lt;item&gt;http://espn.go.com/</item>;
    166     &lt;item&gt;Amazon&lt;/item&gt;
    167     &lt;item&gt;http://www.amazon.com/</item>;
    168     &lt;item&gt;Weather Channel&lt;/item&gt;
    169     &lt;item&gt;http://www.weather.com/</item>;
    170     &lt;item&gt;BBC&lt;/item&gt;
    171     &lt;item&gt;http://www.bbc.co.uk/</item>;
    172 &lt;/string-array&gt;
    173 </pre> 
    174 <p>Like and Android application resource, the platform will load alternate resources based on the platform configuration values.  See <a href="http://developer.android.com/guide/topics/resources/resources-i18n.html">Resources and Internationalization</a> in the Android SDK for details.  To configure bookmarks for a specific mobile network operator, place your customized bookmarks in a separate <code>strings.xml</code> file and place it under a Mobile Network Code (MNO) specific resource folder.  For example, <code>Browser/res/values-mccXXX-mncYYY/strings.xml</code> where XXX and YYY represent the three-digit MCC and two to three digit MNC values.</p> 
    175 <p>Android loads any configuration-specific resources as override values for the default values, so it is only necessary to include the bookmarks string-array values in this file.</p> 
    176  
    177  
    178  
    179 <a name="androidEmailProviderCustomization"></a>
    180 <h3>Email Provider Customization</h3> 
    181  
    182 <p>The default email provider settings are stored as string resources in the Email application (<code>//android/packages/apps/Email/res/xml/providers.xml</code>) as illustrated below.</p> 
    183 <p>&lt;providers&gt;</p> 
    184 <pre class="prettify"> 
    185 &lt;!-- Gmail variants --&gt;
    186     &lt;provider id=&quot;gmail&quot; label=&quot;Gmail&quot; domain=&quot;gmail.com&quot;&gt;
    187         &lt;incoming uri=&quot;imap+ssl+://imap.gmail.com&quot; username=&quot;$email&quot;/&gt;
    188         &lt;outgoing uri=&quot;smtp+ssl+://smtp.gmail.com&quot; username=&quot;$email&quot;/&gt;
    189     &lt;/provider&gt;
    190     &lt;provider id=&quot;googlemail&quot; label=&quot;Google Mail&quot; domain=&quot;googlemail.com&quot;&gt;
    191         &lt;incoming uri=&quot;imap+ssl+://imap.googlemail.com&quot; username=&quot;$email&quot;/&gt;
    192         &lt;outgoing uri=&quot;smtp+ssl+://smtp.googlemail.com&quot; username=&quot;$email&quot;/&gt;
    193     &lt;/provider&gt;
    194     &lt;provider id=&quot;google&quot; label=&quot;Google&quot; domain=&quot;google.com&quot;&gt;
    195         &lt;incoming uri=&quot;imap+ssl+://imap.gmail.com&quot; username=&quot;$email&quot;/&gt;
    196         &lt;outgoing uri=&quot;smtp+ssl+://smtp.gmail.com&quot; username=&quot;$email&quot;/&gt;
    197     &lt;/provider&gt;
    198     &lt;provider id=&quot;android&quot; label=&quot;Android&quot; domain=&quot;android.com&quot;&gt;
    199         &lt;incoming uri=&quot;imap+ssl+://imap.gmail.com&quot; username=&quot;$email&quot;/&gt;
    200         &lt;outgoing uri=&quot;smtp+ssl+://smtp.gmail.com&quot; username=&quot;$email&quot;/&gt;
    201     &lt;/provider&gt;</p> 
    202  
    203     &lt;!-- Common US providers --&gt;
    204     
    205     &lt;provider id=&quot;aim&quot; label=&quot;AIM&quot; domain=&quot;aim.com&quot;&gt;
    206         &lt;incoming uri=&quot;imap://imap.aim.com&quot; label=&quot;IMAP&quot; username=&quot;$email&quot;/&gt;
    207         &lt;outgoing uri=&quot;smtp://smtp.aim.com:587&quot; username=&quot;$email&quot;/&gt;
    208     &lt;/provider&gt;
    209     &lt;provider id=&quot;aol&quot; label=&quot;AOL&quot; domain=&quot;aol.com&quot;&gt;
    210         &lt;incoming uri=&quot;imap://imap.aol.com&quot; label=&quot;IMAP&quot; username=&quot;$email&quot;/&gt;
    211         &lt;outgoing uri=&quot;smtp://smtp.aol.com:587&quot; username=&quot;$email&quot;/&gt;
    212     &lt;/provider&gt;
    213     &lt;provider id=&quot;comcast&quot; label=&quot;Comcast&quot; domain=&quot;comcast.net&quot;&gt;
    214         &lt;incoming uri=&quot;pop3+ssl+://mail.comcast.net&quot; username=&quot;$user&quot;/&gt;
    215         &lt;outgoing uri=&quot;smtp+ssl+://smtp.comcast.net&quot; username=&quot;$user&quot;/&gt;
    216     &lt;/provider&gt;
    217     &lt;provider id=&quot;compuserve&quot; label=&quot;CompuServe&quot; domain=&quot;cs.com&quot;&gt;
    218         &lt;incoming uri=&quot;imap://imap.cs.com&quot; username=&quot;$user&quot;/&gt;
    219         &lt;outgoing uri=&quot;smtp://smtp.cs.com&quot; username=&quot;$user&quot;/&gt;
    220     &lt;/provider&gt;
    221     &lt;provider id=&quot;dotmac&quot; label=&quot;.Mac&quot; domain=&quot;mac.com&quot;&gt;
    222         &lt;incoming uri=&quot;imap+tls://mail.mac.com&quot; username=&quot;$email&quot;/&gt;
    223         &lt;outgoing uri=&quot;smtp+tls://smtp.mac.com&quot; username=&quot;$email&quot;/&gt;
    224     &lt;/provider&gt;
    225     &lt;provider id=&quot;earthlink&quot; label=&quot;Earthlink&quot; domain=&quot;earthlink.net&quot;&gt;
    226         &lt;incoming uri=&quot;pop3://pop.earthlink.net&quot; username=&quot;$email&quot;/&gt;
    227         &lt;outgoing uri=&quot;smtp://smtpauth.earthlink.net:587&quot; username=&quot;$email&quot;/&gt;
    228     &lt;/provider&gt;
    229     &lt;provider id=&quot;juno&quot; label=&quot;Juno&quot; domain=&quot;juno.com&quot;&gt;
    230         &lt;incoming uri=&quot;pop3://pop.juno.com&quot; username=&quot;$user&quot;/&gt;
    231         &lt;outgoing uri=&quot;smtp://smtp.juno.com&quot; username=&quot;$user&quot;/&gt;
    232     &lt;/provider&gt;
    233     &lt;provider id=&quot;live&quot; label=&quot;Windows Live Hotmail Plus&quot; domain=&quot;live.com&quot; note=&quot;@string/provider_note_live&quot;&gt;
    234         &lt;incoming uri=&quot;pop3+ssl+://pop3.live.com&quot; username=&quot;$email&quot;/&gt;
    235         &lt;outgoing uri=&quot;smtp+tls+://smtp.live.com&quot; username=&quot;$email&quot;/&gt;
    236     &lt;/provider&gt;
    237     &lt;provider id=&quot;hotmail&quot; label=&quot;Windows Live Hotmail Plus&quot; domain=&quot;hotmail.com&quot; note=&quot;@string/provider_note_live&quot;&gt;
    238         &lt;incoming uri=&quot;pop3+ssl+://pop3.live.com&quot; username=&quot;$email&quot;/&gt;
    239         &lt;outgoing uri=&quot;smtp+tls+://smtp.live.com&quot; username=&quot;$email&quot;/&gt;
    240     &lt;/provider&gt;
    241     &lt;provider id=&quot;msn&quot; label=&quot;Windows Live Hotmail Plus&quot; domain=&quot;msn.com&quot; note=&quot;@string/provider_note_live&quot;&gt;
    242         &lt;incoming uri=&quot;pop3+ssl+://pop3.live.com&quot; username=&quot;$email&quot;/&gt;
    243         &lt;outgoing uri=&quot;smtp+tls+://smtp.live.com&quot; username=&quot;$email&quot;/&gt;
    244     &lt;/provider&gt;
    245     &lt;provider id=&quot;mobileme&quot; label=&quot;MobileMe&quot; domain=&quot;me.com&quot;&gt;
    246         &lt;incoming uri=&quot;imap+tls://mail.me.com&quot; username=&quot;$email&quot;/&gt;
    247         &lt;outgoing uri=&quot;smtp+tls://smtp.me.com&quot; username=&quot;$email&quot;/&gt;
    248     &lt;/provider&gt;
    249     &lt;provider id=&quot;netzero&quot; label=&quot;NetZero&quot; domain=&quot;netzero.com&quot;&gt;
    250         &lt;incoming uri=&quot;pop3://pop.netzero.com&quot; username=&quot;$user&quot;/&gt;
    251         &lt;outgoing uri=&quot;smtp://smtp.netzero.com&quot; username=&quot;$user&quot;/&gt;
    252     &lt;/provider&gt;
    253     &lt;provider id=&quot;sbcglobal&quot; label=&quot;SBC Global&quot; domain=&quot;sbcglobal.net&quot;&gt;
    254         &lt;incoming uri=&quot;pop3://pop.sbcglobal.yahoo.com&quot; username=&quot;$email&quot;/&gt;
    255         &lt;outgoing uri=&quot;smtp://smtp.sbcglobal.yahoo.com&quot; username=&quot;$email&quot;/&gt;
    256     &lt;/provider&gt;
    257     &lt;provider id=&quot;verizon&quot; label=&quot;Verizon&quot; domain=&quot;verizon.net&quot;&gt;
    258         &lt;incoming uri=&quot;pop3://incoming.verizon.net&quot; username=&quot;$user&quot;/&gt;
    259         &lt;outgoing uri=&quot;smtp://outgoing.verizon.net&quot; username=&quot;$user&quot;/&gt;
    260     &lt;/provider&gt;
    261     &lt;provider id=&quot;yahoo&quot; label=&quot;Yahoo Plus&quot; domain=&quot;yahoo.com&quot; note=&quot;@string/provider_note_yahoo&quot;&gt;
    262         &lt;incoming uri=&quot;pop3+ssl+://plus.pop.mail.yahoo.com&quot; username=&quot;$user&quot;/&gt;
    263         &lt;outgoing uri=&quot;smtp+ssl+://plus.smtp.mail.yahoo.com&quot; username=&quot;$user&quot;/&gt;
    264     &lt;/provider&gt;
    265   
    266     &lt;!-- Common UK providers --&gt;
    267     
    268     &lt;provider id=&quot;aol-uk&quot; label=&quot;AOL&quot; domain=&quot;aol.co.uk&quot;&gt;
    269         &lt;incoming uri=&quot;imap+ssl+://imap.uk.aol.com&quot; label=&quot;IMAP&quot; username=&quot;$user&quot;/&gt;
    270         &lt;outgoing uri=&quot;smtp+ssl+://smtp.uk.aol.com&quot; username=&quot;$user&quot;/&gt;
    271     &lt;/provider&gt;
    272     &lt;provider id=&quot;bt&quot; label=&quot;BT Internet&quot; domain=&quot;btinternet.com&quot;&gt;
    273         &lt;incoming uri=&quot;pop3://mail.btinternet.com&quot; username=&quot;$email&quot;/&gt;
    274         &lt;outgoing uri=&quot;smtp://mail.btinternet.com&quot; username=&quot;&quot;/&gt;
    275     &lt;/provider&gt;
    276     &lt;provider id=&quot;tiscali&quot; label=&quot;Tiscali&quot; domain=&quot;tiscali.co.uk&quot;&gt;
    277         &lt;incoming uri=&quot;pop3://pop.tiscali.co.uk&quot; username=&quot;$email&quot;/&gt;
    278         &lt;outgoing uri=&quot;smtp://smtp.tiscali.co.uk&quot; username=&quot;$email:wq&quot;/&gt;
    279     &lt;/provider&gt;
    280     &lt;provider id=&quot;yahoo-uk&quot; label=&quot;Yahoo&quot; domain=&quot;yahoo.co.uk&quot; note=&quot;@string/provider_note_yahoo_uk&quot;&gt;
    281         &lt;incoming uri=&quot;pop3+ssl+://pop.mail.yahoo.co.uk&quot; username=&quot;$user&quot;/&gt;
    282         &lt;outgoing uri=&quot;smtp+ssl+://smtp.mail.yahoo.co.uk&quot; username=&quot;$user&quot;/&gt;
    283     &lt;/provider&gt;
    284     
    285     &lt;!-- Common Germany providers --&gt;
    286     
    287     &lt;provider id=&quot;freenet&quot; label=&quot;Freenet&quot; domain=&quot;freenet.de&quot;&gt;
    288         &lt;incoming uri=&quot;pop3://mx.freenet.de&quot; username=&quot;$user&quot;/&gt;
    289         &lt;outgoing uri=&quot;smtp+ssl://mx.freenet.de&quot; username=&quot;$email&quot;/&gt;
    290     &lt;/provider&gt;
    291     &lt;provider id=&quot;gmx&quot; label=&quot;GMX&quot; domain=&quot;gmx.de&quot;&gt;
    292         &lt;incoming uri=&quot;pop3+tls://pop.gmx.net&quot; username=&quot;$email&quot;/&gt;
    293         &lt;outgoing uri=&quot;smtp+tls://mail.gmx.net&quot; username=&quot;$email&quot;/&gt;
    294     &lt;/provider&gt;
    295     &lt;provider id=&quot;T-Online&quot; label=&quot;T-Online&quot; domain=&quot;t-online.de&quot; note=&quot;@string/provider_note_t_online&quot;&gt;
    296         &lt;incoming uri=&quot;pop3://popmail.t-online.de&quot; username=&quot;$email&quot;/&gt;
    297         &lt;outgoing uri=&quot;smtp://smtpmail.t-online.de&quot; username=&quot;$email&quot;/&gt;
    298     &lt;/provider&gt;
    299     &lt;provider id=&quot;web.de&quot; label=&quot;Web.de&quot; domain=&quot;web.de&quot;&gt;
    300         &lt;incoming uri=&quot;pop3+tls://pop3.web.de&quot; username=&quot;$user&quot;/&gt;
    301         &lt;outgoing uri=&quot;smtp+tls://smtp.web.de&quot; username=&quot;$user&quot;/&gt;
    302     &lt;/provider&gt;
    303 &lt;/providers&gt;
    304 </pre> 
    305 <p>As with all Android application resources, the platform will load alternate resources based on the platform configuration values.  See <a href="http://developer.android.com/guide/topics/resources/resources-i18n.html">Resources and Internationalization</a> in the Android SDK for details.  To configure email providers for a specific mobile network operator, place the customized providers in a separate <code>providers.xml</code> file and place it under  a Mobile Network Code (MNO) specific resource folder.  For example, <code>Email/res/xml-mccXXX-mncYYY/providers.xml</code> where XXX and YYY represent the three-digit MCC and two to three digit MNC values.</p> 
    306  
    307  
    308  
    309 <a name="androidThemes"></a><h3>Platform Themes</h3> 
    310  
    311  
    312  
    313 <a name="androidThemesStyles"></a><h4>Themes and Styles</h4> 
    314  
    315 <p>System level styles are defined in <code>//android/framework/base/core/res/res/values/styles.xml</code>.</p> 
    316  
    317  
    318 <a name="androidThemesAnimations"></a><h4>Animations</h4> 
    319  
    320 <p>Android supports configurable animations for window and view transitions.  System-level animations are defined in XML in global resource files located in <code>//android/framework/base/core/res/res/anim/</code>.</p> 
    321  
    322