1.4 Learn to help yourself

1.4: Learn to help yourself

In this codelab, you learn about resources that are helpful to Kotlin Android developers, including templates, documentation, videos, and sample apps.

First you create a simple app from an Android Studio template and modify the app. Then you download and explore the Android Sunflower sample app. You replace the sample app’s launcher icon (a sunflower) with a clip-art image asset that’s available within Android Studio (a smiley face).

3. Task: Use project templates

Architecture of the Basic Activity template

在这里插入图片描述

#UI descriptionCode reference
1Status bar, which the Android system provides and controls.Not visible in the template code, but you can access the status-bar from your activity.
2The app bar, also called the action bar, provides visual structure, standardized visual elements, and navigation.In activity_main.xml, look for Toolbar inside the AppBarLayout element. For backward compatibility, the AppBarLayout in the template embeds a Toolbar that has the same functionality as an ActionBar.To change the appearance of the app bar, change the toolbar attributes. For app bar tutorials, see Add the app bar.
3The app name is initially derived from your package name, but you can change it to anything you want.In AndroidManifest.xml, look for android:label="@string/app_name".Specify the app_name string in strings.xml.
4The options-menu overflow button holds menu items for the activity. The overflow button also holds global menu options such as Search and Settings for the app. Your app menu items go into this menu.In MainActivity.kt, the onOptionsItemSelected() method implements what happens when the user selects a menu item.To see the options-menu items, open the res/menu/menu_main.xml file. Only the Settings menu item is specified in this template.
5The CoordinatorLayout ViewGroup is a layout that provides mechanisms for UI elements to interact. Your app’s UI goes inside the content_main.xml file, which is included within this ViewGroup.In activity_main.xml, look for the include layout instruction. No views are specified in this layout; instead, the layout includes the content_main layout, where the app’s views are specified. System views are kept separate from the views unique to your app.
6The template uses a TextView to display “Hello World”.The “Hello World” text view is in the content_main.xml file. All your app’s UI elements should be defined in this file.
7Floating action button (FAB)In activity_main.xml, look for the FloatingActionButton element. The FAB is defined as a UI element using a clip-art icon. MainActivity.kt includes a stub in onCreate() that sets an onClick() listener for the FAB.

5. Task: Explore docs and other resources

Go to developer.android.com. This official Android developer documentation is kept current by Google.
Go to developer.android.com/design/. This site offers guidelines for designing the look and functionality of high-quality Android apps.
Go to material.io, which is a site about Material Design. Material Design is a conceptual design philosophy that outlines how all apps, not just Android apps, should look and function on mobile devices. Navigate the links to learn more about Material Design. For example, to learn about the use of color, click the Design tab, then select Color.
Go to developer.android.com/docs/ to find API information, reference documentation, tutorials, tool guides, and code samples.
Go to developer.android.com/distribute/ to find information about publishing an app on Google Play. Google Play is Google’s digital distribution system for apps developed with the Android SDK. Use the Google Play Console to grow your user base and start earning money.

Explore the Android Developer YouTube channel, which is a great source of tutorials and tips.
Visit the official Android blog, where the Android team posts news and tips.
Enter a question into Google Search, and the Google Search engine collects relevant results from various resources. For example, use Google Search to ask the question, “What is the most popular Android OS version in India?” You can even enter error messages in Google Search.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值