摘要: /*** 获取手机操作系统版本号:*/public static int getAndroidSDKVersion() {return Build.VERSION.SDK_INT;}/*** 获取手机号码*/public static String getNativePhoneNumber(Context context) {TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);String nativePhoneNumber = te 阅读全文
posted @ 2014-03-12 21:16 下一次ai微笑 阅读(535) 评论(0) 推荐(0) 编辑
摘要: /*** 获取屏幕高度** @param context * @return*/public static int getDisplayWidth(Context context) {DisplayMetrics dm = new DisplayMetrics();WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);wm.getDefaultDisplay().getMetrics(dm);return dm.widthPixels;}/*** 获取屏幕高度** @param c 阅读全文
posted @ 2014-03-12 21:14 下一次ai微笑 阅读(282) 评论(0) 推荐(0) 编辑
摘要: /*** 获取手机IMEI码** @param context * @return*/public static String getIMEI(Context context) {TelephonyManager tm = (TelephonyManager) context.getSystemService(Activity.TELEPHONY_SERVICE);String imei = tm.getDeviceId();if (imei == null)imei = "";return imei;}/*** 获取手机IMSI码** @param context * @ 阅读全文
posted @ 2014-03-12 21:12 下一次ai微笑 阅读(1501) 评论(0) 推荐(0) 编辑
摘要: // 发送短信public static void goSMS(Context context, String tel, String content) {//tel为要发送的电话号码、content为要发送的内容Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:" + tel));intent.putExtra("sms_body", content);context.startActivity(intent);}// 拨打电话(直接拨打)public static vo 阅读全文
posted @ 2014-03-12 21:07 下一次ai微笑 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 原文地址:http://bbs.anzhi.com/forum.php?mod=viewthread&tid=5813109Google基础服务包•GoogleServicesFramework.apk——这个是google基础服务框架,这个是最基础的,google的服务都基于它,一般情况下,要用任何google服务必需先安装它。•GoogleContactsSyncAdapter.apk——这个是google联系人同步服务接口,安装了这个,账户与同步里面的联系人同步才可用,不然点同步就只是一闪而过,根本不执行。•GoogleCalendarSyncAdapter.apk——这个是go 阅读全文
posted @ 2014-03-12 21:00 下一次ai微笑 阅读(18233) 评论(0) 推荐(0) 编辑
摘要: 原文链接:http://developer.android.com/guide/google/play/billing/billing_overview.html目录[隐藏]1应用程序内部付费机制概述1.1产品类型与购买方式1.1.1产品类型1.1.2购买方式1.2应用内支付架构1.3应用内支付消息宏定义1.3.1请求宏定义1.3.2响应宏定义1.3.3消息传递流程1.3.4处理 IN_APP_NOTIFY 消息1.3.5处理多次 IN_APP_NOTIFY 消息1.3.6处理退款和其他未请求便发送的 IN_APP_NOTIFY 消息1.4安全控制1.5应用内支付的要求和限制应用程序内部付费机 阅读全文
posted @ 2014-03-12 20:52 下一次ai微笑 阅读(2500) 评论(0) 推荐(0) 编辑
摘要: SimpleDateFormatsDateFormat=newSimpleDateFormat("yyyy-MM-ddhh:mm:ss"); Stringdate=sDateFormat.format(newjava.util.Date()); yyyy-MM-ddhh:mm:ss形式为 年-月-日 时-分-秒 Calendar calendar = Calendar.getInstance(); calendar.getTimeInMillis();//返回系统时间的毫秒 阅读全文
posted @ 2014-03-12 20:46 下一次ai微笑 阅读(180) 评论(0) 推荐(0) 编辑
摘要: // 获取当前应用应用名public static String getAppName(Context context) { return context.getApplicationInfo().loadLabel(context.getPackageManager()).toString();}// 获取当前应用版本名public static String getVersionName(Context context) {try { return context.getPackageManager().getPackageInfo(context.getPackageName(),... 阅读全文
posted @ 2014-03-12 20:30 下一次ai微笑 阅读(431) 评论(0) 推荐(0) 编辑
摘要: 1.设置全屏 在Activity的onCreate方法中的setContentView(myview)调用之前添加下面代码,可实现全屏 requestWindowFeature(Window.FEATURE_NO_TITLE);//隐藏标题栏 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//设置全屏2.设置横屏两种方式: 1.重写onResume()方法 protected void onResume... 阅读全文
posted @ 2014-03-12 20:02 下一次ai微笑 阅读(536) 评论(0) 推荐(0) 编辑
摘要: 两种情况 1.控件外层父控件为LinearLayout topRightLayout.setLayoutParams(new LinearLayout.LayoutParams((int) (getDisplayWidth(this) * 0.8), LayoutParams.FILL_PARENT)); 1.控件外层父控件为RelativeLayout topRightLayout.setLayoutParams(newRelativeLayout.LayoutParams((int) (getDisplayWidth(this) * 0.8), LayoutParams.F... 阅读全文
posted @ 2014-03-12 19:45 下一次ai微笑 阅读(781) 评论(0) 推荐(0) 编辑
摘要: publicclassCountdownextendsActivity{privateinttime = 30; //初始化时间publicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.countdown);handler.postDelayed(runnable,1000);}Handlerhandler=newHandler();Runnablerunnable=newRunnable(){@Overridepublicvoidrun(){ 阅读全文
posted @ 2014-03-12 18:33 下一次ai微笑 阅读(3038) 评论(0) 推荐(0) 编辑
摘要: 原文地址:http://androidstudy.iteye.com/blog/770512首先:重写EditTextJava代码//请在这里添加您的包名importandroid.content.Context;importandroid.graphics.Canvas;importandroid.graphics.Color;importandroid.graphics.Paint;importandroid.util.AttributeSet;importandroid.widget.EditText;publicclassLineEditTextextendsEditText{priv 阅读全文
posted @ 2014-03-12 16:11 下一次ai微笑 阅读(600) 评论(0) 推荐(0) 编辑