Supporting Different Platform Versions 支持不同的平台版本 This lesson teaches you to 这节课教给你 Specify Minimum and Target API Levels 指定最小和目标API等级 Check System Version at Runtime 检查运行时的系统版本 Use Platform Styles and Themes 使用平台样式和主题 You should also read 你还应该阅读 Andr…
Supporting Different Screens 支持不同的屏幕 This lesson teaches you to 这节课教给你 Create Different Layouts 创建不同的布局 Create Different Bitmaps 创建不同的位图 You should also read 你还应该阅读 Designing for Multiple Screens 为多种屏幕进行设计 Providing Resources 提供资源 Iconography design…
Supporting Different Devices 支持不同设备 Dependencies and prerequisites 依赖关系和先决条件 Android 1.6 or higher Android 1.6 及其以上版本 You should also read 你还需要阅读 Application Resources 应用程序资源 Designing for Multiple Screens 为不同的屏幕进行设计 Android devices come in many shap…
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…
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 样式和主题…
Pausing and Resuming an Activity 暂停和恢复一个activity This lesson teaches you to 这节课教给你 Pause Your Activity 暂停你的Activity Resume Your Activity 恢复你的Activity You should also read 你还应该阅读 Activities During normal app use, the foreground activity is sometimes o…
最近在自学android,抽空把官方文档的guide跟training差不多看了一遍,又对比了一些书籍,感觉还是官方文档讲得比较好,所以自己计划把官方文档翻译一下,方便自己的知识巩固以及复习查找,由于英文不是非常好,所以翻译得不是很好,有不好的地方欢迎大家指出哈, 由于之前已经看过官方文档了,感觉最佳的路线是跟着官方training操作,遇到知识点或者不懂的再去guide跟reference中查找阅读,所以先从trainging翻译起了.针对官方文档,在翻译的基础上加入了一些自己的解释,希望能够…
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"资源文…
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…
Building a Simple User Interface 创建一个简单的用户界面 This lesson teaches you to 这节课将教给你: Create a Linear Layout 创建一个线性布局 Add a Text Field 增加一个文本域 Add String Resources 增加一个String(字符串)资源 Add a Button 增加一个按钮 Make the Input Box Fill in the Screen Width 让输入框充满屏幕的…
Adding Action Buttons 增加动作按钮 This lesson teaches you to 这节课教给你 Specify the Actions in XML 在XML中指定动作 Add the Actions to the Action Bar 把动作添加到状态栏 Respond to Action Buttons 让动作按钮有响应 Add Up Button for Low-level Activities 对低版本的activities增加顶部按钮 You should…
1.Activity的生命周期 onCreate:创建时调用 onStart:在屏幕上可见,但是还没有获得焦点 onResume:可见并且获得焦点 onPause:可见,但是失去焦点 onStop:不可见 onDestroy:销毁时调用 手机内存不足时,会杀死之前启动的进程,按照LRU算法(最近最少使用)锁定杀死谁 2.Activity的启动模式,每个应用会有一个Activity任务栈,存放已启动的Activity Activity的启动模式,修改任务栈的排列情况 Activity task s…
setTextColor()的参数设置方式 查了下资料发现setTextColor()的参数可以写成以下形式: 直接使用颜色值 setTextColor(0xFF0000FF);//0xFF0000FF是int类型的数据,分组一下0x|FF|0000FF,0x是代表颜色整数的标记,ff是表示透明度,0000FF表示颜色,注意:这里0xFF0000FF必须是8个的颜色表示,不接受0000FF这种6个的颜色表示. 使用系统自带的颜色类 setTextColor(android.graphics.Co…
介绍 The AlertDialog class allows you to build a variety of dialog designs and is often the only dialog class you'll need. there are three regions of an alert dialog: 1.Title This is optional and should be used only when the content area is occupied by…
一.常用系统服务 后台Service在系统启动时被SystemService开启 1.MountService:监听是否有SD卡安装和移除. 2.ClipboardService:提供剪切板功能. 3.PackageManagerService:提供软件包的安装移除和查看. 4.电量.网络连接状态等等. 二.调用系统Service: getSystemService()方法:Activity的一个方法,用来获取系统服务对象,传入一个字符串,返回一个系统服务对象. 三.常用的系统服务: 传入的Na…
在Android中用于保存Activity状态的onSaveInstanceState()和恢复Activity状态的onRestoreInstanceState(), 这样的算不算是一种备忘录模式呢? 1.定义: 在不破坏封装的情况下,捕获对象的内部状态,并在对象之外保存这个状态,这样以后就能够恢复以后保存的状态. 2.使用: 备忘录模式,比較适合用于功能复杂,可是须要维护和纪录历史的类,或者是须要保存一个或者是多个属性的类, 在未来某个时段须要时,将其还原到原来纪录的状态: Originat…
这几天在做图记的时候遇第一次遇到了OOM,好激动~~ 追究原因,是因为在ListView中加载的图片太大造成的,因为我使用的都是手机相机直接拍摄的照片,图片都比较大,所以在加载的时候会出现内存溢出,那么我们就需要将图片压缩显示了. 首先,我们可以通过Bitmap.getWidth和 Bitmap.getHeight来获取一张图片的实际宽和高 MainActivity.java package com.example.test3; import java.io.IOException; impor…
补间动画只能定义起始和结束两个帧在“透明度”.“旋转”.“倾斜”.“位移”4个方面的变化,逐帧动画也只能是播放多个图片,无法满足我们日常复杂的动画需求,所以谷歌在3.0开始,推出了属性动画(property animation) 属性动画已经不再是针对View来设计的了,也不仅限定于只能实现移动.缩放.淡入淡出这几种动画操作,同时也不再是一种视觉上的动画效果了.它实际上是一种不断的对值进行操作的机制,并将值赋值到指定对象的指定属性上,可以是任意对象的任意属性. ValueAnimator Val…
单选框和多选框通常用来在设置用户个人资料时候,选择性别.爱好等,不需要用户直接输入,直接在备选选项中选择,简单方便. 直接看代码: <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"…
Starting an Activity 开启一个Activity This lesson teaches you to 这节课教给你 Understand the Lifecycle Callbacks 理解生命周期回调 Specify Your App's Launcher Activity 声明你的App的启动Activity Create a New Instance 创建一个新的实例 Destroy the Activity 销毁Activity You should also rea…
Supporting Different Languages 支持不同语言 This class teaches you to 这节课教给你 Create Locale Directories and String Files 创建一个本地目录和String文件夹 Use the String Resources 使用String资源 You should also read 你还需要阅读 Localization Checklist 本地清单列表 Localization with Resou…
Building Your First App 创建你的第一个App项目 Dependencies and prerequisites 依赖关系和先决条件 * Android SDK * ADT Plugin 22.6.2 or higher (if you're using Eclipse) *Android SDK *ADT 插件 22.6.2或者更高(如果你使用Eclipse的话) Welcome to Android application development! 欢迎来到Androi…
Getting Started 让我们开始吧! Welcome to Training for Android developers. 欢迎来到Android开发者训练营. Here you'll find sets of lessons within classes that describe how to accomplish a specific task with code samples you can re-use in your app. 在这里你可以发现一系列的课程,这些课程是描…
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…
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…
Adding the Action Bar 增加一个Action Bar(工具栏) The action bar is one of the most important design elements you can implement for your app's activities. It provides several user interface features that make your app immediately familiar to users by offerin…
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…
原文地址:http://docs.orchardproject.net/Documentation/Managing-widgets 想要查看文档目录请用力点击这里 最近想要学习了解orchard,但却没有找到相关的中文文档,只有英文文档.于是决定自行翻译,以便日后方便翻阅. 转载请注明原作者与出处. 本人英文水平有限,错误之处欢迎指出以便修正 管理部件(widgets) 在Orchard中,widget以UI片段(HTML)或代码段(内容的一部分)的形式存在,并且可以很容易的映射至任何位置或区…
ListView中Items没有margin 参考:http://www.cnblogs.com/xitang/p/3677528.html…
网上有的博客写得太乱 不如自己翻译官方文档 Lifecycle 生命周期 Though a Fragment's lifecycle is tied to its owning activity, it has its own wrinkle on the standard activity lifecycle. It includes basic activity lifecycle methods such as onResume(), but also important are meth…