Android—API中文文档

合集下载

Android 2.2 API 中文文档

Android 2.2 API 中文文档

直接子类:
Button, CheckedTextView, Chronometer, DigitalClock, EditText
间接子类: AutoCompleteTextView, CheckBox, CompoundButton, ExtractEditText,MultiAutoCompleteTextView, RadioButton, ToggleButton
android:width
android:maxWidth android:minWidth 1.3 补充说明
设置文字大小,推荐度量单位”sp”,如”15sp” 设置字形[bold(粗体) 0, italic(斜体) 1, bolditalic
(又粗又斜) 2] 可以设置一个或多个,用“|”隔开 设置文本字体,必须是以下常量值之一:normal 0,
android:ems
设置TextView的宽度为N个字符的宽度。这里测试为一个 汉字字符宽度,如图:
android:maxEms
设置TextView的宽度为最长为N个字符的宽度。与ems同 时使用时覆盖ems选项。
2
android:minEms
设置TextView的宽度为最短为N个字符的宽度。与ems同 时使用时覆盖ems选项。
EditText将详细说明。
android:password
以小点”.”显示文本
android:phoneNumber
设置为电话号码的输入方式。
android:privateImeOptions
设置输入法选项,此处无用,在EditText将进一步讨 论。
android:scrollHorizontally
用,可设置为负数,单独使用没有效果。

API中文文档

API中文文档

Activities
(编者译:activity可以理解为显示主页面,一些文本框,下拉框都布置在这个主页面上。这个主页面也是和用户的交互页面。)一个activity代表一个用户可以尝试操作的可视化用户界面An activity presents a visual user interface for one focused endeavor the user can undertake. 例如,一个activity 可以表示一个用户可以选择的菜单项目列表,可以显示一个带标题的图片。一个短信息程序可以有一个activity 显示要发送信息的联系人列表,第二个activitys可以写信息给选择的联系人。另一些activitys可以浏览旧的信息或者改变设置。通过它们一起工作来组成一个组合的用户界面。每一个activity都依赖于其他activity。每个都被实现implement为Activity基类的子类。
对于这样的工作方式,当应用的任何一部分被其他应用说需要时系统必须能启动这个应用的进程。因此和其他大多数的系统的应用不同,Android应用中对于任何部分都没有一个单一的入口(例如没有main()函数)。恰恰相反的它有必不可少的组件,当系统需要时,系统可以实例化和运行这些组件回收。有四种这样的组件:
每一个activity 会被会一个默认的窗口来设计。典型的,窗口填充屏幕,但是他可以比屏幕下,并且可以浮动在其他窗口的上面。一个activity 也可以用其他另外的窗口-例如为了用户的响应在activity的中部调用弹出对话框。或者当用户在屏幕上选择一个特定的项目窗口会显示用户的重要信息。
窗口的可视化组件提一个视图对象的继承。这个对象由View 类起源。每个视图控制窗口中一个特殊的长方形空间。父类视图包括内容和安排其子类的布局。叶子视图(继承关系的最底层)在它们控制的矩形和直接响应用户动作的空间中描绘。因此视图是在用户发生activity的交互的地方。例如一个视图可以显示一个小的图片并且发起一个动作当用户点击这个图片。Android有许多的你可以用的只读视图,包括按钮,文本框,滚动条,菜单,选择框等。

Android中文API(70)——BluetoothDevice[蓝牙]

Android中文API(70)——BluetoothDevice[蓝牙]

Android中⽂API(70)——BluetoothDevice[蓝⽛]前⾔声明 欢迎转载,但请保留⽂章原始出处:)正⽂ ⼀、结构public static class BluetoothDevice extends Object implements Parcelableng.Objectandroid.bluetooth.BluetoothDevice ⼆、概述 代表⼀个远程蓝⽛设备。

让你创建⼀个带有各⾃设备的BluetoothDevice或者查询其皆如名称、地址、类和连接状态等信息。

对于蓝⽛硬件地址⽽⾔,这个类仅仅是⼀个瘦包装器。

这个类的对象是不可改变的。

这个类上的操作会使⽤这个⽤来创建BluetoothDevice类的BluetoothAdapter类执⾏在远程蓝⽛硬件上。

为了获得BluetoothDevice,类,使⽤BluetoothAdapter.getRemoteDevice(String)⽅法去创建⼀个表⽰已知MAC地址的设备(⽤户可以通过带有BluetoothAdapter类来完成对设备的查找)或者从⼀个通过 BluetoothAdapter.getBondedDevices()得到返回值的有联系的设备集合来得到该设备。

注意:需要权限 参见 三、常量String ACTION_ACL_CONNECTED⼴播活动:指明⼀个与远程设备建⽴的低级别(ACL)连接。

总是包含附加域ACL连接通过Android蓝⽛栈⾃动进⾏管理需要权限接收常量值: "android.bluetooth.device.action.ACL_CONNECTED"String ACTION_ACL_DISCONNECTED⼴播活动:指明⼀个来⾃于远程设备的低级别(ACL)连接的断开总是包含附加域ACL连接通过Android蓝⽛栈⾃动进⾏管理需要权限接收常量值: "android.bluetooth.device.action.ACL_DISCONNECTED"String ACTION_ACL_DISCONNECT_REQUESTED⼴播活动:指明⼀个为远程设备提出的低级别(ACL)的断开连接请求,并即将断开连接。

android应用开发帮助文档

android应用开发帮助文档

本android帮助文档为在学习视频时自己制作比较混乱和粗糙,使用时查找第一页导航,再用word的查找功能进行查找导航页——基础说明——监听器的设置->创建监听器——调用android自带的短信发送功能——Activity的方法和生命周期(创建对话框风格的)——Activity的布局方法--LinearLayout线性--常用标签--TableLayout表格--GridView滑动表格--RelativeLayout相对布局——常用控件--除去title和全屏显示--EditText可输入文本框--RadioGroup和RadioButton单选按钮--Toast提示框--CheckBox多选按钮--ProgressBar进度条--ListView可选列表--MENU菜单控件的使用--Animation动画效果--4种动画效果--动画实现--JAVA中的实现--XMl文件中的实现-- Gallery (走马灯式的)移动选择控件--ImageSwitcher图片显示控件--ImageButton图片按钮控件--AlertDialog提示框——Handler的使用---线程--handler的简单应用--用handler更新ProgressBar进度条--handler与线程--线程之间的数据传递--Bundle对象(大量复杂数据) --Message对象(少量简单)--建立一个新的线程--HandlerThread类——SQLite的使用--SQLiteOpenHelper的方法注:带有下划线的是一些封装--代码的编写的可以直接调用的类,在”帮助文档的链接文件\封装的类”文件--封装的DatabaseHelper类夹中都有保存可以直接导入调用--主java文件--命令行的查询方法——文件下载--文件下载--步骤--在注册文件中注册权限--封装的HttpDownLoad类--在Activity中的调用--访问SDCARD --注册权限--封装的FileUtils类--在Activity文件中的调用——_XML文件的解析--SAX常用接口--XMl文件解析实例--实现ContentHandler接口的类--在Activity中的调用 XMl文件实例aaa.xml——广播机制--android中的广播机制--编写BroadcastReveicer类--创建包含BroadcastReveicer类的java文件--在onReceive中处理收到短消息的事件--AndroidManifest.XML注册文件中注册--代码当中进行注册--Activity中发送广播——WIFI--WIFI网卡的状态--操作WIFI网卡所需要的部分权限--改变WIFI网卡的状态——Socket编程--使用基于TCP协议的Socket--使用基于UDP协议的Socket——ServiceAndroid创建基础:src文件中为包类,其中用于建立activity的java文件res中drawable中为图片和标签layout中为布局文件,用于每个activity.java文件的标签布局AndroidManifest中为注册文件,每一个activity的建立都需要在其中注册代码的编写intent对象(用于在不同activity转换时的监听器设置)ponent name 指定activity2.Action 指定activity的作用3.Data 传送的数据类型4.Extras (额外)传送的键值对创建监听器的关键代码:(在第一个activity中)//创建一个Button监听器class myButtonListener implements OnClickListener{public void onClick(View v) {// TODO Auto-generated method stub//创建一个intent类Intent intent = new Intent();//创建一个键值对intent.putExtra("nexttext", "跳转成功");//创建关联intent.setClass(FirstActivity.this, SecondActivity.class);FirstActivity.this.startActivity(intent);}}在第一个activity中的转换关键标签上绑定监听器:(例在Button标签)(在onCreate中)//在Button上绑定监听器myButton.setOnClickListener(new myButtonListener());在第二个activity中的应用键值对(数据传递):(在onCreate中)//获取键值对Intent intent = getIntent();//获得键值对的值String text = intent.getStringExtra("nexttext");在Activity中调用android自带的短信发送功能的关键代码://调用短信发送功能class myButtonListener implements OnClickListener{public void onClick(View v) {// TODO Auto-generated method stub//发送号码Uri uri = Uri.parse("smsto://0800000123");Intent it = new Intent(Intent.ACTION_SENDTO,uri);//发送内容it.putExtra("sms_body", "the SMS text");startActivity(it);}}Activity的方法和生命周期:--onCreate 一个activity启动时运行(第一次)--onStart 当activity处于可见状态时运行--onResume 当activity可以得到用户焦点时(可以被操作)运行--onPause 当activity处于暂停状态时(例如弹出其他activity而原activity未被完全覆盖),可在此保存数据,以便此activity释放时恢复原状--onStop 当activity完全不可见时--onRestart 当activity未被销毁而在此被调用时--onDestory 当activity被销毁时当调用finish();语句时,Activity被销毁。

Android 3.1 r1 API中文文档(6)——ImageView

Android 3.1 r1 API中文文档(6)——ImageView

Android 3.1 r1 API中文文档(6)——ImageView前言本章内容是android.widget.ImageView,为早前发布版本的完整版,版本为Android 3.1 r1,翻译来自"cnmahj"和"农民伯伯",欢迎大家访问"cnmahj"的博客:,再次感谢"/cnmahj"!欢迎你一起参与Android的中文翻译,联系我over140@。

声明欢迎转载,但请保留文章原始出处:)博客园:/Android中文翻译组:http://goo.gl/6vJQlImageView译者署名:cnmahj、农民伯伯译者博客:/cnmahj版本:Android 3.1 r1结构继承关系public class View.OnClickListner extends Viewng.Objectandroid.view.Viewandroid.widget.ImageView直接子类ImageButton, QuickContactBadge间接子类ZoomButton类概述显示任意图像,例如图标。

ImageView类可以加载各种来源的图片(如资源或图片库),需要计算图像的尺寸,比便它可以在其他布局中使用,并提供例如缩放和着色(渲染)各种显示选项。

嵌套类enum ImageView.ScaleType将图片边界缩放,以适应视图边界时的可选项XML属性公共方法public final void clearColorFilter ()(译者注:清除颜色过滤,参见这里)public int getBaseline ()返回部件顶端到文本基线的偏移量。

如果小部件不支持基线对齐,该方法返回-1。

返回值小部件顶端到文本基线的偏移量;或者是-1 当小部件不支持基线对齐时。

public boolean getBaselineAlignBottom ()返回当前视图基线是否将考虑视图的底部。

Android_API中文文档

Android_API中文文档
android:typeface
设置文本字体,必须是以下常量值之一:normal 0, sans 1, serif 2, monospace(等宽字体) 3]
android:height
设置文本区域的高度,支持度量单位:px(像素)/dp/sp/in/mm(毫米)
android:maxHeight
设置文本区域的最大高度
androidapi中文文档文档中文api中文文档apiapi文档api文档
EditText
ng.Object
↳android.view.View
↳android.widget.TextView
↳android.widget.EditText
已知直接子类:
AutoCompleteTextView, ExtractEditText
android:ellipsize
设置当文字过长时,该控件该如何显示。有如下值设置:”start”—–省略号显示在开头;”end”——省略号显示在结尾;”middle”—-省略号显示在中间;”marquee” ——以跑马灯的方式显示(动画横向移动)
android:freezesText
设置保存文本的内容以及光标的位置。参见:这里。
android:scrollHorizontally
设置文本超出TextView的宽度的情况下,是否出现横拉条。
android:selectAllOnFocus
如果文本是可选择的,让他获取焦点而不是将光标移动为文本的开始位置或者末尾位置。TextView中设置后无效果。
android:shadowColor
设置链接是否点击连接,即使设置了autoLink。
android:lineSpacingExtra

Android开发和调试中文文档

Android开发和调试中文文档

Android中文文档:开发和调试在eclipse上开发Android应用程序在用eclipse IDE开发android应用程序之前,你首先要创建一个Android工程,并且建立一个启动配置,在此之后你才可以开始编写,运行,以及调试你的应用程序。

以下章节是假设你已经在eclipse环境中安装了ADT插件,如果你没有安装,请安装之后再使用以下说明。

参考安装eclipse 插件(ADT)创建一个android工程ADT提供了一个新的工程向导,你可以快速的创建一个新的工程或者在现有代码上创建工程。

创建工程的步骤如下:选择File > New > Project选择 Android > Android Project, 然后按下 Next选择项目内容:选择 Create new project in workspace,为编码创建一个全新的工程。

输入工程名称(project name),基础软件包的名称(the base package name),以及Activity 类的名称。

以创建stub .java文件等文件和程序名字。

选择Create project from existing source ,为已有代码创建一个工程。

如果你想编译运行SDK中提供的示例程序,可以使用这个选项。

示例程序的存放在SDK的samples/目录下。

浏览包含已有代码的目录,点击ok,如果目录中包含有可用的android manifest 文件,ADT 将为你填写合适的软件包,activity,和应用程序名称。

按下Finish.ADT插件会根据你的工程类型创建合适的文件和文件夹,如下:src/ 包含stub .java Activity文件的文件夹.res/ 资源文件夹.AndroidManifest.xml 工程清单.创建一个启动项能够在eclipse上运行调试应用程序之前,你必须为它创建一个启动项。

用户使用说明书

用户使用说明书

手机信息查看助手项目用户使用说明✧项目名称:手机信息查看助手✧团队成员:刘建良、孙希鹏、王彬、卞绪杰、王嘉禄、张斌✧指导教师:冯君目录第一章引言 (1)1.1 编写目的 (1)1.2 背景 (1)1.3 定义 (1)1.4 参考资料 (2)第二章项目介绍以及开发计划 (3)2.1 目标 (3)2.2 功能 (3)2.3 准备工作 (3)2.4 任务分配 (3)第三章软件环境与平台 (5)3.1 开发环境 (5)3.2 开发平台 (5)3.3 运行环境 (5)第四章使用说明 (6)4.1 软件的安装 (6)4.2 软件的使用 (6)4.2.1 初始界面 (6)4.2.2程序主界面 (6)第一章引言1.1 编写目的编写本文档的主要目的在于介绍开发“手机信息查看助手”项目的过程中的时间安排、任务分配、开发规划的过程、软件的总体开发以及模块的详细开发。

同时还有软件开发过程、测试过程的总结。

以及软件在运行的过程中的环境需求以及用户说明。

本文档用于本小组成员和指导老师阅读。

1.2 背景1)开发系统的名称:手机信息查看助手2)项目提出者:本组成员3)项目开发者:本组成员1.3 定义1)Android技术Android 是Google开发的基于Linux平台的开源手机操作系统。

它包括操作系统、用户界面和应用程序——移动电话工作所需的全部软件,而且不存在任何以往阻碍移动产业创新的专有权障碍。

Google与开放手机联盟合作开发了Android,这个联盟由包括中国移动、摩托罗拉、高通、宏达电和 T-Mobile 在内的30多家技术和无线应用的领军企业组成。

Google通过与运营商、设备制造商、开发商和其他有关各方结成深层次的合作伙伴关系,希望借助建立标准化、开放式的移动电话软件平台,在移动产业内形成一个开放式的生态系统。

2)Web ServiceWeb Service是部署在Web上的对象、组件,通过Internet上的标准协议XML 及HTTP,实现异构平台间的信息集成与互操作。

Android文档-开发者指南-第一部分:入门-中英文对照版-pdf

Android文档-开发者指南-第一部分:入门-中英文对照版-pdf

一、Introduction(入门)0、Introduction to Android(引进到Android)Android provides a rich application framework that allows you to build innovative apps and games for mobile devices in a Java language environment. The documents listed in the left navigation provide details about how to build apps using Android's various APIs.To learn how apps work, startwith App Fundamentals.To begin coding right away, read Building Your First AppAndroid提供了丰富的应用程序框架,它允许您在Java语言环境中构建移动设备的创新应用程序和游戏。

在左侧导航中列出的文档提供了有关如何使用Android的各种API来构建应用程序的详细信息。

要了解如何开发应用,从应用基础开始。

如何开始一个正确的编码,请参照建立你的第一个应用程序。

Apps provide multiple entry points 应用程序提供多个入口点Apps adapt to different devices 应用程序适应不同的设备Android apps are built as a combination of distinct components that can be invoked individually. For instance, an individual activity provides a single screen for a user interface, and a service independently performs work in the background.Android应用程序被构建为能够单独地被调用不同的部件的组合。

Android设备开发文档说明书

Android设备开发文档说明书

1) What is Android?It is an open-sourced operating system that is used primarily on mobile devices, such as cell phones and tablets. It is a Linux kernel-based system that’s been equipped with rich components that allows developers to create and run apps that can perform both basic and advanced functions.2) What Is the Google Android SDK?The Google Android SDK is a toolset that developers need in order to write apps on Android enabled devices. It contains a graphical interface that emulates an Android driven handheld environment, allowing them to test and debug their codes.3) What is the Android Architecture?Android Architecture is made up of 4 key components:- Linux Kernel- Libraries- Android Framework- Android Applications4) Describe the Android Framework.The Android Framework is an important aspect of the Android Architecture. Here you can find all the classes and methods that developers would need in order to write applications on the Android environment.5) What is AAPT?AAPT is short for Android Asset Packaging Tool. This tool provides developers with the ability to deal with zip-compatible archives, which includes creating, extracting as well as viewing its contents.6) What is the importance of having an emulator within the Android environment?The emulator lets developers “play” around an interface that acts as if it were an actual mobile device. They can write and test codes, and even debug. Emulators are a safe place for testing codes especially if it is in the early design phase.7) What is the use of an activityCreator?An activityCreator is the first step towards the creation of a new Android project. It is made up of a shell script that will be used to create new file system structure necessary for writing codes within the Android IDE.8 ) Describe Activities.Activities are what you refer to as the window to a user interface. Just as you create windows in order to display output or to ask for an input in the form of dialog boxes, activities play the same role, though it may not always be in the form of a user interface.9) What are Intents?Intents displays notification messages to the user from within the Android enabled device. It can be used to alert the user of a particular state that occurred. Users can be made to respond to intents.10) Differentiate Activities from Services.Activities can be closed, or terminated anytime the user wishes. On the other hand, services are designed to run behind the scenes, and can act independently. Most services run continuously, regardless of whether there are certain or no activities being executed.11) What items are important in every Android project?These are the essential items that are present each time an Android project is created:- AndroidManifest.xml- build.xml- bin/- src/- res/- assets/12) What is the importance of XML-based layouts?The use of XML-based layouts provides a consistent and somewhat standard means of setting GUI definition format. In common practice, layout details are placed in XML files while other items are placed in source files.13) What are containers?Containers, as the name itself implies, holds objects and widgets together, depending on which specific items are needed and in what particular arrangement that is wanted. Containers may hold labels, fields, buttons, or even child containers, as examples.14) What is Orientation?Orientation, which can be set using setOrientation(), dictates if the LinearLayout is represented asa row or as a column. Values are set as either HORIZONTAL or VERTICAL.15) What is the importance of Android in the mobile market?Developers can write and register apps that will specifically run under the Android environment. This means that every mobile device that is Android enabled will be able to support and run these apps. With the growing popularity of Android mobile devices, developers can take advantage of this trend by creating and uploading their apps on the Android Market for distribution to anyone who wants to download it.16) What do you think are some disadvantages of Android?Given that Android is an open-source platform, and the fact that different Android operating systems have been released on different mobile devices, there’s no clear cut policy to how applications can adapt with various OS versions and upgrades. One app that runs on this particular version of Android OS may or may not run on another version. Another disadvantage is that since mobile devices such as phones and tabs come in different sizes and forms, it poses a challenge for developers to create apps that can adjust correctly to the right screen size and other varying features and specs.17) What is adb?Adb is short for Android Debug Bridge. It allows developers the power to execute remote shell commands. Its basic function is to allow and control communication towards and from the emulator port.18) What are the four essential states of an activity?- Active – if the activity is at the foreground- Paused – if the activity is at the background and still visible- Stopped – if the activity is not visible and therefore is hidden or obscured by another activity- Destroyed – when the activity process is killed or completed terminated19) What is ANR?ANR is short for Application Not Responding. This is actually a dialog that appears to the user whenever an application have been unresponsive for a long period of time.20) Which elements can occur only once and must be present?Among the different elements, the and elements must be present and can occur only once. The rest are optional, and can occur as many times as needed.21) How are escape characters used as attribute?Escape characters are preceded by double backslashes. For example, a newline character is created using ‘\\n’22) What is the importance of settings permissions in app development?Permissions allow certain restrictions to be imposed primarily to protect data and code. Without these, codes could be compromised, resulting to defects in functionality.23) What is the function of an intent filter?Because every component needs to indicate which intents they can respond to, intent filters are used to filter out intents that these components are willing to receive. One or more intent filters are possible, depending on the services and activities that is going to make use of it.24) Enumerate the three key loops when monitoring an activity- Entire lifetime – activity happens between onCreate and onDestroy- Visible lifetime – activity happens between onStart and onStop- Foreground lifetime – activity happens between onResume and onPause25) When is the onStop() method invoked?A call to onStop method happens when an activity is no longer visible to the user, either because another activity has taken over or if in front of that activity.26) Is there a case wherein other qualifiers in multiple resources take precedence over locale?Yes, there are actually instances wherein some qualifiers can take precedence over locale. There are two known exceptions, which are the MCC (mobile country code) and MNC (mobile network code) qualifiers.27) What are the different states wherein a process is based?There are 4 possible states:- foreground activity- visible activity- background activity- empty process28) How can the ANR be prevented?One technique that prevents the Android system from concluding a code that has been responsive for a long period of time is to create a child thread. Within the child thread, most of the actual workings of the codes can be placed, so that the main thread runs with minimal periods of unresponsive times.29) What role does Dalvik play in Android development?Dalvik serves as a virtual machine, and it is where every Android application runs. Through Dalvik, a device is able to execute multiple virtual machines efficiently through better memory management.30) What is the AndroidManifest.xml?This file is essential in every application. It is declared in the root directory and contains information about the application that the Android system must know before the codes can be executed.31) What is the proper way of setting up an Android-powered device for app development? The following are steps to be followed prior to actual application development in an Android-powered device:-Declare your application as "debuggable" in your Android Manifest.-Turn on "USB Debugging" on your device.-Set up your system to detect your device.32) Enumerate the steps in creating a bounded service through AIDL.1. create the .aidl file, which defines the programming interface2. implement the interface, which involves extending the inner abstract Stub class as well as implanting its methods.3. expose the interface, which involves implementing the service to the clients.33) What is the importance of Default Resources?When default resources, which contain default strings and files, are not present, an error will occur and the app will not run. Resources are placed in specially named subdirectories under the project res/ directory.34) When dealing with multiple resources, which one takes precedence?Assuming that all of these multiple resources are able to match the configuration of a device, the ‘locale’ qualifier almost always takes the highest precedence over the others.35) When does ANR occur?The ANR dialog is displayed to the user based on two possible conditions. One is when there is no response to an input event within 5 seconds, and the other is when a broadcast receiver is not done executing within 10 seconds.36) What is AIDL?AIDL, or Android Interface Definition Language, handles the interface requirements between a client and a service so both can communicate at the same level through interprocess communication or IPC. This process involves breaking down objects into primitives that Android can understand. This part is required simply because a process cannot access the memory of the other process.37) What data types are supported by AIDL?AIDL has support for the following data types:-string-charSequence-List-Map-all native Java data types like int,long, char and Boolean38) What is a Fragment?A fragment is a part or portion of an activity. It is modular in a sense that you can move around or combine with other fragments in a single activity. Fragments are also reusable.39) What is a visible activity?A visible activity is one that sits behind a foreground dialog. It is actually visible to the user, but not necessarily being in the foreground itself.40) When is the best time to kill a foreground activity?The foreground activity, being the most important among the other states, is only killed or terminated as a last resort, especially if it is already consuming too much memory. When a memory paging state has been reach by a foreground activity, then it is killed so that the user interface can retain its responsiveness to the user.41) Is it possible to use or add a fragment without using a user interface?Yes, it is possible to do that, such as when you want to create a background behavior for a particular activity. You can do this by using add(Fragment,string) method to add a fragment from the activity.42) How do you remove icons and widgets from the main screen of the Android device?To remove an icon or shortcut, press and hold that icon. You then drag it downwards to the lower part of the screen where a remove button appears.43) What are the core components under the Android application architecture?There are 5 key components under the Android application architecture:- services- intent- resource externalization- notifications- content providers44) What composes a typical Android application project?A project under Android development, upon compilation, becomes an .apk file. This apk file format is actually made up of the AndroidManifest.xml file, application code, resource files, and other related files.45) What is a Sticky Intent?A Sticky Intent is a broadcast from sendStickyBroadcast() method such that the intent floats around even after the broadcast, allowing others to collect data from it.46) Do all mobile phones support the latest Android operating system?Some Android-powered phone allows you to upgrade to the higher Android operating system version. However, not all upgrades would allow you to get the latest version. It depends largely on the capability and specs of the phone, whether it can support the newer features available under the latest Android version.47) What is portable wi-fi hotspot?Portable Wi-Fi Hotspot allows you to share your mobile internet connection to other wireless device. For example, using your Android-powered phone as a Wi-Fi Hotspot, you can use your laptop to connect to the Internet using that access point.48) What is an action?In Android development, an action is what the intent sender wants to do or expected to get as a response. Most application functionality is based on the intended action.49) What is the difference between a regular bitmap and a nine-patch image?In general, a Nine-patch image allows resizing that can be used as background or other image size requirements for the target device. The Nine-patch refers to the way you can resize the image: 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be scaled into both axes.50) What language is supported by Android for application development?The main language supported is Java programming language. Java is the most popular language for app development, which makes it ideal even for new Android developers to quickly learn to create and deploy applications in the Android environment.Guru99 Provides FREE ONLINE TUTORIAL on Various courses likeJava MIS MongoDB BigData CassandraWeb Services SQLite JSP Informatica AccountingSAP Training Python Excel ASP Net HBase ProjectTest Management Business Analyst Ethical Hacking PMP ManagementLive Project SoapUI Photoshop Manual Testing Mobile TestingData Warehouse R Tutorial Tableau DevOps AWSJenkins Agile Testing RPA JUnitSoftware EngineeringSelenium CCNA AngularJS NodeJS PLSQL。

android中文API合集(50篇)android中文翻译组

android中文API合集(50篇)android中文翻译组

Android中文API合集(50篇)Android中文翻译组关于API文档(Reference)是Android开发的基础,三年来(2007-2010)官方仍未出中文版的API,Android中文翻译组聚一批从事Android开发人员、论坛版主、大学生、研究生等利用业余时间对Android的API进行翻译,人数从1人到80+人不断壮大,发表的译文从1篇到50篇不断增多,为的只是多一份Android中文资料,欢迎更多朋友的加入,联系我们:QQ:36408253 Gtalk:over140@欢迎大家访问翻译组在淘蝌蚪上搭建的项目:/project/view/404/(cnAndroid),可使用SVN客户端匿名下载:/svn/cnAndroid,在这里可以查看翻译组当前的最新的进度和翻译稿,也可以直接向我们提问。

关于翻译组的更多介绍,请看这里。

章节结构继承关系public final class Manifest extends Objectng.Object android.Manifest内部类class Manifest.permission权限class Manifest.permission_group权限组构造函数public Manifest ()构造函数补充文章精选android Manifest.xml选项Manifest.permission结构继承关系public static final class Manifest.permission extends Objectng.Objectandroid. Manifest.permission常量结构继承关系public static final class Manifest.permission_group extends Objectng.Objectandroid. Manifest.permission_group常量结构public abstract class AccessibilityService extends Serviceng.Objectandroid.content.Contextandroid.content.ContextWrapperandroid.app.Serviceandroid.accessibilityservice.Accessibil ityService类概述当AccessibilityEvent事件被启动后AccessibilityService 会接收回调函数运行于后台,这些事件指的是在用户接口间的状态转换,比如,焦点变化,按钮被点击等。

微信api接口文档微信支付APP支付(Android)接口文档V1.7

微信api接口文档微信支付APP支付(Android)接口文档V1.7

微信api接口文档微信支付APP支付(Android)接口文档V1.7APP支付接口文档V1.7版本说明版本V1.5V1.6V1.7更改说明公众号1.5版本升级更新实例代码成实际可运行更新订单号重复说明更新时间2014-04-152014-04-292014-06-181.微信支付简介1.1功能简介................................................................................................... .. (4)1.2平台帐号注册................................................................................................... (5)1.2.1申请流程指引图................................................................................................... (5)1.2.2申请接入步骤详细说明 (5)1.3支付账户................................................................................................... ..........................62.微信APP支付接入................................................................................................... .. (8)2.1系统架构................................................................................................... .. (8)2.2基本交互................................................................................................... .. (8)2.3支付功能开发介绍................................................................................................... ..........93.接口介绍................................................................................................... .. (10)3.1获取 (10)3.2生成预支付订单................................................................................................... (11)3.3订单详情(package)扩展字符串定义 (12)3.4支付签名(app_signature)生成方法 (14)3.5添加prepayid再次签名..................................................................................................153.6APP端开发说明................................................................................................... . (16)3.6.1初始化设置................................................................................................... (16)3.6.2注册您的APPID........................................................................................... .. (16)3.6.3用服务器返回的参数调起支说明................................................................................................... (18)4.1通知接口简介................................................................................................... . (18)4.2补单机制................................................................................................... (18)4.3通知接口参数................................................................................................... . (18)4.4后台通知结果返回................................................................................................... .. (21)4.5后台通知签名方式................................................................................................... .. (21)5.API接口说明................................................................................................... (23)5.1API接口简介................................................................................................... (23)5.2API列表................................................................................................... .. (23)5.2.1发货通知delivernotify.................................................................................. .. (23)5.2.2订单查询orderquery.................................................................................... ........256.常见问题和注意事项................................................................................................... . (27)6.1帮助SDK............................................................................................... (27)6.2常见基本概念疑惑................................................................................................... .. (28)6.3常见错误现象及解决方法 (28)6.4常见注意事项................................................................................................... . (29)6.5最新接口文档下载................................................................................................... .. (29)6.6联系我们................................................................................................... (30)1.微信支付简介1.1功能简介微信APP支付,是基于微信客户端提供的支付服务功能。

ANDROID UI API中文文档

ANDROID UI API中文文档

Android2.2——API中文文档目录:(1)——TextView(2)——EditText(3)——AccessibilityService(4)——Manifest(5)——View(6)——ImageView(7)——ImageButton(8)——QuickContactBadge(9)——ZoomButton(10)——CheckBox(11)——RadioButton(12)——Button(13)——ToggleButton(14)——ViewStub(15)——GridView一、TextView1、结构ng.Object↳android.view.View↳android.widget.TextView2、已知直接子类:Button,CheckedTextView,Chronometer,DigitalClock,EditText3、已知间接子类:AutoCompleteTextView,CheckBox,CompoundButton,ExtractEditText,MultiAutoCompleteTextView,RadioButton,ToggleButtonandroid:marqueeRepeatLimit 在ellipsize 指定marquee 的情况下,设置重复滚动的次数,当设置为marquee_forever 时表示无限次。

android:ems设置TextView 的宽度为N 个字符的宽度。

这里测试为一个汉字字符宽度,如图:android:maxEms 设置TextView 的宽度为最长为N 个字符的宽度。

与ems同时使用时覆盖ems 选项。

android:minEms 设置TextView 的宽度为最短为N 个字符的宽度。

与ems同时使用时覆盖ems 选项。

android:maxLength 限制显示的文本长度,超出部分不显示。

android:lines 设置文本的行数,设置两行就显示两行,即使第二行没有数据。

androidapi中文文档

androidapi中文文档
)、textLongMessage长讯息?、textPersonName人名、textPostalAddress地址、textPassword密码、textVisiblePassword可见密码、textWebEditText作为网页表单的文本、textFilte文本筛选过滤、textPhonetic拼音输入、numberSigned有符号数字格式、numberDecimal可带小数点的浮点格式、phone电话号码、datetime时间日期、date日期、time时间。部分参考这里。
android:inputType
设置文本的类型,用于帮助输入法显示合适的键盘类型。有如下值设置:none、text、textCapCharacters字母大小、textCapWords单词首字母大小、textCapSentences仅第一个字母大小、textAutoCorrect、textAutoComplete自动完成、textMultiLine多行输入、textImeMultiLine输入法多行(如果支持)、textNoSuggestions不提示、textEmailAddress电子邮件地址、textEmailSubject邮件主题、textShortMessage短信息(会多一个表情按钮出来,点开如下图:
android:scrollHorizontally
设置文本超出TextView的宽度的情况下,是否出现横拉条。
android:selectAllOnFocus
如果文本是可选择的,让他获取焦点而不是将光标移动为文本的开始位置或者末尾位置。TextView中设置后无效果。
android:shadowColor
指定文本阴影的颜色,需要与shadowRadius一起使用。参见TextView中此属性的截图。

Android中文开发文档-初学者

Android中文开发文档-初学者

Android开发指南Android中文开发文档-初学者目录应用程序基础Application Fundamentals (4)关键类 (4)应用程序组件 (5)激活组件:intent (7)关闭组件 (7)manifest文件 (8)Intent过滤器 (9)Activity和任务 (10)Affinity(吸引力)和新任务 (11)加载模式 (12)清理堆栈 (13)启动任务 (14)进程和线程 (14)进程 (14)线程 (15)远程过程调用 (15)线程安全方法 (16)组件生命周期 (17)Activity生命周期 (17)调用父类 (17)服务生命周期 (20)广播接收器生命周期 (22)用户界面User Interface (23)视图层次View Hierarchy (24)布局Layout (24)部件Widgets (25)用户界面事件UI Events (26)菜单Menus (26)高级话题Advanced Topics (27)适配器Adapter (27)风格与主题Styles and Themes (27)资源和资产Resources and Assets (27)资源引用Resource Reference (43)国际化和本地化Internationalization and Localization (43)意图和意图过滤器Intents and Intent Filters (43)意图过滤器Intent filters (47)通常情况Common cases (51)使用意图匹配Using intent matching (52)数据存储Data Storage (52)概览Storage quickview (52)✧系统偏好:快速,轻量级存储 (52)✧文件:存储到设备内部或可移动闪存 (52)✧数据库:任意的结构化存储 (52)✧支持基于网络的存储 (52)系统偏好Preferences (53)文件Files (54)网络Network (55)内容提供器Content Providers (55)内容提供器的基础知识Content Provider Basics (55)查询一个内容提供器Querying a Content Provider (57)修改数据Modifying Data (61)创建一个内容提供器Creating a Content Provider (64)Content URI 总结 (67)清单文件The AndroidManifest.xml File (68)清单文件结构Structure of the Manifest File (68)文件约定File Conventions (70)文件特性File Features (73)应用程序基础Application Fundamentals关键类1.Activity2.Service3.BroadcastReceiver4.ContentProvider5.IntentAndroid应用程序使用Java做为开发语言。

Android中文文档

Android中文文档

android 中文文档∙丰富而又可扩展的视图(Views),可以用来构建应用程序,它包括列表(lists),网格(grids),文本框(text boxes),按钮(buttons),甚至可嵌入的web浏览器。

∙内容提供器(Content Providers)使得应用程序可以访问另一个应用程序的数据(如联系人数据库),或者共享它们自己的数据∙资源管理器(Resource Manager)提供非代码资源的访问,如本地字符串,图形,和布局文件(layout files )。

∙通知管理器(Notification Manager)使得应用程序可以在状态栏中显示自定义的提示信息。

∙活动管理器(Activity Manager)用来管理应用程序生命周期并提供常用的导航回退功能。

有关更多的细节和怎样从头写一个应用程序,请参考如何编写一个Android 应用程序.Android 包含一些C/C++库,这些库能被Android系统中不同的组件使用。

它们通过Android 应用程序框架为开发者提供服务。

以下是一些核心库:∙系统C 库- 一个从BSD 继承来的标准C 系统函数库(libc ),它是专门为基于embedded linux 的设备定制的。

∙媒体库- 基于PacketVideo OpenCORE;该库支持多种常用的音频、视频格式回放和录制,同时支持静态图像文件。

编码格式包括MPEG4,H.264, MP3, AAC, AMR, JPG, PNG 。

∙Surface Manager - 对显示子系统的管理,并且为多个应用程序提供了2D和3D图层的无缝融合。

∙LibWebCore - 一个最新的web浏览器引擎用,支持Android浏览器和一个可嵌入的web视图。

∙SGL - 底层的2D图形引擎∙3D libraries - 基于OpenGL ES 1.0 APIs实现;该库可以使用硬件3D 加速(如果可用)或者使用高度优化的3D软加速。

Android WifiP2pManager 官方API文档翻译

Android WifiP2pManager 官方API文档翻译
使用预关联搜索服务,应用程序可以先于设备之间的连接建立前给予建议。当前,基于DNS的搜索服务(Bonjour)和Upnp是支持的较高层的协议,可在找到Bonjour资源,在上找到Upnp资源。
应用程序可通过调用addLocalService(WifiP2pManager.Channel, WifiP2pServiceInfo, WifiP2pManager.ActionListener)注册一个Upnp或者Bonjour服务。当添加完一个本地的服务后,framwork会在一个p2p连接建立之前自动的响应点搜索服务。调用removeLocalService(WifiP2pManager.Channel, WifiP2pServiceInfo, WifiP2pManager.ActionListener)可以取消一个本地服务,而clearLocalServices(WifiP2pManager.Channel, WifiP2pManager.ActionListener)可以用来清除所有的本地服务。
应用程序通过connect(WifiP2pManager.Channel, WifiP2pConfig, WifiP2pManager.ActionListener)来初始化一个连接到p2p点的请求,详细的配置信息可通过WifiP2pConfig来获取。如果想与传统不支持p2p的设备通信,应用程序可通过createGroup(WifiP2pManager.Channel, WifiP2pManager.ActionListener)创建一个组从而创建一个访问接入点,这个接入点可通过requestGroupInfo(WifiP2pManager.Channel, WifiP2pManager.GroupInfoListener)来获取到。
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Android2.2——API中文文档LLGYZB@目录:(1)—— TextView(2)—— EditText(3)—— AccessibilityService(4)—— Manifest(5)—— View(6)—— ImageView(7)—— ImageButton(8)—— QuickContactBadge(9)—— ZoomButton(10)—— CheckBox(11)—— RadioButton(12)—— Button(13)—— ToggleButton(14)—— ViewStub(15)——GridView一、TextView1、结构ng.Object↳android.view.View↳android.widget.TextView2、已知直接子类:Button, CheckedTextView, Chronometer, DigitalClock, EditText3、已知间接子类:AutoCompleteTextView, CheckBox, CompoundButton, ExtractEditText,MultiAutoCompleteTextView, RadioButton, ToggleButton二、EditText1、结构ng.Object↳ android.view.View↳android.widget.TextView↳ android.widget.EditText已知直接子类:AutoCompleteTextView, ExtractEditText已知间接子类: MultiAutoCompleteTextView2、xml 属性补充说明:a).由于是继承自TextView,所以属性是一样的,但是这里重点补充了输入法相关的属性说明和研究,部分注释也做了相应的调整。

b).Word格式下载/source/26641643、例子3.1<!--[endif]-->android:imeOptions例子<EditText android:id="@+id/txtTest" android:imeOptions="actionGo" android:layout_width="100dp" android:layout_height="wrap_con tent"></EditText>((EditText)findViewById(R.id.txtTest)).setOnEditorActionListener( new TextView.OnEditorActionListener() {@Overridepublic boolean onEditorAction(TextView v, int actionI d,KeyEvent event) {if (actionId == EditorInfo.IME_ACTION_GO) {Toast.makeText(TestActivity.this, "你点了Go!", Toast.LENGTH_SHORT).show();}return false;}});三、AccessibilityService1、结构ng.Object↳android.content.Context↳android.content.ContextWrapper↳android.app.Service↳android.accessibilityservice.AccessibilityServicepublic abstract class AccessibilityService extends Service2、类概述当AccessibilityEvent事件被启动后AccessibilityService 会接收回调函数运行于后台,这些事件指的是在用户接口间的状态转换,比如,焦点变化,按钮被点击等。

一些辅助服务继承于此类并且实现它的抽象方法,像这样的一个服务和其他服务一样在AndroidManifest.xml中被声明但它必须被指定操纵android.accessibilityservice.AccessibilityService的意图,下面的是一段例子:<service android:name=".MyAccessibilityService"><intent-filter><action android:name="android.accessibilityservice.AccessibilityServi ce"/></intent-filter></service>辅助服务的声明周期只能被系统管理,启动或者停止这个服务必须由明确的用户通过启用或停用设备的设定,在系统通过呼叫onServiceConnected()方法与服务绑定后,这个方法才能被想要执行装载的客户端所重载使用,一个辅助服务通过呼叫setServiceInfo(AccessibilityServiceInfo)方法来设定AccessibilityServiceInfo而配置。

你可以在任何时候改变这个服务的配置但最好是在重载方法onServiceConnected().中来使用。

一个辅助服务可以在特定的包中注册事件以提供特殊的反馈类型并且当最后一个关联的事件被解除的时候发出明确的超时提醒。

3、通告策略对于每个回馈类型只有一个辅助服务被通知,服务登记处按顺序被通知,因此,如果有两个服务为同一个包中的同一回馈类型注册那么第一个会被通知,然而有可能的是,可以为一个给定的回馈类型去把一个服务注册为默认的,这样的话如果没有其他的服务来取代这个事件这个服务就会被呼出使用,换句话说,默认的服务不会与其他的服务竞争并且不管注册的顺序而被通知。

4、公共方法:4.1 abstract void onAccessibilityEvent(AccessibilityEvent event)Callback for AccessibilityEvents.参数event 一个事件4.2 public final IBinder onBind (Intent intent)实现返回一个内部的辅助接口的实现,子类不能被重写。

参数 intent 与服务相绑定的意图,注意其他任何包含在Intent的外部意图将不能在此使用。

返回值返回一个客户端可以在服务上访问的IBinder。

4.3 public abstract void onInterrupt ()打断辅助回馈内容时呼叫。

5、保护方法:5.1 protected void onServiceConnected ()这个方法是AccessibilityService声明周期的一部分,在系统成功与服务绑定后才被呼叫,如果用来设定AccessibilityServiceInfo.这个方法更为方便。

四、Mainfest1、结构ng.Object↳ android.Manifestpublic final class Manifest extends Object 内部类Manifest.permissionManifest.permission_group2、Manifest.permission的常量<!--[endif]-->3、Manifest.permission_group的常量<!--[endif]-->五、View1、结构ng.Object↳ android.view.View已知直接子类:AnalogClock, ImageView, KeyboardView, ProgressBar, SurfaceView, TextView, ViewGroup, ViewStub已知间接子类:AbsListView, AbsSeekBar, AbsSpinner, AbsoluteLayout, AdapterView<T extends Adapter>, AppWidgetHostView, AutoCompleteTextView, Button, CheckBox, CheckedTextView, Chronometer, CompoundButton, DatePicker, DialerFilter, DigitalClock, EditText, ExpandableListView, ExtractEditText, FrameLayout, GLSurfaceView, Gallery, GestureOverlayView, GridView, HorizontalScrollView, ImageButton, ImageSwitcher, LinearLayout, ListView, MediaController, MultiAutoCompleteTextView, QuickContactBadge, RadioButton, RadioGroup, RatingBar, RelativeLayout, ScrollView, SeekBar, SlidingDrawer, Spinner, TabHost, TabWidget, TableLayout, TableRow, TextSwitcher, TimePicker, ToggleButton, TwoLineListItem, VideoView, ViewAnimator, ViewFlipper, ViewSwitcher, WebView, ZoomButton, ZoomControls2、xml属性设置底部的边距,以像素为单位填充空白。

3、公共方法(部分)boolean awakenScrollBars()boolean awakenScrollBars(int startDelay, boolean invalidate)boolean awakenScrollBars(int startDelay)int computeHorizontalScrollExtent()int computeHorizontalScrollOffset()int computeHorizontalScrollRange()int computeVerticalScrollExtent()int computeVerticalScrollOffset()int computeVerticalScrollRange()void dispatchDraw(Canvas canvas)void dispatchRestoreInstanceState(SparseArray<Parcelable> container) void dispatchSaveInstanceState(SparseArray<Parcelable> container)void dispatchSetPressed(boolean pressed)void dispatchSetSelected(boolean selected)void dispatchVisibilityChanged(View changedView, int visibility)void drawableStateChanged()boolean fitSystemWindows(Rect insets)float getBottomFadingEdgeStrength()int getBottomPaddingOffset()ContextMenu.ContextMenuInfo getContextMenuInfo()int getHorizontalScrollbarHeight()float getLeftFadingEdgeStrength()int getLeftPaddingOffset()float getRightFadingEdgeStrength()int getRightPaddingOffset()int getSuggestedMinimumHeight()int getSuggestedMinimumWidth()float getTopFadingEdgeStrength()int getTopPaddingOffset()int getWindowAttachCount()void initializeFadingEdge(TypedArray a)void initializeScrollbars(TypedArray a)boolean isPaddingOffsetRequired()static int[] mergeDrawableStates(int[] baseState, int[] additionalState)void onAnimationEnd()void onAnimationStart()void onAttachedToWindow()void onConfigurationChanged(Configuration newConfig)void onCreateContextMenu(ContextMenu menu)int[] onCreateDrawableState(int extraSpace)void onDetachedFromWindow()void onDisplayHint(int hint)void onDraw(Canvas canvas)final void onDrawScrollBars(Canvas canvas)void onFinishInflate()void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect)void onLayout(boolean changed, int left, int top, int right, int bottom)void onMeasure(int widthMeasureSpec, int heightMeasureSpec)void onRestoreInstanceState(Parcelable state)Parcelable onSaveInstanceState()void onScrollChanged(int l, int t, int oldl, int oldt)boolean onSetAlpha(int alpha)void onSizeChanged(int w, int h, int oldw, int oldh)void onVisibilityChanged(View changedView, int visibility)void onWindowVisibilityChanged(int visibility)final void setMeasuredDimension(int measuredWidth, int measuredHeight)boolean verifyDrawable(Drawable who)4、代码4.1android:duplicateParentState<LinearLayout android:clickable="true" android:background="#ff0fff" android:layout_width="100dp" android:layout_height="100dp"> <Button android:duplicateParentState="true" android:layout_width="wrap_content" android:layout_height="wrap_content"/></LinearLayout>4.2android:scrollbars<EditText android:layout_width="fill_parent"android:layout_height="wrap_content" android:minHeight="50dp" android:background="@android:drawable/editbox_background"android:scrollbars="vertical"android:maxLines="4"></EditText>5、遗留问题5.1以下几个属性翻遍了资料试了很多次都没有效果,只能暂时搁置,以后补上,也欢迎的大家提供意见和线索,分享大家的经验:android:scrollbarAlwaysDrawHorizontalTrackandroid:scrollbarAlwaysDrawVerticalTrackandroid:isScrollContainer六、ImagesView2、结构ng.Object↳android.view.View↳android.widget.ImageView已知直接子类:ImageButton, QuickContactBadge已知间接子类:ZoomButton2、类概述显示任意图像,例如图标。

相关文档
最新文档