随笔分类 - 写代码
摘要:Dex动态加载是为了解决什么问题? 在Android系统中,一个App的所有代码都在一个Dex文件里面。 Dex是一个类似Jar的存储了多个Java编译字节码的归档文件。 因为Android系统使用Dalvik虚拟机,所以需要把使用Java Compiler编译之后的class文件转换成Dalvik
阅读全文
摘要:需求场景:一个ListView页面,滑动阅读到某一位置,然后退出页面,下次再进入页面的时候,想要直接滑动到上次阅读的位置。 方案1:页面退出的时候,ListView.getFirstVisiblePosition()来获取当前可见的第一个Item的position并记录,下次再进入页面的时候通过Li
阅读全文
摘要:Methond 1 is to check whether the GPS is on: Method 2 is to open GPS setting page in Android device: Codes in Github : https://gist.github.com/Viyu/94
阅读全文
摘要:Ping a host in Android:“ping -c 1 127.0.0.1”-c 1: The ping times. Ping codes is simple, but:1, you must run it in background thread since Process.wait
阅读全文
摘要:为什么要拖放?拖放在某些UI交互中可以简化用户操作。 拖放的步骤包括哪些?“Drag and Drop”,拖放,顾名思义,总共就分三步:1, 开始拖起来;2, 正在拖;3, 放下,进行操作;在这三步里,贯穿的是数据的传输,从拖的地方传输到放的地方。 现在,我们就以一个简单的拖放删除笔记的App来讲解
阅读全文
摘要:Code can control the LED notification in Android device, using android.app.Notification: ledARGB: The color of the led. The hardware will do its best
阅读全文
摘要:You don’t need to set a big size image as the background of pages if the image is texture or uniform color. How to tile small texture image onto big p
阅读全文
摘要:The design of SimpleAdapter is not good in my opinion. An adapter should just adapter the data to view, not care to inflate xml to create Layout View,
阅读全文
摘要:In my case, I want to write a TextView with an animation in its left side. ImageView + TextView could work but it’s not frugal enough. TextView with d
阅读全文
摘要:Generally, I use a selector to select pictures or colors to render the normal and the pressed background for View. And use a Shape to draw a fixed bac
阅读全文
摘要:Here is this topic’s background: I defined a custom View which extends FrameLayout and contains a TextView, calledMyView here. And I defined custom at
阅读全文

浙公网安备 33010602011771号