Android
lzk1018834925
这个作者很懒,什么都没留下…
展开
-
android 时间(TimePicker)日期(DatePicker)选择
俺刚学习Android,第一次使用DatePicker 和 TimePicker,主要是时间日期的选择问题,选择时间日期并显示在文本框内...原创 2011-05-30 11:02:00 · 629 阅读 · 0 评论 -
Android 模拟器 下在SD卡内新建文件夹
D:cd D:\android-sdk-windows\platform-toolsadb shell Enter回车cd sdcardmkdir mp3------建立mp3文件夹cd mp3mkdir mp4 ------在mp3文件夹下建立mp4文件夹原创 2013-11-19 11:16:58 · 562 阅读 · 0 评论 -
Android工程res文件下的三个drawable文件夹
较新版本的Android, 建立工程后会在res文件夹下建立三个drawable文件夹, 刚开始正奇怪. 为什么会出现三个, 后来在网上发现了: drawable- hdpi、drawable- mdpi、drawable-ldpi的区别: (1)drawable-hdpi里面存放高分辨率的图片,如WVGA (480x800),FWVGA (480x854) (2)dr转载 2013-11-19 11:45:33 · 512 阅读 · 0 评论 -
Android spinner 下拉列表标题文字(android:prompt属性)
<Spinner android:id="@+id/spinAddCus_cusSort" android:prompt="@string/cus_cusSort" android:entries="@array/cus_sort" android:layout_height="wrap_content" android:layout_width=原创 2013-11-19 11:13:13 · 2192 阅读 · 0 评论 -
Android 带图片的按钮做法(上下左右)
像这样带有图片和文字的按钮android:drawableTop="@drawable/save" //图片在上边、文字在下边android:drawableBottom="@drawable/save" //图片在下边、文字在上边android:drawableLeft="@drawable/save" //图片在左边、文字在右边(如上图)android:draw原创 2013-11-19 11:15:18 · 826 阅读 · 0 评论 -
Android 调用系统的拍照功能
用于显示拍照过程影像的界面实际上也是一个Activity。因此要调用系统的拍照功能,就要用到7.1.2节介绍的调用其他应用程序的Activity的方式。与拍照功能对应的Action是android.provider.MediaStore.ACTION_IMAGE_CAPTURE。用于拍照的Activity需要返回照片图像数据,因此,需要使用startActivityForResult方法启动这个A转载 2013-11-19 11:18:05 · 497 阅读 · 0 评论 -
Android 下载更新
import java.io.File; import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import or原创 2013-11-19 11:22:51 · 572 阅读 · 0 评论 -
Intent 和Uri 常用到的Intent的URI及其示例
以下是常用到的Intent的URI及其示例,包含了大部分应用中用到的共用Intent。 一、打开一个网页,类别是Intent.ACTION_VIEW Uri uri = Uri.parse(“http://blog.3gstdy.com/”); Intent intent = new Intent(Intent.ACTION_VIEW, uri);二、打开地图并定位转载 2013-11-19 11:34:17 · 504 阅读 · 0 评论 -
Android ListView分割线
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"><ListView android:id="@+id/android:list" a原创 2013-11-19 11:38:27 · 546 阅读 · 0 评论 -
android 应用AES技术加密/解密字符串
package common;import java.security.SecureRandom; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec;转载 2013-11-19 11:11:41 · 493 阅读 · 0 评论 -
android:EditText校验 只输入数字或特定字符
设置EditText,只输入数字或者特定字符方法一:edtLogin_phone.setKeyListener(new DialerKeyListener());方法二:设置EditText属性 android:numeric="integer"方法三:得到EditText的值 根据Java中的NaN做判断...方法四:把EditText的值转换成数字,用t原创 2013-11-19 11:46:06 · 342 阅读 · 0 评论 -
Android 下载文件及写入SD卡
Main.xml代码<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_pare原创 2013-11-19 11:42:17 · 465 阅读 · 0 评论 -
Android应用程序版本号
在应用程序的 升级/维护 策略中, 版本是一个关键的组成部分.用户需要了解在他们的设备上所安装的应用程序的版本的特定信息, 以及已安装程序的升级版本可用的情况.其他应用程序 - 作为同一个套件中发布的其他应用程序 - 需要从系统中查询你的应用程序的版本号, 来确认兼容性和识别依赖情况.发布应用所依存的服务平台(如Android Market)也可能需要查询你的应转载 2013-11-19 10:50:47 · 583 阅读 · 0 评论 -
android 获取设备信息
//需要添加的权限: TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); /* * 电话状态: * 1.tm.CALL_STATE_IDLE=0 无活动 * 2.tm.CALL_STATE_RINGING=1 响转载 2013-11-19 10:55:30 · 465 阅读 · 0 评论 -
Android 界面没有标题
android:theme=”@android:style/Theme.NoTitleBar”//是可以使得TabWidget窗口没有标题原创 2013-11-19 10:56:55 · 494 阅读 · 0 评论 -
Android 发送短信
String goNo=edtphone.getText().toString().trim(); String strContent=edtmess.getText().toString().trim(); SmsManager smsManager=SmsManager.getDefault(); PendingIntent sentIntent = Pe原创 2013-11-19 10:57:31 · 491 阅读 · 0 评论 -
Android 拨打电话
imgBtn_dh=(ImageButton)findViewById(R.id.imgBtnAddCon_dh);//电话 imgBtn_dh.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated转载 2013-11-19 10:59:36 · 475 阅读 · 0 评论 -
Android禁止横屏竖屏切换
在AndroidManifest.xml的activity(需要禁止转向的activity)配置中加入android:screenOrientation="landscape" (landscape是横向,portrait是纵向)要避免在转屏时重启activity,可以通过在androidmanifest.xml文件中重新定义方法android:configChanges="key原创 2013-11-19 11:01:42 · 449 阅读 · 0 评论 -
android程序启动画面之Splash总结(程序启动画面)
方法一:很多应用都会有一个启动界面。欢迎画面慢慢隐现,然后慢慢消隐。实现这种效果的方法有两种(暂时只发现两种)1、使用两个Activity,程序启动时候load第一张Activity,然后由tick触发N秒钟后startActivity另外一张Activity。2、使用一个Activity,可以用到View.gone() 这个方法。把Acitivity的某些元素移除。1、两个Act转载 2013-11-19 11:07:31 · 510 阅读 · 0 评论 -
Android 自定义listView中Item背景
<item android:state_window_focused="false" android:drawable="@drawable/pic1" /> <item android:state_focused="true" android:state_pressed="true" android:drawable= "@drawable/pic2" /> <ite原创 2013-11-19 11:39:36 · 455 阅读 · 0 评论 -
Android ListView常用用法 (长按)
main.xml<LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" andro原创 2013-11-19 11:45:01 · 576 阅读 · 0 评论