• Save
Beyond English - Make Your Android App a Global Success
Upcoming SlideShare
Loading in...5
×
 

Beyond English - Make Your Android App a Global Success

on

  • 3,019 views

 

Statistics

Views

Total Views
3,019
Views on SlideShare
2,789
Embed Views
230

Actions

Likes
3
Downloads
0
Comments
0

5 Embeds 230

http://community.developer.motorola.com 224
http://mtrl.lithium.com 3
http://bit.ly 1
http://feeds2.feedburner.com 1
http://webcache.googleusercontent.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Beyond English - Make Your Android App a Global Success Beyond English - Make Your Android App a Global Success Presentation Transcript

  • AnDevCon 2011 Eric Cloninger (@ E i Cl i (@ecmoto) t ) Product Line Manager Motorola M bilit Inc. M t l Mobility, IBeyond English eyo d g sMake Your Android App a Global SuccessMOTOROLA and the Stylized M Logo are trademarks or registered trademarks of Motorola Trademark Holdings, LLC.All other trademarks are the property of their respective owners. © 2011 Motorola Mobility, Inc. All rights reserved.
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 2Online Resources• This presentation at Slideshare net Slideshare.net• bit.ly bundle of all the links mentioned in this presentation – http://bit.ly/eWKHgf © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 3Agenda• Concepts for globalized applications• Layout of an Android project• Folder naming• Locating localized resources• Android runtime support• Tools at your disposal• MOTODEV Studio features for localization• Testing your localized Android app• Publishing to Android Market• Best B t practices ti © 2011 Motorola Mobility, Inc. 9 March 2011 View slide
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 4Terms• Globalization – The process of preparing and delivering software for an international customer base (i.e. Internationalization + Localization)•I t Internationalization (i18 ) ti li ti (i18n) – Should be designed into the product during development • Monetary formats • Time/Date display • Numbers separators • Measurements (imperial vs. metric)• Localization (l10n) ( ) – Translating user interface elements, inputs and outputs so that your customer can use your application in their language of choice – Mostly done after development is complete (or in final phases) © 2011 Motorola Mobility, Inc. 9 March 2011 View slide
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 5ISO Codes• ISO 639 – Language Codes – 639-1 – 2 Digit code from original specification in 1967 (185 entries) – Special cases and ranges for ‘user-defined’ – Convention is to use lower case for Android – en for English, de for German (Deutsch), zh for Chinese• ISO 3166 – C Country Codes t C d – Specifically, ISO 3166-1 alpha-2 – Countries, dependent territories, & areas of geographical interest , p , g g p – Convention is to use upper case for Android – US for United States, DE for Germany, CN for China (PRC) © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 6ISO Codes (cont’d)• ISO 10646 – Universal Character Set – “Not quite the same” as Unicode (Unicode is not controlled by ISO)• ISO 15924 – Names of Systems of Writing ( y g (i.e. scripts) p ) – Four letter code and a number – Latn/215 for Latin, Hani/500 for Han, Cyrl/220 for Cyrillic• ISO 4217 – Names of Currencies C rrencies – USD for US Dollar, EUR for Euro, CNY for Chinese Yuan © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 7Layout of an Android project Non-Localized Localized project with project with default language- language and locale- locale folder names specific folder names © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 8Layout of an Android project• AndroidManifest xml AndroidManifest.xml – Metadata that the Android Market and Package Manager uses to find, install, and launch your app• default.properties, build.properties – Metadata used for building your app, such as the target platform version. build properties is used by Ant version build.properties Ant.• .classpath – Folders used by the Java compiler• .project – Used by Eclipse build system © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 9Layout of an Android project• assets – Non-code components of your app that aren‘t in the /res folder. – Don‘t have a resource ID, so they can‘t be accessed with R. syntax – E Example: a SQLit database that contains initial or default data l SQLite d t b th t t i i iti l d f lt d t• bin, gen – Generated folders where your .apk resides, output from various tools• raw – Audio and video files, which are accessible with R.raw• res – Non-code components, accessible with R. syntax – Layouts, icons, drawables, strings, animations• src © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 10Folder naming• If no localization folders are found folders contain files with found, default values – As a rule, your projects should have defaults – values/strings.xml• When adding a translation, append a hyphen and the 2 digit ISO 639 code for the translated language to the folder name – File names remain the same – values-de/strings.xml• When adding a country, append a hyphen, lower case ‘r’ and the 2 digit ISO 3166 code for the country to the folder name – File names remain the same – values-de-rDE/strings.xml © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 11Folder naming ‘gotchas’• There is no way to add a country modifier by itself. You itself must specify all the languages and duplicate contents. – If you want values-rCA for “all of Canada”, you must specify values- en-rCA and values-fr-rCA• Some notable code and language code variations – Japan: Language is ja country is JP (ja rJP) ja, (ja-rJP) – Korea (ROK): Language is ko, country is KR (ko-rKR) – China (PRC) is zh-rCH (Simplified Chinese) – Taiwan (ROC) is zh-rTW (Traditional Chinese) zh rTW – Hong Kong is zh-rHK (Traditional Chinese) © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 12Locating localized resources• Android searches for a ‘best match , based on precedence best match’• Locale almost always takes precedence – User settings override what the carrier or manufacturer configure – Only exception involves mobile country and network code – Will “cover up” more precise matches • e.g. drawable-de-ldpi will not be used if drawable-de exists e g d a ab e de dp ot d a ab e de e sts• Logic of search – Eliminate resource files that contradict the device configuration – Pick the next highest-precedence qualifier. If no matches, continue searching until one is found. If no matches, use default. – If there are qualifiers based on pixel density, Android will choose the value th t’ closest t th value f th users’ d i l that’s l t to the l for the ’ device © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 13Configuration qualifier precedence• Precedence table is provided at the Android developer site – http://bit.ly/i1rDij Qualifier Q lifi Values/Examples V l /E l MCC and MNC mcc310, mcc310-mnc004, mcc208-mnc00, etc. Language and region en, fr, en-rUS, fr-rFR, fr-rCA , etc. Screen size small, normal large small normal, large, xlarge Screen aspect long, notlong Screen orientation port, land Dock mode car, desk Night mode night, notnight Screen pixel density (dpi) ldpi, mdpi, hdpi, xhdpi, nodpi Touchscreen type notouch, stylus, finger … more online … © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 14Example• This is the device configuration we’re testing we re – Locale = en-GB – Screen orientation = port – Screen pixel density = hdpi – Touchscreen type = notouch – Primary text input method = 12key © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 15Example (cont’d)• These directories each contain different versions of the same named image (e.g. flag.png) – drawable/ – drawable-en/ – drawable-fr-rCA/ – drawable-en-port/ – drawable-en-notouch-12key/ drawable en notouch 12key/ – drawable-port-ldpi/ – drawable-port-notouch-12key/ © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 16Example (cont’d)• Eliminate directories that contradict the device configuration• Eliminate drawable-fr-rCA because it contradicts en-GB – drawable/ – drawable-en/ – drawable-fr-rCA/ – drawable en port/ drawable-en-port/ – drawable-en-notouch-12key/ – drawable-port-ldpi/ – drawable-port-notouch-12key/ p y © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 17Example (cont’d)• Eliminate directories that do not include a language qualifier – drawable/ – drawable-en/ – drawable-fr-rCA/ drawable fr rCA/ – drawable-en-port/ – drawable-en-notouch-12key/ – drawable-port-ldpi/ – drawable-port-notouch-12key/ © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 18Example (cont’d)• Eliminate directories that do not include a screen orientation – drawable/ – drawable-en/ – drawable-fr-rCA/ drawable fr rCA/ – drawable-en-port/ – drawable-en-notouch-12key/ – drawable-port-ldpi/ – drawable-port-notouch-12key/ © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 19minSDKVersion• There are localization improvements in platform 1 6 and 1.6 later, so consider this when choosing minSDKVersion – From the Android dashboard http://bit.ly/fxFY7P Platform API Level Distribution Android 1.5 3 3.9% Android 1.6 4 6.3% Android 2.1 7 31.4% Android 2 2 2.2 8 57.6% 57 6% Android 2.3 9 0.8% Data collected during two weeks ending on February 2, 2011 g y © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 20Android runtime support• Android and Java APIs supporting l10n and i18n• Unicode fonts in Android•I t International Components for Unicode (ICU) i i 1 5+ ti lC t f U i d is in 1.5+ – Constructing locales is different from Android convention (ll_CC) – http://site.icu-project.org/ Platform ICU Version Cupcake/donut/éclair 3.8 Froyo 4.2 Gingerbread 4.4 y Honeycomb 4.6? © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 21Tools at Your Disposal• Eclipse + ADT – Creating localized resources – Extracting strings and caveats – Images with external editor – F5 (Refresh) for drawables changes• Sequoyah project © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 22MOTODEV Studio for Android• A complete development tools package with multiple package, installation use cases (full installer or plugins)• Built on the most recent version of the Eclipse IDE• 100% project compatibility with Eclipse and Google ADT• Designed to work with all Android products• Free download for registered MOTODEV members• Supported on MOTODEV discussion boards• Available today for Windows, Mac OS & Linux © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 23MOTODEV Studio features for localization• Localized to Simplified Chinese Spanish and Portuguese Chinese, Spanish,• Other languages available for Eclipse components (<100%)• Device manager• Integrated emulator• Localization file editor• Code snippets © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 24Testing your localized Android app• Custom Locale app in Google platform emulator builds• Language preference screen• Home Screen Widget• MoreLocale2 (in Android Market)• Language choice in the MOTODEV Studio device manager• Crowd sourcing Crowd-sourcing• MOTODEV App Validator © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 25Publishing to Android Market• Verify your localization efforts when you upload to the Android Market © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 26Best practices for creating globalized apps• Localization Industry Standards Assn http://www lisa org http://www.lisa.org• IBM developerWorks http://bit.ly/fSBBYt• “Lessons Learned” – Localization is usually not a one-time event – Translators may not know your industry / subject matter – Technical terms often aren’t translated – Handle Unicode files with care © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 27 © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 28MOTOROLA MOBILITY DEVELOPER NETWORK• Detailed product specs• Practical advice, technical articles, and documentation• Expert support via forums• Community interaction via blogs, podcasts, and social media• Global news, events, and training• Web: developer.motorola.com• Twitter: @motodev © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 29GET STARTED NOW!• Test Your Apps on the MOTODEV App Validator at http://moto.ly/appvalidator• Join the MOTODEV Community: Ask questions, read our blogs, and network at http://moto.ly/joinmotodev• Join our live chat with technical experts during the MOTODEV Office Hours March 16 2pm PST - Details at http://moto.ly/officehours © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 30Questions• This presentation at Google Docs – http://bit.ly/fWAUq2• Li k to items online at bit l Links t it li t bit.ly – http://bit.ly/bundles/mtdvstudio/1 – http://bit ly/eWKHgf http://bit.ly/eWKHgf• MOTODEV – MOTODEV Studio http://bit.ly/hJW5fm – MOTODEV discussion boards http://bit.ly/hxzIAY – MOTODEV Fast-track partners http //bit l /gh8K n Fast track http://bit.ly/gh8Kxn © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 31 LIFE. POWERED. © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 32 PageLicensesSource code examples displayed in this presentation may be licensed under Apache License,Version 2 as follows:Copyright © 2010, Android Open Source Project. All rights reserved unless otherwise explicitly indicated.Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except incompliance with the License. You may obtain a copy of the License at p y pyhttp://www.apache.org/licenses/LICENSE-2.0.Unless required by applicable law or agreed to in writing, software distributed under the License isdistributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eitherexpress or implied. See the License for the specific language governing permissions and limitations underthe License. © 2011 Motorola Mobility, Inc. 9 March 2011
  • AnDevCon 2011 Beyond English – Make Your Android App a Global Success Page 33 PageLicensesSource code examples displayed in this presentation may be licensed under BSD License, asfollows:Copyright © 2010-2011, Motorola Mobility, Inc. All rights reserved except as otherwise explicitly indicated.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the followingconditions are met:Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer inthe documentation and/or other materials provided with the distribution.Neither the name of the Motorola Mobility Inc nor the names of its contributors may be used to endorse or promote products Mobility, Inc.derived from this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESSOR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITYAND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER ORCONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY OR DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ORSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANYTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OROTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITYOF SUCH DAMAGE. © 2011 Motorola Mobility, Inc. 9 March 2011