Creating an Android Project 创建一个Android项目 An Android project contains all the files that comprise the source code for your Android app. The Android SDK tools make it easy to start a new Android project with a set of default project directories and fi…
最近在自学android,抽空把官方文档的guide跟training差不多看了一遍,又对比了一些书籍,感觉还是官方文档讲得比较好,所以自己计划把官方文档翻译一下,方便自己的知识巩固以及复习查找,由于英文不是非常好,所以翻译得不是很好,有不好的地方欢迎大家指出哈, 由于之前已经看过官方文档了,感觉最佳的路线是跟着官方training操作,遇到知识点或者不懂的再去guide跟reference中查找阅读,所以先从trainging翻译起了.针对官方文档,在翻译的基础上加入了一些自己的解释,希望能够…
Managing the Activity Lifecycle 管理activity的生命周期 Dependencies and prerequisites 依赖关系和先决条件 How to create an Android project (see Creating an Android Project) 如何创建一个Android项目(请看Creating an Android Project) You should also read 你还需要阅读 Activities As a use…
Running Your App If you followed the previous lesson to create an Android project, it includes a default set of "Hello World" source files that allow you to immediately run the app. 如果你跟着前面的课程创建了一个Android项目,这个项目包括一系列默认的"Hello World"资源文…
Overlaying the Action Bar 叠加菜单栏 This lesson teaches you to 这节课教给你: Enable Overlay Mode 启用叠加模式 For Android 3.0 and higher only 对于仅支持Android 3.0及其以上版本 For Android 2.1 and higher 对于支持Android 2.1及其以上版本 Specify Layout Top-margin 指定布局的顶边距 You should also r…
Styling the Action Bar 设计菜单栏的样式 This lesson teaches you to 这节课教给你 Use an Android Theme 使用一个Android主题 Customize the Background 定义背景 Customize the Text Color 定义文本颜色 Customize the Tab Indicator 定义标签指示器 You should also read 你还应该读 Styles and Themes 样式和主题…
Setting Up the Action Bar 建立Action Bar This lesson teaches you to 这节课教给你 Support Android 3.0 and Above Only 仅仅支持Android 3.0及以上 Support Android 2.1 and Above 支持Android 2.1及其以上 You should also read 你还需要阅读 Setting Up the Support Library 建立Support Librar…
Starting Another Activity 开启另一个Activity This lesson teaches you to 这节课教给你: Respond to the Send Button 给发送按钮设置响应 Build an Intent 创建一个意图 Start the Second Activity 开启第二个Activity Create the Second Activity 创建第二个Activity Receive the Intent 接受意图 Display th…
SharedPreferences是Android提供的一种轻型的数据存储方法,其本质是基于xml文件存储的,内部数据以key-value的方式存储,通常用来存储一些简单的配置信息. SharedPreferences对象本身只能获取数据而不支持修改和存储,存储修改需要通过Editor对象来实现. 使用SharedPreperences保存数据 使用SharedPreperences来保存数据的步骤如下: 1. 实例化SharedPreperences对象 2. 实例化Editor对象 3. e…
我们之前都是使用sendMessage()方法来发送消息,使用handleMessage来处理消息的,今天我们来看另外一种方法,先看代码: package cn.lixyz.handlertest; import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.util.Log; import android.view.View; import android.wi…