Android names in order

Android resource naming convention

As a developer, there is a good probability that you have used libraries to make code cleaner and easier to use. You have followed certain naming convention like camelCase for Java.

Have you ever done same for values like dimensions, strings? Probably, no. We end up creating lots of items in files & hard to find one, difficult to manage. Resources file names are written in lowercase_underscore. I’ll discuss few naming convention for android resources.

Layout

Layout files should match the name of the Android components that they are intended for but moving the top level component name to the beginning. For example, if we are creating a layout for the SignInActivity, the name of the layout file should be activity_sign_in . xml.

A slightly different case is when we are creating a layout that is going to be inflated by an Adapter, e.g to populate a ListView or Recyclerview. In this case, the name of the layout should start with item_.

Strings

String names start with a prefix that identifies the section they belong to. We use _ for strings naming. to indicate reason of the string will be used & description give any extra information.

  • string name=»label_home»>Home string> : how = label & home is description of the string.
  • Enter Your Name : how = hint & user_name is the description of string.

Drawables

We use _ for strings naming. is Button,Dialog,Divider,Icon, etc & description give any extra information.

Dimensions

Apps should only define a limited set of dimensions, which are constantly reused.

  • : It can be width(in dp), height (in dp), size (if width == height), margin(in dp), padding(in dp), elevation(in dp). text_size(in sp).
  • : It can be any specific item or remove this section if used throughout the application.
  • : It can be dp or sp.

That’s all! Even though this convention doesn’t cover all resource types, it does provide an easy to use solution for the most used ones. Feel free to add more conventions & give suggestion so that I can learn more from your experience.

Thanks for reading! Be sure to click claps below to recommend this article if you liked it.

Источник

List of Android version names

Android versions up to Android 10! 10 got, additionally to their nummeric version number, a code-name, which was assigned by Google. Like the naming of Ubuntu versions (names of animals with an adjective [1] ), Android version names were names of, mostly american, sweets, where the first letter was in alphabetical order.

Читайте также:  Wifi злом для андроид

The assignment of numeric and textual version names are not always consistent. Android 4.0 and Android 4.1, for example, have different version names, but Android 5.0, 5.1 and 5.1.1 share the same version name.

Starting with Android 10! 10, Android versions do not get a codename anymore. Since then, the Android versions will be released with their version number only. [2] [3] [4] [5]

Содержание

Cupcake

The Android version 1500! 1.5 Cupcake is the first version, which got a name assigned, which is Cupcake. Cupcakes are muffin-like cakes, which mostly has a creamy hood.

Donut

Version 1600! 1.6 Donut was given the name Donut.

Eclair

Android-Version 2000! 2 Eclair and 2100! 2.1 Eclair share the same name, Eclair. Eclairs are longly biscuits overdrawn with chocolate.

Froyo

Frozen Yogurt is a ice-like dessert made with milk and yogurt and is also the name of the Android version 2200! 2.2 Froyo.

Gingerbread

The name of Android version 2300! 2.3 «Gingerbread» is Gingerbread, which are cake-like biscuits mostly eaten around christmas time.

Honeycomb

The android version mostly made for tablets, Android 3000! 3.0 Honeycomb, is called Honeycomb. The bootanimation of this android version is also made like a honeycomb.

Ice Cream Sandwich

Android 4.0 is called after a sweet, which is made of delicious ice cream bewtween two biscuits: an Ice Cream Sandwhich.

Jelly Bean

Jelly beans are colorful, mostly made out of sugar, sweets, which have a hard shell and are filled with jelly. The following android versions share this name:

KitKat

KitKat is a brand from Nestle, and is a chocolate bar filled with waffles. Android 4.4 is named after this sweet: 4.4! 4.4 «KitKat».

Lollipop

Lollipops are sweets in different flavors on a stalk and is also the name of the following android versions:

Marshmallow

The android version 6.0, announced at 17th of august in 2015 is called after the sweet Marshmallow.

Nougat

Android 7, also called Android N, officialy got the name Nougat.

Android 8, also called Android O, carries the name Oreo, which are two crispy chocolate cookies with a vanilla cream center.

Android 9, also called Android Pie, carries the name Pie, which is the name of different sweet dishes.

The version 9! 9 was the last Android version which got a codename assigned.

Android 10

Google announced that a new Android Version will be officially known as Android 10.

Источник

Android Versions (Codenames)

Android versions (codenames) are used to describe the various updates for the open source Android mobile operating system. Android versions are developed under dessert-inspired codenames (up until the 2019 Android 10 release), with each new version arriving in alphabetical order with new enhancements and improvements to the Android SDK.

Current List of Android Versions

Here’s a snapshot of the Android updates that have already been released as well as at least one currently in development. Click each link in the brief description below to view the full Webopedia definition.

Читайте также:  Где брать плейлисты для андроид iptv

No Codename (v1.0) – Debuted in Fall 2008: Google Android 1.0 officially arrived September 23rd, 2008, as the only release of Android (so far) to not include a codename

Petit Four (v1.1) – Debuted in February 2009: Android 1.1 “Petit Four” began rolling out in early 2009 as the first update for the new Google Android mobile operating system.

Cupcake (v1.5) – Debuted in April 2009: Key additions: Speech recognition tools, a virtual keyboard, video upload support for YouTube and support for live data feeds and live folders.

Donut (v1.6) – Debuted in Fall 2009: Key additions: Support for CDMA smartphones, additional screen sizes and a text-to-speech engine.

Eclair (v2.0) – Debuted in October 2009: Key additions: Support for multi-touch devices, new browser interface, Microsoft Exchange support, single interface for managing multiple online accounts, soft keys support, and an enhanced camera app (with digital zoom and flash support).

FroYo (v2.2) – Debuted in Fall 2010: Key additions: USB tethering support (for turning a smartphone into a Wi-Fi hotspot), significant speed improvements, Flash 10.1 support, voice dialing over Bluetooth, the ability to store apps on external memory cards, updated browser with Google Chrome’s V8 JavaScript.

Gingerbread (v2.3) – Debuted in December 2010: Key additions: Google Voice over Wi-Fi, enhanced gaming functionality, improved Google Apps.

Honeycomb (v3.0) – Debuted in February 2011: Key additions: A tablet-centric update that delivered a new interface optimized for devices with larger screen sizes (particularly tablets), video chat support based on Google Talk protocols, new System Bar for global status and notifications and Action Bar for application control, tabbed Web browsing, optimized soft keyboard and a new email interface.

Ice Cream Sandwich (v4.0) Debuted in October 2011: Key additions: A smartphone-centric update based on the Linux kernel v3.0.1 that brings many of Honeycomb’s features to smartphones, including Face Unlock facial recognition software, tabbed Web browsing capabilities, unified social networking contacts, 1080p video recording capabilities and video chat support based on Google Talk protocols.

Jelly Bean (v4.1, v4.2 and v4.3) Debuted in June 2012: Key additions: Advanced natural language voice command capabilities akin to Apple’s Siri, enhanced interface and overall responsiveness via “Project Butter,” Google Now support, an improved Web browser, enhanced file management capabilities and more.

KitKat (v4.4) – Debuted in November 2013. Key additions: Full-screen immersive mode, new transitions framework, and “Project Svelte,” a project initiated to reduce the memory needs of the Android OS. Originally internally referred to as Key Lime Pie, Google announced in early September 2013 that it would be using the iconic candy bar as the codename for the 4.4 Android release.

Lollipop (v5.0) – Debuted in November 2014. Key additions: Enhanced Material Design user interface, improved continuity across Android devices, multiple user support, a guest user account option, a new notification system, support for 64-bit CPUs, and more.

Читайте также:  Aimp3 плеер для андроидов

Marshmallow (“M Release”) (v6.0) – Debuted in November 2015. Key additions: Now on Tap functionality and other Google Now enhancements, native fingerprint authentication support, Android Pay integration, USB Type-C support, improved battery life, better app management and more.

Oreo (“O Release”) (v8.0) – Debuted in August 2017. Key additions: Android Go minimized version of Android mobile OS, picture-in-picture video support, Notification Grouping, Bluetooth 5 support, Wi-Fi Aware feature, and more.

Pie (“P Release”) (v9.0) – Debuted in August 2018. Key additions: Adaptive Battery, Digital Well-being Dashboard (monitors screen time usage), App Slices, Intuitive Gestures, Adaptive Brightness, and more.

Android 10 (“Q Release”) (v10.0) – Debuted in September 2019. Key additions: Live Captioning, Smart Reply, Dark Mode, Gesture Navigation, Focus Mode, Family Link, and automatic ongoing security patches and updates.

Источник

Советы по именованию ресурсов в Android

Андроид позволяет держать все текстовые константы в xml файлах. Тоже самое касается и многих других вещей, например, идентификаторов. И если ваше приложение чуть сложнее HelloWorld, то неправильное поименование может сильно повлиять на производительность вашего труда и качество конечного продукта.

Пока я программировал для Андроид, то я сделал для себя пару правил, которые немного улучшают мою жизнь при работе с ресурсами (то самое магическое R):

Имя ресурса должно отображать его суть (самое очевидное правило)

string name =»set_as_wallpaper» > As wallpaper string >

* This source code was highlighted with Source Code Highlighter .

Не ленитесь переименовывать автоматически сгенерированные идентификаторы, ибо они только замусорят остальные идентификаторы почти бессмысленными названиями.

Имя ресурса должно начинаться с его главной логической области

Если строка или идентификатор относятся строго к какому-то контексту (например, Activity), то после логического названия должно идти название этого контекста

Названия должны начинаться с имени файла, в котором они находятся

В большей части это относится к идентификаторам в layout-ах. Это следует делать из-за того, что фрэймворк сваливает все идентификаторы в одну кучу и если этого не делать, то становится сложно разобраться где идентификатор находится «физически».

Название должно идти по уровням

Т.е. главный логический уровень, имя файла, элемент, описание строки

  • dialog_main_button_search (это относится прежде всего к Диалогу. Находится в Activity Main. Это для кнопки. Это надпись поиск)
  • toast_error_while_loading_roller_image (это прежде всего текст для Тоста. Это ошибка. Описание

Итого

Главная выгода такого подхода заключается в быстром поиске через авто-комплит в Eclipse. Если вы, например, определяете меню в коде, то чтобы найти определенный заголовок для какого-то пункта, достаточно набрать R.string.menu_ и вы сразу же увидите все возможные названия. Тоже самое касается поиска view внутри Activity, достаточно набрать R.id.my_activity_name и всё уже как на ладони. Также при таком подходе вам будет намного легче найти где объявлен ресурс.

Если у вас есть какие-либо строковые константы в коде, то не забывайте, что всегда можно простым нажатием Alt+Shift+A быстро перенести их в xml файл.

Источник

Оцените статью