自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

修学储能,平凡之路

一个小程序员的开发点滴

  • 博客(109)
  • 资源 (2)
  • 收藏
  • 关注

原创 Android app跳转google play store

final String appPackageName = getPackageName(); // getPackageName() from Context or Activity object                try {                    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("

2015-03-03 04:14:13 8541

原创 android细节之禁用activity的系统的默认切换效果

网上有很多方法来禁用系统的默认效果,这里贴上来我认为最简单的方法。overridePendingTransition(Animation.INFINITE, Animation.INFINITE);这句话一般是我们用来替换自己的自定义的activity效果。直接用Animation类下的infinity即可。就看不到系统那个突突的切换效果了。好了,小伙伴们开始愉快的

2014-09-18 22:53:32 2121

原创 android 4.0 禁用系统home键(续)

上次的方法,我亲测在note3以及s5上可用。但有热心的朋友回复说在其他类型手机上无法成功禁用系统home键。于是我又去搜了下,最后发现这一篇帖子:跪求屏蔽home键和recentApp的方法 !! http://c.tieba.baidu.com/p/3225440025?pn=2在这篇帖子的最后面有一个很简单的方法,应该可以实现我们所需要的功能。(貌似华为的手机

2014-09-16 21:46:45 1829 6

原创 android 4.0 禁用系统home键

2.2 禁用系统home键,这里不说了。最近项目有一个需求,禁用系统的所有键,像menu, home, back.同时还要是想点击响应与view的弹出。就是UI这部分要正常。back键我们自己onKeyDown 禁用的好开心。个人认为最简单的写法请移步:http://blog.csdn.net/yiding_he/article/details/38527813这里关键

2014-09-05 01:42:27 3217 10

原创 android细节保持手机屏幕常亮不锁屏

今天做项目用到了一个非常有意思的东东,上网查了下资料,需求是点击某一个键使屏幕常亮不锁屏。试了几种,发现下面这种写法最简单,getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

2014-09-04 01:23:36 2497

原创 android 细节之An internal error occurred during: "Launching New_configuration".

今天在导入公司的一个小demo时候发现了一个很有意思的错误。An internal error occurred during: "Launching New_configuration". Path for project must have only one segment.于是上网搜寻了一下怎么解决:具体的解决方法有两种:一、Run Confi

2014-08-25 23:27:13 1642

原创 android 细节之android.view.InflateException: Binary XML file line #95: Error inflating class(out of m)

今天的异常很有意思,叫做android.view.InflateException: Binary XML file line #95: Error inflating class(out of memory) 。其实是因为out of memory,导致 xml是不可能被充气成功,因此activity的onCreate方法中,setContentView(R.layout.***)也就不

2014-08-16 00:15:01 7838

原创 android 细节之 AndroidRuntimeException:This message is already in use

今天在做项目处理消息队列的时候,遇到了这样一个问题,一个异常。AndroidRuntimeException:This message is already in use。我当时的具体业务需求情境为,想要跟硬件联动的时候,保持在一定时间内只有一个操作,如果不idle,就重新发送消息,并且此消息应该delay一段时间,就是TIMEDELAY。具体出现错误的代码如下:private cla

2014-08-15 04:15:09 3628

原创 android 细节之禁用返回键

今天项目中需要使用自己actionBar中的返回键,用的方法就是上次我记录下的父亲activity的方法android.support.PARENT_ACTIVITY详情请移步:http://blog.csdn.net/yiding_he/article/details/38410151(android 细节之 menu 之 invalidateOptionsMenu)今天的问

2014-08-13 02:46:11 15857 1

原创 android细节之java.util.ConcurrentModificationException异常

今天在做android项目的时候,遇到了这个异常,好吧,其实平常遇到最多的异常是IllegalstateException,都是跟我们硬件相连的SDK抛出来的,把我折磨的欲生欲死啊。扯远了。说回到今天的这个异常,java.util.ConcurrentModificationException异常,一开始我愣了一下,貌似从来没遇到过这个,然后果断百度大神,这才发现:原因是你遍历该集合时,对

2014-08-12 05:54:28 2670

原创 android 细节之 旋转动画

Flip Animation for Android:最近项目中用到了一个小动画,让物体实现一定的3D旋转效果,现记录如下:public class FlipAnimation extends Animation { private Camera mCamera; private View mFromView; private View mToVi

2014-08-09 04:13:40 1057

原创 android 细节之 menu 之 invalidateOptionsMenu

menu 在 android中是个非常常用的控件,以前自己做项目的时候通常都是将系统的menu相关方法在activity中直接删去,并且将主题换为fullscreen,然后再在layout中引入自己画好的新的标题栏。实际上有更好的方法。并不需要将系统方法删去,只需要将系统menu加上自己的图片,例如: <item android:id="@+id/menu_

2014-08-07 01:49:49 19290

原创 android database 相关

以前用database从来都是直接执行,db.execute()。今天看公司1.0的源码中又学习了一个逻辑, SecureSQLiteDatabase db = null;        try {            db = mOpenHelper.openDatabase();            db.beginTransaction(); 

2014-08-02 05:07:24 976

原创 Android actionBar

今天做公司项目的时候用到了一个新的东东,getActionBar().setDisplayHomeAsUpEnabled(true);这个神奇的东东是使得actionBar上面会出现一个向左的小箭头。按下它就相当于back,对应的事件是ActionBar.DISPLAY_HOME_AS_UP.以前做项目为省劲总是在2.0上混,这个东西是在4.0以后默认为false。

2014-08-02 02:56:30 1354

原创 html 1.1

html 和 htm 有什么区别1.

2014-04-23 10:44:37 970

原创 leetcode JAVA Unique Binary Search Trees II 4.28 难度系数4

Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example,Given n = 3, your program should return all 5 unique BST's shown below. 1 3

2014-03-10 11:36:09 3529

原创 leetcode JAVA Subsets II 4.26 难度系数4

Given a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain dupli

2014-03-10 09:58:12 1805

原创 leetcode JAVA Reverse Words in a String 难度系数2-3?最新题151

昨天睡觉之前,同学提醒说leetcode出了道新题,早上爬起来做了一下,本来用了string的split,写完发现二了,没有办法切割多个空格的情况,如果想切割多个空格,那就一定要带上正则表达式了。于是老老实实的从头遍历到尾。好吧,上代码:Reverse Words in a StringGiven an input string, reverse the string wo

2014-03-07 23:03:17 2933 3

原创 cracking the code interview problem 1.3

//Given two Strings,write a method to decide if one is a permutation of the other.//ask what the complexity of time, can we use sort first?//if we can use sort:public class Solution { public stati

2014-02-19 04:05:16 1129

原创 cracking the code interview problem 1.1

public class Solution { public static boolean isUnique(String str){ if(str.length()>256) return false; boolean[] visited = new boolean[256]; for(int i=0;i<str.length();i++){ int val = str

2014-02-19 04:04:13 785

原创 Binary Tree Traversal 3 种

百度这张图说明了所有问题,前序遍历得到的结果,root 在最前方。后序遍历得到的结果,root在最后。中序遍历得到的结果,root 在中央。所以leetcode上有关traversal的题目,给定preorder 和 inorder 的结果,tree可还原。给定postorder和inorder的结果,tree可还原。

2014-02-13 03:59:59 1049

原创 leetcode JAVA Palindrome Partitioning 3.45 难度系数3

Question:Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s = "aab",Return

2014-02-11 00:58:06 1140

原创 leetcode JAVA Word Ladder 3.44 难度系数3

Question:Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:Only one letter can be changed at a timeEach inte

2014-02-11 00:56:48 992

原创 leetcode JAVA Best Time to Buy and Sell Stock II 3.43 难度系数3

Question:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you l

2014-02-11 00:54:56 880

原创 leetcode JAVA Triangle 难度系数3 3.42

Question:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2],

2014-02-05 11:34:11 733

原创 leetcode JAVA Populating Next Right Pointers in Each Node 难度系数3 3.41

Question:Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its ne

2014-02-05 11:33:02 926

原创 leetcode JAVA Flatten Binary Tree to Linked List 难度系数3 3.40

Question:Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened tree should look

2014-02-05 11:31:48 1426

原创 leetcode JAVA Binary Tree Level Order Traversal II 难度系数3 3.39

Question:Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree {3,9

2014-02-05 11:30:12 913

原创 leetcode Construct Binary Tree from Inorder and Postorder Traversal 难度系数3 3.38

Question:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree./** * Definition for binary tree * publ

2014-02-05 11:27:46 1154

原创 leetcode JAVA Construct Binary Tree from Preorder and Inorder Traversal 难度系数3 3.37

Question:Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree./** * Definition for binary tree * publi

2014-02-05 11:26:45 1683

原创 leetcode JAVA Binary Tree Level Order Traversal 难度系数3 3.36

Question:Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,9,20,#,#,15,7}, 3 /

2014-02-05 11:25:07 1232

原创 leetcode JAVA Validate Binary Search Tree 难度系数3 3.35

Question:Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than th

2014-02-05 11:22:51 800

原创 leetcode JAVA Unique Binary Search Trees 难度系数3 3.34

Question:Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's. 1 3 3

2014-02-05 11:21:35 1273

原创 leetcode JAVA Restore IP Addresses 难度系数3 3.33

Question:Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given "25525511135",return ["255.255.11.135", "255.255.11

2014-02-05 11:20:12 839

原创 leetcode JAVA Reverse Linked List II 3.32

Question:Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note:Given m, n satisfy the follow

2014-02-05 11:18:22 1019

原创 leetcode JAVA Decode Ways 难度系数3 3.31

Question:A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determi

2014-02-05 11:17:11 833

原创 leetcode JAVA Partition List 难度系数3 3.30

Question:Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original relative order of the n

2014-02-05 10:05:40 893

原创 leetcode JAVA Remove Duplicates from Sorted List II 难度系数3 3.29

Question:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->

2014-02-01 11:36:25 1135

原创 leetcode JAVA Word Search 难度系数3 3.28

Question:Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontall

2014-02-01 11:35:00 5902 3

原创 leetcode JAVA Subsets 难度系数3 3.27

Question:Given a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.

2014-02-01 11:33:52 1924

android动态创建fragment,横竖屏切换.

android动态创建fragment,横竖屏切换.

2013-12-19

基于android的医疗记录安全

基于android的医疗记录安全,使用kerberos, 3DES, 进行加密解密和认证. 服务器采用tomcat6.0加mysql. 可以实现医生查看并更新病历,其他5个病人只能查看自己的病历.医生和病人可以相互留言,管理员可以看到注册信息并添加用户.忘记密码时可以实现向管理员留言.

2013-12-12

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除