- 博客(63)
- 资源 (1)
- 收藏
- 关注
原创 Android Package and Manifest File
The Android project, sometimes also referred to as an Android package, is a collection of Java packages. Different Android packages can have the same Java package names, whereas the Android package na
2013-04-29 22:32:29 1218
原创 Creating Multiple APKs for Different GL Textures 创建多个APK给不同的GL结构
When developing your Android application to take advantage of multiple APKs on Google Play, it’s important to adopt some good practices from the get-go, and prevent unnecessary headaches further into
2013-04-28 12:53:24 1302
原创 Creating Multiple APKs for Different Screen Sizes 创建多个APKs为不同的屏幕尺寸
When developing your Android application to take advantage of multiple APKs on Google Play, it’s important to adopt some good practices from the get-go, and prevent unnecessary headaches further into
2013-04-28 12:52:37 952
原创 Creating Multiple APKs for Different API Levels 创建多个不同的API级别的APK
When developing your Android application to take advantage of multiple APKs on Google Play, it’s important to adopt some good practices from the get-go, and prevent unnecessary headaches further into
2013-04-28 12:51:32 1351
原创 Controlling the Camera 控制相机
Directly controlling a device camera requires a lot more code than requesting pictures or videos from existing camera applications. However, if you want to build a specialized camera application or so
2013-04-28 12:50:15 1149
原创 Recording Videos Simply 简单录制视频
Your application has a job to do, and integrating videos is only a small part of it. You want to take videos with minimal fuss, and not reinvent the camcorder. Happily, most Android-powered devices al
2013-04-28 12:49:28 1018
原创 Taking Photos Simply 简单地拍摄照片
Suppose you are implementing a crowd-sourced weather service that makes a global weather map by blending together pictures of the sky taken by devices running your client app. Integrating photos is on
2013-04-27 09:48:02 1490
原创 Adding an Easy Share Action 添加一个简单的共享行动
Implementing an effective and user friendly share action in your ActionBar is made even easier with the introduction ofActionProvider in Android 4.0 (API Level 14). An ActionProvider, once attache
2013-04-27 09:47:21 1118
原创 Receiving Content from Other Apps 接收来自其他应用程序的内容
Just as your application can send data to other applications, so too can it easily receive data from applications. Think about how users interact with your application, and what data types you want to
2013-04-27 09:46:04 963
原创 Sending Content to Other Apps 将内容发送到其他应用程序
When you construct an intent, you must specify the action you want the intent to "trigger." Android defines several actions, includingACTION_SEND which, as you can probably guess, indicates that the
2013-04-27 09:43:33 1274
原创 Creating a Custom Account Type 创建自定义帐户类型
So far we've talked about accessing Google APIs, which use accounts and users defined by Google. If you have your own online service, though, it won't have Google accounts or users, so what do you do?
2013-04-27 09:42:02 1317
原创 Authenticating to OAuth2 Services 验证OAuth2服务
In order to securely access an online service, users need to authenticate to the service—they need to provide proof of their identity. For an application that accesses a third-party service, the secur
2013-04-26 10:04:33 1192
原创 Remembering Your User 记住你的用户
Everyone likes it when you remember their name. One of the simplest, most effective things you can do to make your app more lovable is to remember who your user is—especially when the user upgrades to
2013-04-26 10:02:35 902
原创 Remaining Backward Compatible 保持向后兼容
The SearchView and action bar are only available on Android 3.0 and later. To support older platforms, you can fall back to the search dialog. The search dialog is a system provided UI that overlays o
2013-04-26 10:01:34 852
原创 Storing and Searching for Data 数据存储和搜索
There are many ways to store your data, such as in an online database, in a local SQLite database, or even in a text file. It is up to you to decide what is the best solution for your application. Thi
2013-04-26 10:00:34 910
原创 Setting Up the Search Interface 设置搜索界面
Beginning in Android 3.0, using the SearchView widget as an item in the action bar is the preferred way to provide search in your app. Like with all items in the action bar, you can define theSearch
2013-04-26 09:59:38 1125
原创 Optimizing the View 优化视图
Now that you have a well-designed view that responds to gestures and transitions between states, you need to ensure that the view runs fast. To avoid a UI that feels sluggish or stutters during playba
2013-04-26 09:58:32 853
原创 Making the View Interactive 视图互动
Drawing a UI is only one part of creating a custom view. You also need to make your view respond to user input in a way that closely resembles the real-world action you're mimicking. Objects should al
2013-04-20 15:21:01 1066
原创 Custom Drawing 自定义绘制
The most important part of a custom view is its appearance. Custom drawing can be easy or complex according to your application's needs. This lesson covers some of the most common operations.
2013-04-20 15:16:10 977
原创 Creating a View Class 创建一个视图类
A well-designed custom view is much like any other well-designed class. It encapsulates a specific set of functionality with an easy to use interface, it uses CPU and memory efficiently, and so forth.
2013-04-20 15:15:00 1263
原创 Manipulating Broadcast Receivers On Demand 按需操控广播接收
The simplest way to monitor device state changes is to create a BroadcastReceiver for each state you're monitoring and register each of them in your application manifest. Then within each of these rec
2013-04-20 15:13:56 923
原创 Determining and Monitoring the Connectivity Status 根据网络连接状况去省电
Some of the most common uses for repeating alarms and background services is to schedule regular updates of application data from Internet resources, cache data, or execute long running downloads. But
2013-04-20 15:12:37 884
原创 Determining and Monitoring the Docking State and Type 判断并监测设备的停驻状态与类型
Android devices can be docked into several different kinds of docks. These include car or home docks and digital versus analog docks. The dock-state is typically closely linked to the charging state a
2013-04-19 09:58:13 1017
原创 Monitoring the Battery Level and Charging State 监测电池电量和充电状态
When you're altering the frequency of your background updates to reduce the effect of those updates on battery life, checking the current battery level and charging state is a good place to start.
2013-04-19 09:57:06 1607
原创 Dealing with Audio Output Hardware 处理音频输出硬件设备
Users have a number of alternatives when it comes to enjoying the audio from their Android devices. Most devices have a built-in speaker, headphone jacks for wired headsets, and many also feature Blue
2013-04-19 09:55:50 910
原创 Managing Audio Focus 管理音频焦点
With multiple apps potentially playing audio it's important to think about how they should interact. To avoid every music app playing at the same time, Android uses audio focus to moderate audio playb
2013-04-19 09:54:06 1128
原创 Controlling Your App’s Volume and Playback 控制应用程序的音量和播放
A good user experience is a predictable one. If your app plays media it’s important that your users can control the volume of your app using the hardware or software volume controls of their device, b
2013-04-19 09:52:34 942
原创 Animating Layout Changes 动画布局的更改
A layout animation is a pre-loaded animation that the system runs each time you make a change to the layout configuration. All you need to do is set an attribute in the layout to tell the Android syst
2013-04-18 09:53:47 1076
原创 Zooming a View 缩放视图
If you want to jump ahead and see a full working example, download and run the sample app and select the Zoom example. See the following files for the code implementation:src/TouchHighlightImage
2013-04-18 09:52:45 1504
原创 Displaying Card Flip Animations 显示卡片翻转动画
If you want to jump ahead and see a full working example, download and run the sample app and select the Card Flip example. See the following files for the code implementation:src/CardFlipActivi
2013-04-18 09:51:47 1344
原创 Using ViewPager for Screen Slides 使用屏幕幻灯片ViewPager
Screen slides are transitions between one entire screen to another and are common with UIs like setup wizards or slideshows. This lesson shows you how to do screen slides with aViewPager provided by
2013-04-18 09:50:36 1242
原创 Crossfading Two Views 淡入淡出的两种观点
Crossfade animations (also know as dissolve) gradually fade out one UI component while simultaneously fading in another. This animation is useful for situations where you want to switch content or vie
2013-04-18 09:49:11 1065
原创 Implementing Adaptative UI Flows 实施自适应用户界面流程
Depending on the layout that your application is currently showing, the UI flow may be different. For example, if your application is in the dual-pane mode, clicking on an item on the left pane will s
2013-04-17 09:33:23 799
原创 Supporting Different Densities 支持各种屏幕密度
Use Density-independent PixelsOne common pitfall you must avoid when designing your layouts is using absolute pixels to define distances or sizes. Defining layout dimensions with pixels is a problem
2013-04-17 09:32:07 609
原创 Supporting Different Screen Sizes支持不同的屏幕尺寸
Use "wrap_content" and "match_parent"To ensure that your layout is flexible and adapts to different screen sizes, you should use"wrap_content" and"match_parent" for the width and height of some vi
2013-04-17 09:31:34 869 1
原创 Modifying your Download Patterns Based on the Connectivity Type
Use Wi-FiIn most cases a Wi-Fi radio will offer greater bandwidth at a significantly lower battery cost. As a result, you should endeavor to perform data transfers when connected over Wi-Fi whenever
2013-04-17 09:27:08 766
原创 Redundant Downloads are Redundant
The most fundamental way to reduce your downloads is to download only what you need. In terms of data, that means implementing REST APIs that allow you to specify query criteria that limit the returne
2013-04-17 09:26:38 913
原创 Minimizing the Effect of Regular Updates
The optimal frequency of regular updates will vary based on device state, network connectivity, user behavior, and explicit user preferences.Optimizing Battery Life discusses how to build battery-ef
2013-04-16 17:14:29 662
原创 Optimizing Downloads for Efficient Network Access
Using the wireless radio to transfer data is potentially one of your app's most significant sources of battery drain. To minimize the battery drain associated with network activity, it's critical that
2013-04-16 17:11:17 863
原创 Parsing XML Data
Extensible Markup Language (XML) is a set of rules for encoding documents in machine-readable form. XML is a popular format for sharing data on the internet. Websites that frequently update their cont
2013-04-16 17:07:25 794
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人