学习一定有方法,有经验,有动力,有悟性,还要总结。


(一)

想在eclipse下导入一个android工程,这个工程已经存在了,总是提示invalid project description。其实是方法错了,这是解决问题的方法:


I have struggled with this issue myself for a while and I think the reason it happens is because (for Android) there are two ways to import projects into the workspace

1) import>General>Existing Project into Workspace
2) import>Android>Existing Code into Workspace

The errors described here are related to method 2).

For method 1) there will be no overlap problems as long as you uncheck the "Copy Projects into Workspace" box if the project is already in the workspace.


(二)

http://docs.since2006.com/android/2.1-drawables.php 使用android系统下的图标资源@android:drawable/editbox_background(editbox_background是安卓操作系统的图片)


(三)

Adding imports solved the problem for me.
And I found out that actually in Eclipse they can be imported automatically:

"Tip: After you have pasted sample code into an Eclipse project, press Ctrl (or Cmd) + Shift + O to import the required packages"

Hope this refresh what have been missed.

其实在用eclipse编写代码的时候,缺省的包可以通过按ctrl+shift+O导入。


(四)

byte[ ] 转换为 string


String str = new String(bytes, "UTF-8");
如果系统默认file.encoding.system是utf-8的可以省略后面的参数,直接写成


String str = new String(bytes);

也可以如下:

String str = IOUtils.toString(inputStream, "UTF-8");
这样呢:

byte[] byteArray = new byte[] {87, 79, 87, 46, 46, 46}; String value = new String(byteArray, "UTF-8");

更多相关文章

  1. NFS挂载android文件系统
  2. JS判断终端类型的几种方法
  3. Android系统启动过程
  4. Android非UI线程访问UI线程的方法总结
  5. 查看基于Android 系统单个进程内存、CPU使用情况的几种方法
  6. js 判断当前操作系统 ios, android, 电脑端
  7. android 调试方法

随机推荐

  1. Linux/Android启动之Machine-Init函数
  2. Android(安卓)从外部网页拉起跳转到App
  3. 牛逼的Android(安卓)UI
  4. Android笔记(1)adb的使用
  5. android 内存溢出oom错误的一些小见解
  6. Android(安卓)一个强大实用的版本升级dem
  7. android跳转QQ陌生人聊天或者加入QQ群
  8. android在原来的view上画边框或者其它内
  9. Android(安卓)Studio教程06-快捷键、Debu
  10. Android培训班(19)