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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值