zoukankan      html  css  js  c++  java
  • android(2)——Structure of an Android Application

    1 structure of an android application

    An Android application is primarily made up of three pieces: the application descriptor, a collection of various resources, and the application's source code.

    It is also worth noting a few constraints regarding resources.

    • Android supports only a linear list of files within the predefined folders under res.
    • The contents of the assets folders are not considered resources, but the files within raw under res are.

    2 Dissecting the Application

    1. Android defines an entry-point activity, also called the top-level activity.
    2. When an Android app is asked to run ,the host loads the application and reads the AndroidManifest.xml file. It then looks for, and starts, an activity or activities with an intent-filter that has the MAIN action with a category of LAUNCHER.
    3. Once the entry-point activity is determined, the host starts the activity and the onCreate() method is called.
    4. Activities in Android are usually started with an intent , and one activity can start another activity.
    5. Activities have a defined lifecycle. They are maintained on an activity, with the running activity at the top. If the running activity starts another activity, the first running activity moves down the stack and the new activity is placed on the top.
    6. ContentProvider class defines six abstract methods, four of which are CRUD(Create, Read, Update, Delete)operations. The other two abstract methods are onCreate() and getType().  onCreate() is called when the content provider is created for the first time; getType() provides the MIME type for the result set.
    7. DatabaseHelper class
  • 相关阅读:
    vps安装wordpress遇到的问题(lnmp)
    RING0,RING1,RING2,RING3
    CentOS 下配置CUPS
    怎样解决VS2013模块对于SAFESEH 映像是不安全的
    【转】VC6.0打开或者添加工程文件崩溃的解决方法
    QWidget QMainWindow QDialog 三个基类的区别
    在C语言中,double、long、unsigned、int、char类型数据所占字节数
    拷贝构造函数
    “浅拷贝”与“深拷贝”
    常用软件列表
  • 原文地址:https://www.cnblogs.com/suzhou/p/3638974.html
Copyright © 2011-2022 走看看