随笔分类 - Android/iOS
摘要:1 申请开发者帐号2 申请APP IDhttps://developer.apple.com/ios/manage/bundles/index.actionDescription:San ZhangBundle Identifier (App ID Suffix): cn.a.appname3 申请CSR钥匙串访问-证书助理-从证书颁发机构求证书填写注册开发账户时的邮箱和用户名,将CSR文件存储到磁盘。4 申请发布证书iOS provisioning portal-certificates-distribution-导入CSR文件-download-打开-在钥匙串访问中显示5 申请distri
阅读全文
摘要:android中定义的dimension单位有以下这些:px(Pixels ,像素):对应屏幕上的实际像素点。in(Inches ,英寸):屏幕物理长度单位。mm(Millimeters ,毫米):屏幕物理长度单位。pt(Points ,磅):屏幕物理长度单位,1/72英寸。dp(与密度无关的像素):逻辑长度单位,在 160 dpi 屏幕上,1dp=1px=1/160英寸。随着密度变化,对应的像素数量也变化,但并没有直接的变化比例。dip:与dp相同,多用于Google示例中。sp(与密度和字体缩放度无关的像素):与dp类似,但是可以根据用户的字体大小首选项进行缩放。尽量使用dp作为空间大小单
阅读全文
摘要:1 得到选择item的值 mContactList.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Cursor c = (Cursor) mContactList.getItemAtPosition(position); String name = c.getString(c.ge...
阅读全文
摘要:1 静态menu2 动态menu 1) 生成menu.xml <?xml version="1.0" encoding="utf-8"?><menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/AddContact" android:title="@string/add_contact"/></menu> 2)重写方法 @Ove
阅读全文
摘要:1 生命周期: There are three key loops you may be interested in monitoring within your activity:Theentire lifetimeof an activity happens between the first call toonCreate(Bundle)through to a single final call toonDestroy(). An activity will do all setup of "global" state in onCreate(), and rele
阅读全文
摘要:1 查看sim卡是否存在 boolean isExist=TelephonyManager.getDefault(0).hasIccCard()
阅读全文
摘要:0Android提供了一个供开发者学习使用的示例程序。其界面如下。图中可以看到,应用列表应为ListView,看其源码发现,并非为简单的ListView,而是采用动态加载的方式。 1 主界面代码如下:ApiDemos 1 /* 2 * Copyright (C) 2007 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compli...
阅读全文
摘要:1 重写onAttachedToWindowpublic void onAttachedToWindow() { this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD); super.onAttachedToWindow(); } 2 重写onKeyDownpublic boolean onKeyDown(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KeyEvent.KEYCODE_H...
阅读全文
摘要:0 程序没有其他错误,但无法正常运行时,先查看权限是否设置正确1 权限节点形式如<uses-permissionandroid:name="android.permission.INTERNET" />,需添加在manifest节点下笔记:资料: android权限大全 Android API:Manifest.permission Android权限机制总结与常见权限不足问题分析
阅读全文
摘要:笔记: Android Preference使用 Android 自定义Preference资料:
阅读全文
摘要:笔记: 根据号码判断联系人是否存在资料: Android联系人读取操作笔记 获取联系人头像
阅读全文
摘要:笔记: StatusBar TitleBar控制资料: android:ellipsize省略文字用法 android 长度单位
阅读全文

浙公网安备 33010602011771号