02 2011 档案

Intent 传输对象
摘要:Bundle bundle = new Bundle();intent = new Intent(getApplicationContext(), YourActivity.class); bundle.putSerializable("youJavaBean", youJavaBean); intent.putExtras(bundle); startActivity(intent);------------------------------Intent intent = getIntent(); Bundle bundle=intent.getExtras(); yo 阅读全文

posted @ 2011-02-28 22:51 陆晓峰 阅读(1050) 评论(0) 推荐(0) 编辑

AndroidNDK开发之“文件操作”
摘要:其实和上层没什么关系,主要是通过C来完成文件的基本操作。不好意思大家,时间不够,不多说,贴上关键代码。 阅读全文

posted @ 2011-02-28 17:18 陆晓峰 阅读(16945) 评论(7) 推荐(1) 编辑

C语言文件操作
摘要:输入输出子程序,函数库为io.h、conio.h、stat.h、dos.h、stdio.h、signal.h int kbhit() 本函数返回最近所敲的按键 int fgetchar() 从控制台(键盘)读一个字符,显示在屏幕上 int getch() 从控制台(键盘)读一个字符,不显示在屏幕上 int putch() 向控制台(键盘)写一个字符 int getchar() 从控制台(键盘)读一个字符,显示在屏幕上 int putchar() 向控制台(键盘)写一个字符 int getche() 从控制台(键盘)读一个字符,显示在屏幕上 int ungetch(int c) 把字符c退回给控 阅读全文

posted @ 2011-02-25 14:02 陆晓峰 阅读(991) 评论(0) 推荐(0) 编辑

遍历Map
摘要:for (Map.Entry<String, String> entry : params.entrySet()) { // System.out.println(entry.getKey()+","+ entry.getValue()); conn.setRequestProperty(entry.getKey(), entry.getValue());}方法1: Map map = new HashMap(); map.put("a", "1"); map.put("b", "2" 阅读全文

posted @ 2011-02-24 09:31 陆晓峰 阅读(396) 评论(0) 推荐(0) 编辑

Android 访问本地 IP
摘要:localhost或者127.0.0.1 改为 ----- > 10.0.2.2模拟器运行时,localhost或者127.0.0.1指的是模拟器的地址。如果你想在模拟器simulator上面访问你的电脑,那么就使用android内置的IP 10.0.2.2 吧,10.0.2.2 是模拟器设置的特定ip 阅读全文

posted @ 2011-02-23 11:02 陆晓峰 阅读(4001) 评论(0) 推荐(0) 编辑

让所有Button共享一个监听器
摘要:private void initControls() { add = (Button)this.findViewById(R.id.btn_add); delete = (Button)this.findViewById(R.id.btn_delete); update = (Button)this.findViewById(R.id.btn_update); query = (Button)this.findViewById(R.id.btn_query); add.setOnClickListener(new MyButtonOnClickListener()); delete.setO 阅读全文

posted @ 2011-02-18 14:27 陆晓峰 阅读(668) 评论(0) 推荐(0) 编辑

Android 获取 联系人信息
摘要:Cursor cursor = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); List<String> numbers = null; while (cursor.moveToNext()) { numbers = new ArrayList<String>(); // 获取联系人 int nameFieldColumnIndex = cursor .getColumnIndex(PhoneLookup.DISPLAY_NAME); String name = curso 阅读全文

posted @ 2011-02-18 09:46 陆晓峰 阅读(800) 评论(0) 推荐(0) 编辑

JNI编程小技巧集合(持续更新)
摘要:1、java 传入的String 在 C 中转化为 char*打印出来jstring obj;const char* string = (char*)(*env)->GetStringUTFChars(env,obj,NULL);__android_log_print(ANDROID_LOG_INFO, "JNIMsg",string);2、'for' loop initial declarations are only allowed in C99 mode 错误int i = 0;for (; i < size; i++) {} 需要把int 阅读全文

posted @ 2011-02-17 11:30 陆晓峰 阅读(4738) 评论(0) 推荐(1) 编辑

JNI 调试打印信息
摘要:Android.mkLOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE := hello-jniLOCAL_SRC_FILES := hello-jni.cLOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -lloginclude $(BUILD_SHARED_LIBRARY) JNI 文件夹下 hello-jni.c#include <android/log.h>__android_log_print(ANDROID_LOG_INFO, "Hello", &quo 阅读全文

posted @ 2011-02-14 22:56 陆晓峰 阅读(1947) 评论(0) 推荐(0) 编辑

windows系统上安装与使用Android NDK r5(转)
摘要:windows系统上安装与使用AndroidNDKr5很早就听说了android的NDK应用,只是一直没有时间去研究,今天花了点时间在windows平台搭建了NDK环境,并成功运行了第一个简单的android应用。一:什么是NDK?NDK 提供了一系列的工具,帮助开发者快速开发C(或C++)的动态库,并能自动将so 和java 应用一起打包成apk。这些工具对开发者的帮助是巨大的。NDK 集成了交叉编译器,并提供了相应的mk 文件隔离CPU、平台、ABI 等差异,开发人员只需要简单修改mk 文件(指出“哪些文件需要编译”、“编译特性要求”等),就可以创建出so。NDK 可以自动地将so 和Ja 阅读全文

posted @ 2011-02-12 14:22 陆晓峰 阅读(14860) 评论(1) 推荐(4) 编辑

eclipse+cdt+cygwin配置的“launch failed no binaries” 错误
摘要:project-----&gt;properties-----------&gt;C/C++ Build---&gt;Settings----&gt;Binary Parsers将PE Windows parser 打上勾 阅读全文

posted @ 2011-02-12 14:03 陆晓峰 阅读(458) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示