slider

还是菜鸟
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  android_application

摘要:this is a big problem for me. i follow the solutions that i searched from the internet: modify the listview layout and list-item layou file, 'wrap_content' to 'fill_parent'. but 'getView' function always was voked many time when the value of the 'position' is 0; i thi 阅读全文

posted @ 2013-07-24 10:34 slider 阅读(871) 评论(0) 推荐(0)

摘要:// Globals which should be set before calling this function: // // int polySides = how many corners the polygon has // float polyX[] = horizontal coordinates of corners // float polyY[] = vertical coordinates of corners // float x, y = point to be tested // // (Globals are used ... 阅读全文

posted @ 2013-05-03 10:06 slider 阅读(297) 评论(0) 推荐(0)

摘要:recently, i found a website that post many good artilce. many of them is valuable to read. here is the link: http://www.java2s.com/Code/Android/2D-Graphics/RotateBitmap.htm 阅读全文

posted @ 2013-04-15 12:48 slider 阅读(237) 评论(0) 推荐(0)

摘要:new AsyncTask<Void, Void, String>(){ ProgressDialog progressDialog; protected void onPreExecute() { progressDialog = new ProgressDialog(EditSelectedActivity.this); progressDialog.setMessage(getResources().getString(R.string.d_loading)); ... 阅读全文

posted @ 2013-04-03 15:22 slider 阅读(234) 评论(0) 推荐(0)

摘要:When you're writing an application in which you would like to perform specialized drawing and/or control the animation of graphics, you should do so by drawing through aCanvas. A Canvas works for you as a pretense, or interface, to the actual surface upon which your graphics will be drawn — it h 阅读全文

posted @ 2013-04-01 16:54 slider 阅读(279) 评论(0) 推荐(0)

摘要:i invoke findViewById method like this:view view = LayoutInflater.from(this).inflate(R.layout.xxx,null);Customview myView = view.findviewbyid(R.id.xy);....setcontentView(view); but it keeps return null . after searchs, i found that i shoud call findviewbyid() before setcontentview method. you can... 阅读全文

posted @ 2013-04-01 10:55 slider 阅读(615) 评论(0) 推荐(0)

摘要:An image with higher resolution does not provide any visible benefit, but still takes up precious memory and incurs additional performance overhead due to additional on the fly scaling. Given that you are working with limited memory, ideally you only want to load a lower resolution version in mem... 阅读全文

posted @ 2013-03-28 10:32 slider 阅读(1471) 评论(0) 推荐(0)

摘要:public class Explorer { String TAG = "Explorer"; private final String DISK_DIR = "/mnt"; public static final int DIR_SDCARD = 0; public static final int DIR_SDCARD_EX = 1; // external sdcard public static final int DIR_USB = 2; // usb external storage ... 阅读全文

posted @ 2013-03-26 17:17 slider 阅读(332) 评论(0) 推荐(0)

摘要:private StateListDrawable getStateSelector(ImageEntity image){ StateListDrawable stalistDrawable = new StateListDrawable(); //int normal = android.R.attr.state_empty; //int pressed = android.R.attr.state_pressed; //int focused = android.R.attr.state_focused; //int selected = android.R.attr.stat... 阅读全文

posted @ 2013-03-25 16:04 slider 阅读(553) 评论(0) 推荐(0)

摘要:对象序列化找个东西我不知道怎么用。个人认为许多需要传递大对象的情况都可以避免掉。比如把多个acitivyt的内容写到一个activity中(找个好处还可以同时可以finish掉许多activity哦)。但是作为一个知识,还是写写了,也因为我n久没有更新博客了。 介绍的话就不准备写了,还是代码简单: public class ImageEntity implements Parcelable{ String name; String path; String path1; // first path, default path . replace with select... 阅读全文

posted @ 2013-03-25 16:00 slider 阅读(335) 评论(0) 推荐(0)

摘要:1.首先说说默认不显示输入法,这里通常又三种:在 AndroidMainfest.xml中选择哪个activity,设置windowSoftInputMode属性为 adjustUnspecified|stateHidden < activity android:name=".Main" android:label="@string/app_name" android:windowSoftInputMode="adjustUnspecified|stateHidden" android:configChanges="o 阅读全文

posted @ 2013-03-21 16:10 slider 阅读(1608) 评论(1) 推荐(0)

摘要:这个问题是我在登录注册的时候出现的。Android客户端与DJANGO后台。我每次输入错误密码的时候就会出现上述错误,而输入正确的用户名密码是没有这个错误的。还有一个奇怪的现象:我写一个java测试代码的时候,输入错误的用户名和密码是不会抛出这个异常的,而我把该代码转移到Android程序里面,就会出现这个异常。真实让人费解。。。。 查了下源码发现HttpURLConnectionImpl.java,使用httpurlconnection请求http,有两种状态下会抛出这个异常:/** * React to a failed authorization response by l... 阅读全文

posted @ 2012-07-16 16:29 slider 阅读(1941) 评论(0) 推荐(0)

摘要:很多人问:怎么设置ListView使它高度随内容容量无限延伸?最近我也弄这个需求,网络找了下,发现大多数都是用的是重写LinearLayout方案。而事实上解决这个需求只需要利用ListView的headerview即可。 先说说其它的解决方案吧(这里说的是非利用headview):比如大众点评和凡客的评论列表,我画了一个图如下: 可以看出,大众点评的app评论最为简单:通过一个按钮直接进入comments列表。凡客则采用的是重写LinearLayout方案。至于重写LinearLayout的思路,这里有一片文章:http://www.eoeandroid.com/thre... 阅读全文

posted @ 2012-06-19 13:53 slider 阅读(735) 评论(2) 推荐(1)

该文被密码保护。

posted @ 2012-04-17 17:42 slider 阅读(1) 评论(0) 推荐(0)

摘要:我想保留button的选中状态,用上了setPressed(true)之后发现一个问题。第一次显示Button可以达到设置该Button的状态为选中,但是当点击button后(这里在这个button的onclick方法里面设置setPressed(true))发现选中状态为未选中。达不到想要的效果。最后网上有人看到一个思路:用代码直接改变背景图片可以间接的改变这个问题。效果图: 简单的代码如下: public void onClick(View v) { switch (v.getId()) { case R.id.show_friend... 阅读全文

posted @ 2012-04-17 17:36 slider 阅读(373) 评论(0) 推荐(0)

摘要:android应用中ocr的解决方案大致有两种,而采用最多的还是tesseract.小弟就在这里将我最近两天解决思路写下来,如有缺陷,欢迎拍砖: 有两种解决方案,一种是采用tesseract cloud-service,这钟是把图片信息发送到云端,然后获得图片分析数据;第二种就是不用联网,本地化分析图片上信息。我就说说第二种,第一种我会在最后给大家一个链接(文章很不错)。 搜先就是下载Tesseract native android library.这里有两个链接,你选哪个链接都可以: a.svn checkout http://tesseract-android-tools.goo... 阅读全文

posted @ 2012-03-21 14:49 slider 阅读(9270) 评论(2) 推荐(4)

摘要:通过Android手机上的定位信息来源可分为三种,GPS,Cell-ID,和Wifi. 后两种因为都按来自于网络,所以在Android SDK中统一为基于网络的定位。目前三种定位方式都不够完善,各有优缺点。基于GPS信号的定位在三者中精度较高,但是缺点是当前民用的GPS信号在建筑物内的信号比较差,而且GPS模块启动的时间也比较慢,它的工作原理其实是搜索附近的4颗卫星,根据当前位置到这四颗卫星的距离来定位,GPS模块找到四颗卫星(也称之为GPS的启动过程)根据信号强度和地域的不同有可能需要几分钟的时间;基于基站和Wifi的定位在Android API中被统一称为网络定位,开发者无法将两者区分.. 阅读全文

posted @ 2012-03-14 17:37 slider 阅读(5380) 评论(0) 推荐(1)

摘要:首先说这个文章不是原创,最近要用到xml文件解析,以前都是sax解析的,我到网上听别人说用android内置的pull方式解析xml文件要稳定并且有效率。于是我就参考了网上几个例子,实现了一下,然后把自己认为重要的上去,不重要的就不细说了。 首先就是xml文件,我就不花哨了,直接复制网上例子的books.xml:<?xml version="1.0" encoding="UTF-8"?><books> <book id="12"> <name>thinking in java</n 阅读全文

posted @ 2012-03-08 17:46 slider 阅读(988) 评论(0) 推荐(0)

摘要:换了新的系统,新的电脑,以前的开发环境一切都要重来。 a。首先是安装apt的时候出现了一些问题:由于我的eclipse的版本较新,所以在装apt的时候出现一些错误。具体的我现在忘记了,好像记得什么“core。*。*”之类的。网上教程感觉都很复杂,试了很多次都没有成功解决我的问题。我最后的解决办法是: help->check updates 更新它应该有的插件库就可以了。 b。接着在创建模拟器的时候出现如下问题: Error : Failed to create the SD card. Error :Failed to create sdcard in the AVD... 阅读全文

posted @ 2012-03-05 13:50 slider 阅读(2446) 评论(0) 推荐(0)

摘要:今天早上在公司导入家里的项目,无奈导入后发现无法时别.9图片(只是部分)。之后试了很多办法,什么源码导入之类的。由于不想重复变现这个错误,我就这里截取别人出错的图片: 解决办法是用九妹工具重新保存下就可以了 阅读全文

posted @ 2012-02-23 10:48 slider 阅读(193) 评论(0) 推荐(0)