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—>里面添加配置
android典型代码系列(一)------android调试_第1张图片

更多相关文章

  1. Android环境变量作用--命令行操作
  2. Ubuntu 18.04 配置android 源码开发/编译环境
  3. Cocos2d-3.x Android环境搭建
  4. CMAKE 在Linux下 构建android 编译、打包、发布环境
  5. ubuntu 11.10 搭建 Android 开发环境
  6. linux下android开发环境的配置
  7. 19_利用android提供的HanziToPinyin工具类实现汉字与拼接的转换
  8. [Android]Android SDK 2.3与Eclipse最新版开发环境搭建
  9. Ubuntu 10.10 与 华为 C8650 手机搭建 Android 真机开发调试环境

随机推荐

  1. Centos7安装GreenPlum6.14 集群
  2. 2021 02 16 重新开始
  3. Linux学习笔记总结(八十九)
  4. Laravel重构企业级电商项目 全面强化职场
  5. linux 安装Nginx PHP
  6. 初次安装windows系统后桌面只有回收站,如
  7. LVS 负载均衡服务器搭建
  8. Git 删除 .gitignore 生成之前上传的文件
  9. 2021-02-16:n皇后问题。给定一个整数n,返
  10. 2.34 在ESXi主机添加iSCSI存储适配器