0_android调试 :
补充:一条短信:70个汉字,160个英文字符
1.(可选)在AndroidManifest.xml当中—application—-android:debuggable="true"
2.AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?><manifest>    <instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="cn.beita.layout"></instrumentation>    <application ...>        <uses-library android:name="android.test.runner"/>        <activity...></activity>    </application></manifest>

3.Test.java

public class Test extends AndroidTestCase{    public void testAdd() throws Exception{        assertEquals(....);    }    @Override //做一些初始化的操作    public void setUp() throws Exception{}    @Override //做一些收尾的工作    public void tearDown() throws Exception{}}

PS : 以上方法只适用于eclipse环境,如果是在android studio环境下,可以这样做:

public class URLEncodeTest extends InstrumentationTestCase {    @Override    protected void tearDown() throws Exception {        super.tearDown();    }    public void testUrlEncode() throws Exception {        String content = "!#$%&\\()*+,./:;=?@[\']";        Log.e("test", "test-----" + URLEncoder.encode(content, "UTF-8"));    }}

然后在edit configuration—>里面添加配置

更多相关文章

  1. linux下android开发环境的配置
  2. Android环境变量作用--命令行操作
  3. Ubuntu 18.04 配置android 源码开发/编译环境
  4. CMAKE 在Linux下 构建android 编译、打包、发布环境
  5. Android资源收集
  6. Android资源收集
  7. Cocos2d-3.x Android环境搭建
  8. Failed to sync vcpu reg
  9. ubuntu 11.10 搭建 Android(安卓)开发环境

随机推荐

  1. Android应用程序绑定服务(bindService)的过
  2. Android(安卓)中支持的几种传感器(加速度
  3. 在Android中使用HTML5本地存储,地理位置,离
  4. Android列表控件Spinner简单用法示例
  5. How to Use Android(安卓)Downloads Prov
  6. Android(安卓)OpenGL学习笔记(二)之----
  7. android httpclient localhost Connectio
  8. Android(安卓)LBS系列04 位置和地图服务
  9. Android中文API (110) —— CursorTreeAd
  10. Android中Adapter类详解