- 博客(30)
- 收藏
- 关注
原创 android用户界面之一
android用户界面之一wrap_content:表示内容正好适应屏幕match_parent:表示适应父窗口大小http://jsf.iteye.com/blog/1317093
2016-01-12 10:11:42
250
原创 Building Apps with Graphics & Animation2
Building Apps with Graphics & Animation
2015-12-18 14:19:51
286
原创 Building Apps with Graphics & Animation1
Building Apps with Graphics & Animation
2015-12-18 14:19:23
214
原创 使用更简单的共享Action
ShareActionProvider需要API 14 或以上 xmlns:android="http://schemas.android.com/apk/res/android"> android:id="@+id/menu_item_share" android:showAsAction="ifRoom" android
2015-12-17 16:49:10
771
原创 如何在应用和设备间共享数据之一共享简单的数据之接收
接收什么类型的数据,通过以下方式 android:name=".ui.MyActivity" > android:name="android.intent.action.SEND" /> android:name="android.intent.category.DEFAULT" /> android:mimeType="im
2015-12-17 16:29:28
345
原创 如何在应用和设备间共享数据之一共享简单的数据之发送
发送文本内容:Intent sendIntent = new Intent();sendIntent.setAction(Intent.ACTION_SEND);sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");sendIntent.setType("text/plain");startActivi
2015-12-17 16:20:21
346
原创 从一个Activity中得到结果
有时我们调用一个Activity,并想返回一个结果。则需要用startActivityForResult() 而不是startActivity()。为了允许其他的应用能调用,需要在配置文件Activity中加入,如下图: android:name="ShareActivity"> android:name="android.intent.action.S
2015-12-17 15:49:20
209
原创 启动另一个应用
1 调用隐式的intent,如拨号Uri number = Uri.parse("tel:5551234");Intent callIntent = new Intent(Intent.ACTION_DIAL, number);查看地图:// Map point based on addressUri location = Uri.parse("geo:0,0?q=16
2015-12-17 15:38:42
240
原创 小数据键值对的保存方式
这种方式得到preference_file_key的值,并只是在自己的工程中使用Context context = getActivity();SharedPreferences sharedPref = context.getSharedPreferences( getString(R.string.preference_file_key), Context.MODE_PRIV
2015-12-09 17:00:31
667
1
原创 通过Fragments建立动态的界面 (UI)
创建一个Fragment类import android.os.Bundle;import android.support.v4.app.Fragment;import android.view.LayoutInflater;import android.view.ViewGroup;public class ArticleFragment extends Fragment {
2015-12-09 15:51:05
196
原创 Activity的生命周期
下图上可以很清楚地看到Activity的生命周期Resumed:进行态,用户可以和它进行交互。Paused:暂停态,另一个Activity在前台运行,处于透明态或没有全屏运行。不会接收用户的输入也不会执行任何代码。Stopped:停止态,对用户完全隐藏,。实例和状态信息如成员变量保留,但不执行任何代码。在AndroidManifest.xml中,指定启动所使用的Activity
2015-12-09 15:24:39
176
原创 支持不同的屏幕
创建不同的布局MyProject/ res/ layout/ main.xml layout-large/ main.xml横屏显示方式MyProject/ res/ layout/ main.xml layout-land
2015-12-09 15:13:42
198
原创 支持不同的语言
支持不同的语言,主要是通过定义不同的字符串文件:MyProject/ res/ values/ strings.xml values-es/ strings.xml values-fr/ strings.xml英语:/values/strings.xml:xm
2015-12-09 15:11:36
288
原创 风格化Action Bar
第一种方式是使用Android主题,如: android:theme="@android:style/Theme.Holo.Light" ... />第二种方式是自定义背景:对于android 3.0以上的,可以使用res/values/themes.xml:xml version="1.0" encoding="utf-8"?> name
2015-12-09 14:37:46
215
原创 开始使用Action Bar
Action Bar 在屏幕的最上部,显示和项目相关的标题信息在上面可以增加Action Bar 按钮第一种是以XML方式,位置在:res/menu/main_activity_actions.xml xmlns:android="http://schemas.android.com/apk/res/android" > android:id="@+
2015-12-09 14:06:30
444
原创 开启另一个Activity
因为在<Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/button_send" android:onClick="sendMessage" />中,点击调用的方法为sendMessage,所以在后台
2015-12-08 15:35:39
228
原创 继续第一个andoid工程
在界面视图中, android:id="@+id/edit_message" android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="@string/edit_message" />其中,id为视图中唯一确定这个EditT
2015-12-08 15:15:26
205
原创 续上
在上一例子中,主要包括:AndroidManifest.xml描述了应用的基本特征,并在这里定义了各个组件。src文件夹中,包括应用的主要源程序。src->main->java->包->类的定义。package com.abc.myapplicationd;import android.app.Activity;import android.os.Bundle;impo
2015-12-04 13:18:06
181
原创 创建第一个android应用
在android中,点File->new project点下一步,选择手机类型,再点下一步,选Blank Activity 点完成后,主界面如下:如果通过自己的手机测试,在手机上,设定-开发者选项-USB调试 复选框选中点上面的运行,就可以运行自己的第一个android程序啦。
2015-12-04 13:07:52
257
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人