android sample 之 其他

来源:互联网 发布:js 对象转换为url参数 编辑:程序博客网 时间:2024/06/05 07:48

目标:通过学习demo,进行总结来掌握Adroid的SDK. 就像学习delphi的demo掌握cds.delta一样。这样来达到应聘的要求

Android4.X和Android2.0相比。有些地方改动比较大SurfaceFlinger部分,4.0改动较大;
有些改动,但是原理是一样的,只是细节改动;有些不改动

BluetoothLeGatt(Android4.3及以上)

This sample demonstrates how to use the Bluetooth Low Energy Generic Attribute Profile (GATT) to transmit 
arbitrary data between devices. For more information about using Android's suppport for Bluetooth Low Energy, 
see Bluetooth Low Energy.
此示例演示了如何使用蓝牙低功耗通用属性简介( GATT )来传输
设备之间的任意数据。有关使用Android的suppport蓝牙低能量的更多信息,
看到Bluetooth Low Energy。(http://developer.android.com/guide/topics/connectivity/bluetooth-le.html)




CardEmulation(Android 4.4及以上)
This sample demonstrates how to emulate an NFC card, using the Host Card Emulation feature added in Android 4.4. 
This sample makes the device appear as a loyalty card whenever the screen is on and the user taps their device on 
an appropriately configured NFC reader.
The CardReader sample can be used to read the loyalty card implemented in this sample.


这个sample展示在在Android 4.4.新增的功能使用Host Card Emulation去仿真一个NFC卡。
这个sample让设备在屏幕上显示像是一个loyalty card, 和用户点击他们恰当配置的NFC阅读器时。
CardReader sample能够被用来读取在这个sample.中实现的loyalty card。
附注:NFC功能Android手机上进行卡模拟(Card Emulation)官方技术说明文档
http://download.csdn.net/detail/anranzhifeng/8026581
相关的卡操作的范例,请看: http://www.myexception.cn/operating-system/1604473.html








CardReader(Android 4.4及以上)
This sample demonstrates how to implement a low-level NFC card reader, 
for reading cards that do not contain NDEF or Android Beam data. 
This sample is designed to read the virtual loyalty card implemented in the CardEmulation sample.
In particular, this sample demonstrates how to disable Android Beam, select which AIDs the reader is interested in, 
and establish communication with the card. See Host-based Card Emulation for more information on the HCE APIs.
此示例演示如何实现一个低级别的NFC读卡器,用于读取不包含NDEF或Android Beam数据。
此示例的目的是读取CardEmulation sample中实现虚拟loyalty card。
特别低,这个sample展示了艾滋病读者感兴趣的,建立通信的卡如何禁用Android Beam。
了解更多Host-based Card Emulation请看HCE APIs()


NetworkConnect
This sample demonstrates how to connect to the network and fetch raw HTML. 
The sample uses AsyncTask to perform the fetch on a background thread.
这个实例展示如何连接到网络和获取一个合法的HTML.
这个例子是使用同步任务在一个后台线程上执行获取(数据)




AppRestrictions
This sample demonstrates the use of the App Restriction feature, which is available on Android 4.3 and above 
tablet device with the multiuser feature. When launched under the primary User account, you can toggle 
between standard app restriction types and custom. When launched under a restricted profile, 
this activity displays app restriction settings, if available.
此示例演示了如何使用应用程序限制功能,该功能可以是在Android 4.3及以上平板电脑的多用户功能。
当主用户下启动,您可以在标准的和自定义的APP限制类型直接切换。
当在受限的文件启动,如果有(限制设置)会在该activity显示APP的限制设定。
附注:最低API18


StorageClient
This sample demonstrates how to use the ACTION_OPEN_DOCUMENT intent to let users choose a file via the system's file browser. 
This intent allows a client application to access a list of document providers on the device, and choose a file from any of them
此示例演示了如何使用ACTION_OPEN_DOCUMENT intent  让用户通过系统的文件浏览器选择一个文件。
这intent允许客户端应用程序可以访问一个设备的文档列表,并(从列表中)选择任何一个文件
附注:最低API19


StorageProvider
This sample demonstrates how to use the DocumentsProvider API to manage documents and expose them to the Android system for sharing
此示例演示了如何使用DocumentsProvider API来管理文件,并把它们暴露在Android系统中共享
附注:最低API19


BasicGestureDetect
This sample demonstrates how to use the GestureDetector API to detect simple dragging and tapping gestures.
To learn more about detecting basic touch gestures such as scrolling, flinging, and double-tapping, see Detecting Common Gestures.
这个sample 展示如何利用手势API去监测简单的拖动和tapping手势。
了解更多的监测基础手势,比如:滚动,flinging, double-tapping。看通用手势(http://developer.android.com/training/gestures/detector.html)




BasicMultitouch
This samples demonstrates how to use the MotionEvent API to keep track of individual touches across multiple touch events.
To see this in action, run the sample and touch the screen with multiple fingers to show that the pointer id 
(also represented by a colour) does not change as new touch events are received.
该samples 演示了如何使用MotionEvent API通过多个触摸事件跟踪单独接触的。
为了看到这个动作,运行sample和用多个手指触摸屏,以显示该指针标识(也用一种颜色表示)直到接收到新的触摸事件才改变


BasicMediaDecoder
This sample demonstrates how to decode a video using the MediaCodec API and render in an activity
此示例演示如何使用MediaCodec API来解码视频和渲染活动


BasicMediaRouter
This sample demonstrates how to use the MediaRouter API to display content on a secondary display
To see this in action, run the sample and use the Media Route Action Item in the action bar to select an output device. 
If your device supports Miracast wireless displays, you may need to enable Wireless Display functionality in the system settings。
You can also enable secondary screen simulation from the Developer options in the system Settings. Once connected,
use the Change Color button to change the background color of the secondary screen
此示例演示了如何使用MediaRouter API来辅助显示器上显示内容。为了看到这个动作,运行sample并且使用动作栏中的Media Route Action Item去选择
一个输出设备。如果你的设备支持Miracast无线显示,你可能需要启用系统设置无线显示功能。
您还可以启用从系统设置中的开发人员选项辅助模拟屏。一旦连接,使用更改颜色按钮来改变二次屏幕的背景颜色。


Camera2Basic
This sample demonstrates the basic use of Camera2 API. Check the source code to see how you can display camera preview and take pictures
此示例演示了基本的使用Camera2 API。查看源代码可以看到显示相机如何预览和拍照


Camera2Video
此示例演示了如何使用Camera2 API来录制视频


HdrViewfinder
This demo implements a real-time high-dynamic-range camera viewfinder, by alternating the sensor\'s exposure time
 between two exposure values on even and odd frames, and then compositing together the latest two frames whenever 
a new frame is captured
该演示实现了实时高动态范围拍照取景,交替2曝光值之间的传感器\的曝光时间对偶数和奇数帧,
每当一个新的帧被捕获将最新的两帧合成在一起,


MediaRecorder
This sample demonstrates how to use the MediaRecorder API to record video from a camera or camcorder, and display a preview of the recording
此示例演示了如何使用MediaRecorder API从相机或摄像机录制视频,并显示这个录制。


MediaRouter
This sample demonstrates how to create a custom media route provider.




BasicRenderScript
此示例演示了使用RenderScript的基本步骤。在这个例子中,应用程序使用RenderScript到一个图像上执行的图形过滤器的操作


RenderScriptIntrinsic
This sample demonstrates how to use RenderScript intrinsics. The app creates several RenderScript intrinsics 
and shows a filtering result with various parameters. The sample also shows how to extend RadioButton with StateListDrawable
此示例演示了如何使用RenderScript内部函数。该应用程序创建多个RenderScript内在和显示各种参数的滤波效果。
该示例还展示了如何用StateListDrawable来扩展单选按钮


BasicAndroidKeyStore
This sample demonstrates how to use a {java.security.KeyStore} to safely create and store encryption keys 
that only your application can access. You can also sign data using those keys.
to see this in action, run the sample application and click:
Create to create a new KeyPair.
Sign to sign some data using a KeyPair.
Verify to verify the data using the signature provided.
此示例演示如何使用{java.security.KeyStore}安全地创建只有你的应用程序才可以访问存储的加密密钥。
您还可以登录使用这些密钥的数据。为了看到这动作,运行sample应用和单击
Create to create a new KeyPair.
Sign to sign some data using a KeyPair.
Verify to verify the data using the signature provided.


BatchStepSensor
This sample demonstrates the use of the two step sensors (step detector and counter) and sensor batching. 
It shows how to register a SensorEventListener with and without batching and shows how these events are received
此示例演示了如何使用两步传感器(步骤检测器和计数器)和传感器配合。它显示了如何注册一个带和不带batching的SensorEventListener,
并显示了如何接收这些事件


ActivityInstrumentation
This sample demonstrates how to use an InstrumentationTestCase to test the internal state of an Activity.
To learn more about using Android's custom testing framework, see Testing Your Android Activity
此示例演示如何使用InstrumentationTestCase来测试Activity的内部状态。
要了解更多关于使用Android的自定义测试框架,参考Testing Your Android Activity.
(http://developer.android.com/training/activity-testing/index.html)


TextLinkify
This sample demonstrates how to add clickable links to a TextView, by using these techniques:
Setting the TextView_autoLink property to automatically convert the text to a link.
Parsing a String as HTML
Manually by constructing a SpannableString.
此示例演示了如何通过如下这些技术,添加一个点击链接到TextView 
设置TextView_autoLink属性为自动转换到链接
将 String 解释成HTML
手动创建SpannableString.


ActionBarCompat-Basic
This sample demonstrates how to create a basic action bar that displays action items. 
The sample shows how to inflate items from a menu resource, and how to add items programatically. 
To reduce clutter, rarely used actions are displayed in an action bar overflow.
The activity in this sample extends from ActionBarActivity, which provides the functionality necessary to display a compatible action bar on devices running Android 2.1 and higher
This sample demonstrates如何创建一个显示动作项的基础动作栏。
The sample shows怎么样去利用菜单资源去布局,and 如何编程增加items 。
为了减少混乱,很少用动作显示在操作栏上。
此示例中的activity继承自ActionBarActivity ,ActionBarActivity 提供Android 2.1以上兼容动作栏的功能


ActionBarCompat-ListPopupMenu
This sample demonstrates how to use a backward compatible PopupMenu to create a list, where each list item contains a dropdown menu
此示例演示了如何使用向后兼容的PopupMenu创建一个列表,每个列表项包含一个下拉菜单




ActionBarCompat-ShareActionProvider
This sample demonstrates how to use a context-sensitive ShareActionProvider that is backward compatible
此示例演示了如何使用向后兼容的上下文敏感ShareActionProvider


UI都是介绍界面设计的一些类;WareAble栏中的实例很少用到,暂时不看。
0 0
原创粉丝点击