学习笔记1--Android应用&Android studio项目结构

来源:互联网 发布:淘宝如何取消超级推广 编辑:程序博客网 时间:2024/06/06 05:57

Android 应用概述

Android应用有四大组件:Activity、service、Broadcast Receiver 和 Content Provider.
Android程序设计讲究逻辑和视图分离,从而引入了layout.xml 在逻辑中通过setContentView(R.layout.xml)来加载

Android创建一个应用

  • 安装集成工具,android studio 、jdk、sdk
  • new一个project:
    1 package name 项目的包名:Android通过包名来区分应用程序
    2 选择SDK 版本
    3 创建 Activity name

Android studio的project文件目录

  • app
    • builde
    • libs
    • java
    • res
    • AndroidManifest.xml
  • build
    • build.gradle
      • apply plugin : “com.example.helloworld”
      • android {
        compileSdkVersion “24.0.2”
        buildToolsVersion “24.0.2”
        defaultConfig {}
        buildTypes {}
        }
      • dependncies { //依赖方式:本地依赖、库依赖和远程依赖
        cpmpile fileTree (dir: ‘libs’, include: [‘*.jar’])
        compile ‘com.android.support:appcompat-v7:24.2.1’
        testComile ’ ’
        }

Android 日志工具

log.d logcat
0 0
原创粉丝点击