
Android
文章平均质量分 67
牟蘑菇
https://github.com/btyh17mxy
展开
-
Android访问WCF服务(使用json实现参数传递)
经过多日努力, 终于勉强弄明白了Android访问WCF服务的方法.服务端实现一, 实现服务.操作契约 [ServiceContract] public interface IService { [OperationContract] [WebInvoke( BodyStyle = Web原创 2012-09-18 22:53:45 · 15824 阅读 · 10 评论 -
Android4.1+通过USB 连接Ubuntu进行文件传输方案
需要libusb-dev和一个叫libmtp的开源项目以及gmtp的支持。第一步sudo apt-get install libusb-dev第二步去libmtp项目主页下载最新版的libmtp此时我用的是1.1.5第三步解压下载的文件,并在终端进入其文件夹下,依次运行cd libmtp-1.1.5./configure --prefix原创 2013-02-05 04:08:07 · 1771 阅读 · 0 评论 -
Logcat报错
产生原因:1、在Activity的onCreate方法中调用findViewById()方法时使用了错的解包类型2、R文件错误,清理一下就行原创 2013-02-23 23:48:20 · 867 阅读 · 0 评论 -
嵌套ListView(附源码)
就是一个ListView的Item是另一个ListView。需要在内嵌的list绑定数据后重新计算并修改外层ListView的高度。(就是在getView方法后)源码:http://download.youkuaiyun.com/detail/btyh17mxy/5255041 /** * 根据内嵌ListView高度调整外部ListView Item的高度 * * @param lis原创 2013-04-13 21:13:33 · 1122 阅读 · 0 评论 -
Android使用URI启动应用的学习
在Android中使用Activity标签下的data标签来描述该Activity可打开的资源类型,根据官方文档的说明其语法如下:<data android:host="string" android:mimeType="string" android:path="string" android:pathPattern="string" an原创 2013-04-22 10:58:57 · 3351 阅读 · 2 评论 -
Android使用URL或条形码启动应用
有时候我们希望用我们的应用来打开特定URL或条形码,就像这样:这个效果我们可以通过注册intent-filter来实现。例如注册: <activity android:name="com.mush.SiteActivity" android:label="@string/title_activity_si原创 2013-04-21 23:25:37 · 1227 阅读 · 0 评论 -
Android Geofence的学习(一)翻译官方文档
官方文档地址: https://developer.android.com/reference/com/google/android/gms/location/Geofence.htmlpublic interfaceGeofencecom.google.android.gms.location.GeofenceC翻译 2013-06-01 20:15:01 · 2902 阅读 · 2 评论 -
在Android虚拟机中安装GooglePlayServices
原文地址:http://piotrbuda.eu/2012/05/installing-google-play-on-android-emulator.htmlInstalling Google Play on Android EmulatorThe problemI wanted to install Google Play on emulator. Problem转载 2013-06-03 23:04:45 · 5291 阅读 · 0 评论 -
Android Geofence的学习(二)继续翻译官方文档
保佑我六级能过。如有错误欢迎指正。转载请注明,原地址:http://blog.youkuaiyun.com/btyh17mxy/article/details/9007287官方文档地址:https://developer.android.com/training/location/geofencing.html创建并监视一个Geofence地理围栏结合用户当前的位置和附近特点翻译 2013-06-03 13:27:09 · 5879 阅读 · 4 评论 -
Application类的使用
一、需要将其写入配置文件将继承Application的子类的完整名称如“com.ex.APP”插入application标签下的android:name属性二、获取Application实例在Activity或者Services中通过Context.getApplication()获取,然后进行类型装欢。如:App app = (App) this.getApplication()原创 2012-12-24 12:44:17 · 724 阅读 · 0 评论 -
gson使用在android使用例子
虽然android自带了json处理,但是没有封装,总觉得不方便,网上找了gson的处理,觉得还行。 //转换器 GsonBuilder builder = new GsonBuilder(); // 不转换没有 @Expose 注解的字段 builder.excludeFieldsWith转载 2012-10-22 22:09:20 · 1204 阅读 · 0 评论 -
Android解决GPS定位时LocationManager只能绑定一个LocationListener的问题
之前做项目时遇到了如题的小困难, 想了一个有点解决方法, 上周在济南发现有些初学者似乎在这里有点困扰, 就发出来供大家参考下.首先自定义一个接口public interface CRLocationListeneri { public void onLocationChanged(Location location);}然后些一个类, 该类需要implements LocationLis原创 2012-10-28 22:02:10 · 3626 阅读 · 0 评论 -
Android使用Intent传递复杂参数及复杂参数列表
刚开始一直纠结于Intent只能put像int, String之类的简单参数, 知道最近才发现了一下的方法.一>, 使用Intent传递实体类对象首先实体类需要implements Serializable然后 Intent broadIntent = new Intent(); Bundle bundle = new Bundle(); bundle.pu原创 2012-11-04 23:06:09 · 1387 阅读 · 0 评论 -
借助HorizontalScrollView实现多列ListView的横向滑动(含动态加载)
在Android中使用ListVIew显示多列数据表时会遇到屏幕宽度不够, 无法完全显示的问题, 以下的例子是我结合网上的各种方案总结的一种较好的解.自定义Adapter: public class HolderAdapter extends BaseAdapter { private static final String TAG = "HolderAdapter";原创 2012-10-29 23:23:30 · 8041 阅读 · 6 评论 -
Android使用xml定义带背景Button(解决ImageButton不能加文字的问题)
虽然Android给我们提供了ImageButton 这一组件来实现带有自定义图片背景的Button,但是ImageButton有一个缺陷就是不能添加文字而如下的方法则可以综合二者的优势. 用到的图片: 在drable下新建一个button_blue_style.xml文件来描述Button的按下效果: <item android:state_原创 2012-09-04 21:16:32 · 3125 阅读 · 0 评论 -
Android自带Drawable图片库
Android™ 2.1 android.R.drawable Icon ResourcesAndroid™ 1.5 android.R.drawable Icon ResourcesAndroid™ 1.6 android.R.drawable Icon ResourcesAndroid™ 2.1 android.R.drawable Icon ResourcesOriginated f转载 2012-11-05 21:12:10 · 1931 阅读 · 1 评论 -
警告handler leaks的解决方法
发现所有的Handler都被打上了"This Handler class should be static or leaks might occur .."的警告, Google一番后发现了解决方法. 一>, 原因找到一段E文Issue: Ensures that Handler classes do not hold on to a reference to an outer c原创 2012-11-07 18:21:36 · 10030 阅读 · 0 评论 -
Android Geofence的学习(三)总结、Demo和问题
转载请注明:http://blog.youkuaiyun.com/btyh17mxy/article/details/9038443 官方给出了一个demo:http://developer.android.com/shareables/training/GeofenceDetection.zipGeofence是一个基于Google Play Services的虚拟地理区域,是一个由中心点经纬度和半原创 2013-06-06 16:44:57 · 9874 阅读 · 18 评论