基本视图——DatePicker

作者:追风剑情 发布于:2015-9-1 21:37 分类:Android

示例一: 在活动中显示DatePicker 视图 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill...

阅读全文>>

标签: Android

评论(0) 浏览(3236)

基本视图——TimePicker

作者:追风剑情 发布于:2015-8-31 21:46 分类:Android

示例一: 在活动中显示TimePicker 视图 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill...

阅读全文>>

标签: Android

评论(0) 浏览(3508)

Shader——Alpha裁剪

作者:追风剑情 发布于:2015-8-30 11:26 分类:Shader

如果你的画面性能存在问题,使用这种类型的透明度是很有利的,因为处理半透明着色器的混合过程比裁剪透明消耗更大。但是在手机设备正好相反,因为检测贴图中的每一个像素对于手机那点可怜的GPU来说消耗太大。所以,如果你使用Unity3D来制作手机应用,记住要使用半透明技术,慎用裁剪透明技术。 Shader "Custom/LambertAlpha" { Properties { _Mai...

阅读全文>>

标签: Shader

评论(0) 浏览(4448)

基本视图——AutoCompleteTextView

作者:追风剑情 发布于:2015-8-29 19:10 分类:Android

视图 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_heig...

阅读全文>>

标签: Android

评论(0) 浏览(3001)

使用alpha参数创建透明效果

作者:追风剑情 发布于:2015-8-27 23:10 分类:Shader

一、准备一张黑白图片512x512像素 一、创建LambertAlpha.shader和LambertAlpha.mat Shader "Custom/LambertAlpha" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _TransVal ("Transparency Value", Ra...

阅读全文>>

标签: Shader

评论(0) 浏览(2877)

基本视图——ProgressBar

作者:追风剑情 发布于:2015-8-25 22:09 分类:Android

示例一 视图 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" and...

阅读全文>>

标签: Android

评论(0) 浏览(3118)

基本视图

作者:追风剑情 发布于:2015-8-23 16:52 分类:Android

基本视图: TextView EditText Button ImageButton CheckBox ToggleButton RadioButton RadioGroup ...

阅读全文>>

标签: Android

评论(0) 浏览(6067)

创建和使用数据库

作者:追风剑情 发布于:2015-8-22 18:52 分类:Android

Android使用的是SQLite数据库系统。为一人应用程序所创建的数据库只能被此应用程序访问,其他应用程序将不能访问它。以编程方式创建的SQLite数据库总是存储在/data/data/<package_name>/databases文件夹下。 一、创建数据库辅助类 package com.example.androidtest; import andro...

阅读全文>>

标签: Android

评论(0) 浏览(3222)

使用内容提供者——Contacts

作者:追风剑情 发布于:2015-8-18 22:19 分类:Android

使用内容提供者contacts获取手机中所有联系人,并显示在列表中。 一、在AndroidManifest.xml中添加权限 <uses-permission android:name="android.permission.READ_CONTACTS" /> 二、创建活动 视图 <LinearLayout xmlns:an...

阅读全文>>

标签: Android

评论(0) 浏览(3354)

使用静态资源——raw

作者:追风剑情 发布于:2015-8-17 20:42 分类:Android

一、放个txt文件到res/raw/textfile.txt 二、创建活动 package com.example.androidtest; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStrea...

阅读全文>>

标签: Android

评论(0) 浏览(13405)

显示通知——Notification

作者:追风剑情 发布于:2015-8-16 17:21 分类:Android

一、在AndroidManifest.xml中添加权限 <uses-permission android:name="android.permission.VIBRATE" /> 二、创建活动NotificationsActivity 视图 <LinearLayout xmlns:android="http://schemas.and...

阅读全文>>

标签: Android

评论(0) 浏览(4189)

保存文件到外部存储器(SD卡)

作者:追风剑情 发布于:2015-8-13 20:58 分类:Android

在AndroidManifest.xml中添加权限 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 视图 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/andro...

阅读全文>>

标签: Android

评论(0) 浏览(3333)

保存文件到内部存储器

作者:追风剑情 发布于:2015-8-12 21:39 分类:Android

视图 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_heig...

阅读全文>>

标签: Android

评论(0) 浏览(13456)

Http异步下载xml和json文件

作者:追风剑情 发布于:2015-8-10 21:49 分类:Android

package com.example.androidtest; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; imp...

阅读全文>>

标签: Android

评论(0) 浏览(4856)

共享首选项(shared preferences)

作者:追风剑情 发布于:2015-8-8 13:30 分类:Android

用来保存小块数据的轻量经的机制。 一、新建一个xml文件 res\xml\myapppreferences.xml <?xml version="1.0" encoding="utf-8" ?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"...

阅读全文>>

标签: Android

评论(0) 浏览(3190)

Http异步下载文本

作者:追风剑情 发布于:2015-8-6 22:42 分类:Android

活动 package com.example.androidtest; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; impor...

阅读全文>>

标签: Android

评论(0) 浏览(2855)

使用意图对象传递数据

作者:追风剑情 发布于:2015-8-5 21:18 分类:Android

视图activity_passing_data.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pare...

阅读全文>>

标签: Android

评论(0) 浏览(3725)

Http异步下载图片

作者:追风剑情 发布于:2015-8-4 21:50 分类:Android

在AndroidManifest.xml中添加权限配置 <uses-permission android:name="android.permission.INTERNET"/> 视图 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmln...

阅读全文>>

标签: Android

评论(0) 浏览(3097)

理解线程

作者:追风剑情 发布于:2015-8-3 23:06 分类:Android

以下为一个计数器示例,通过这个示例来理解线程。 视图 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_pa...

阅读全文>>

标签: Android

评论(0) 浏览(2905)

将活动绑定到服务

作者:追风剑情 发布于:2015-8-2 17:06 分类:Android

传递数据的一个更好的办法是直接将活动绑定到服务上,这样活动可以直接用服务的任何公共成员和方法。 活动 package com.example.androidtest; import java.net.MalformedURLException; import java.net.URL; import android.app.Activity; import a...

阅读全文>>

标签: Android

评论(0) 浏览(2901)

通过Intent向服务传递数据

作者:追风剑情 发布于:2015-8-2 12:07 分类:Android

活动 package com.example.androidtest; import java.net.MalformedURLException; import java.net.URL; import android.app.Activity; import android.content.Intent; import android.os.Bundle; imp...

阅读全文>>

标签: Android

评论(0) 浏览(4074)

服务与活动之间通信

作者:追风剑情 发布于:2015-8-1 21:24 分类:Android

服务使用BroadcastReceiver来与活动通信。 活动 package com.example.androidtest; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android....

阅读全文>>

标签: Android

评论(0) 浏览(2926)

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号