<Mastering Android Application Development> - Note 01

来源:互联网 发布:织梦网站源码下载 编辑:程序博客网 时间:2024/04/25 20:50



Chapter 1: Getting Started


Introducing Material Design

The material is a metaphor of an element that can be seen on the surface; it consists of layers that can have different heights and widths, but their thickness is always one unit, as with sheets of paper.


  • We can place materials above each other, which introduces a depth element to the view, aZ coordinate.
  • The content is displayed on the materials but they don't add thickness to it.
  • The material can expand and the content can expand with it, but the content can never expand more than the material.


Question: what does that thickness thing mean?


Design support library is a must have library that includes animations, FAB (Floating Action Button), and the navigation drawer.



Chapter 2: Designing our App

Selecting an app-navigation pattern

Basic structure

For more information on the app structure and similar information on material design, refer to the following links:

  • https://developer.android.com/design/patterns/appstructure.html
  • http://www.google.com/design/spec/patterns/appstructure.html#


The dashboard pattern



The sliding panel

This pattern is perfect if we have a large number of options at the same level in our app, and it can be combined with other patterns.

The implementation of this panel can be done with the DrawerLayout class, which is composed of two child views: a FrameLayout with the content and the navigation drawer, which can be ListView or any other custom layout containing the options.



Tabs

It shows a fixed menu with components at the same level. Note that when we have tabs, the menu is always visible, which doesn't happen in the sliding and dashboard patterns.




Fragments

Understanding the importance of fragments

It is important to explain why Android examples create the fragments using the MyFragment.newInstance(params) factory method:


Android only recreates Fragments using the default constructor; therefore, if we have a constructor with parameters, it will be ignored, and the parameters will be lost.


Question: ?


The Fragment Manager

Any operation, such as adding, replacing, removing, or finding a fragment, has to be done through Fragment Manager inside an activity.


Fragments stack


ViewPager

Adapter

ViewPager works with an adapter; the adapter is the element in charge of creating every page that we swipe.


Transitions

  • For the transitions between activities, we need to call overridePendingTransition just before starting the new activity. The method receives two animations as parameters, and these animations can be in an XML file created by us or be chosen from the already created animations in Android.
  • In the case of fragments, we need to specify the transition in the FragmentTransaction object. Using the object animator, we can define this in two XML files.



Chapter 3: Creating and Accessing Content from the Cloud

Creating your own cloud database

Parse

...


Android's Application class

  • Override the onCreate method he onCreate method is called every time our Application is created; therefore, it's the right place to initialize our libraries and third-party SDKs.
  • We need to tell our app that we have a new Application class and that that's the one we want to use;
  • If we need a global variable in our app that needs to be accessed by all Activities/Fragments, this would be the right place to have it.


Storing and consuming content from Parse



Chapter 7: Image Handling and Memory Management

...


Mastering images

Vector drawables



Chapter 8: Databases and Loaders

...


Content providers







0 0
原创粉丝点击