Android Debug Bridge (ADB)的使用方法

 更新时间:2016年9月20日 19:59  点击:1728
本文章为安卓开发者入门者介绍关于Android Debug Bridge (ADB)的使用方法,有需要学习的朋友可进入参考。

 

Android系统调试工具——ADB

Android Debug Bridge是个多功能的工具,可以管理设备上的执行状况。
即ADB是管理模拟器的一个工具。

包括下列三个部分:

客户端程序(Client):在开发环境上运行,也可以通过命令行模式shell接口执行adb命令来操作客户端程序。其他Android工具如开发工具ADT或调试监控系统DDMS都可以创建一个adb客户端。

服务器程序(Server):在开发环境的后台运行,服务器程序负责管理介于客户端程序和守护进程程序的通信沟通。
守护进程程序(Daemon):在实际硬件设备或虚拟设备的后台运行。
adb命令位于安装路径下的platform-tools路径中,把这个路径加在环境变量PATH中就可以在其他目录下使用adb命令。

adb命令的标准格式

adb [-d|-e|-s <serialNumber>] <command>
这是adb命令的标准格式,当你正在执行的仿真器有多个时,要加上仿真器序号来区别:

使用“-s <serialNumber>”选项参数;
使用“-d”选项参数,adb命令只会送到连接USB的实际硬设备;
使用“-e”选项参数,adb命令只会送到Android仿真器。

后面<command>是必要的命令。

安装与卸载应用程序apk文件

安装:
adb [-s <serialNumber>] install <path_to_apk>

范例:安装helloWorld.apk到Android仿真器序列号是5556的虚拟设备上:

 adb –s emulator-5556 install helloWorld.apk
 adb install helloWorld.apk

使用adb install安装apk组件程序时,安装在Android仿真器上的apk组件会被放在Android系统目录的/data/app下,这个目录下的应用程序文件名就是写程序时设置的Package name

卸载:

 adb [-s <serialNumber>] uninstall <package>
范例:

adb –s emulator-5556 uninstall com.example.android.helloWorld.apk
adb uninstall com.example.android.helloWorld.apk

注意安装是接apk文件路径名称,而移除是接package名称。

手动删除:

  adb shell
  cd data/app
  rm app.apk

Android操作系统命令行模式,使用shell命令

  执行

  adb shell

  可以进入Android操作系统命令行模式,如此一来你就可以管理和查询Android操作系统的目录和执行相关的命令。

  因为Android操作系统是Linux操作系统的一种,所以shell命令和Linux操作系统是相同的,例如ls命令显示文件目录,cd命令更改文件目录,mkdir命令创建目录,rmdir命令删除目录,rm命令删除文件,mv命令移动文件。

  进入Android操作系统命令行模式后,要离开回到控制台窗口,可以使用exit命令。

上传文件到/sdcard或自/sdcard下载文件(复制文件)

  上传,即从系统复制文件到设备:
  adb push <local> <remote>
  如:adb push d:test.txt /sdcard/
  下载,即从设备复制文件到系统:
  adb pull <remote> <local>
  如:adb pull /sdcard/test.txt d:/

发布端口

  可以设置任意的端口号,作为主机向模拟器或设备的请求端口。如:
  adb forward tcp:5555 tcp:8000

搜索/等待模拟器、设备实例

  取得当前运行的模拟器,设备的实例列表及每个实例的状态|等待正在运行的设备。
  adb devices
  adb wait-for-device

 

查看Bug报告

  adb bugreport

记录无线通讯日志

  adb shell
  logcat –b radio


获取设备ID和序列号

  adb get-product

  adb get-serialno

访问数据库SQLite3

  adb shell
  sqlite3

本文章来给大家介绍关于Android学习笔记之ImageView显示图片,在于android中ImageView是Android程序中经常用到的组件,它将一个图片显示到屏幕上。
 代码如下 复制代码


public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.myimage);
ImageView image1 = (ImageView) findViewById(R.myImage.image);
//Bitmap bitmap = getLoacalBitmap("/aa/aa.jpg"); //从本地取图片
Bitmap bitmap =
getHttpBitmap("hpath.jpg");
//从网上取图片
image1 .setImageBitmap(bitmap); //设置Bitmap
}

/**
* 加载本地图片
* http://www.111cn.net
* @param url
* @return
*/
public static Bitmap getLoacalBitmap(String url) {
try {
FileInputStream fis = new FileInputStream(url);
return BitmapFactory.decodeStream(fis);
} catch (FileNotFoundException e) {
e.printStackTrace();
return null;
}
}

/**
* 从服务器取图片
*http://www.111cn.net
* @param url
* @return
*/
public static Bitmap getHttpBitmap(String url) {
URL myFileUrl = null;
Bitmap bitmap = null;
try {
Log.d(TAG, url);
myFileUrl = new URL(url);
} catch (MalformedURLException e) {
e.printStackTrace();
}
try {
HttpURLConnection conn = (HttpURLConnection) myFileUrl.openConnection();
conn.setConnectTimeout(0);
conn.setDoInput(true);
conn.connect();
InputStream is = conn.getInputStream();
bitmap = BitmapFactory.decodeStream(is);
is.close();
} catch (IOException e) {
e.printStackTrace();
}
return bitmap;
}

ImageView 无法setImageBitmap,不显示图片解决办法

以下是handler

 代码如下 复制代码
handler.post(new Runnable() {
                        @Override
                        public void run() {
                                playAdver();
                        }
                });

以下是playAdver()方法,主要是显示图片

 代码如下 复制代码

        private void playAdver() {
                for (int i = 0; i < advertisementsList.size(); i++) {
                        advertisement = advertisementsList.get(i);
                        fileName = advertisement.getName();
                        index = advertisement.getName().indexOf(".");
                        String postfix = fileName.substring(index, fileName.length());
                        time = advertisement.getTime() * 100;
                         if (postfix.compareToIgnoreCase(".jpg") == 0
                                        || postfix.compareToIgnoreCase(".png") == 0) {
                                adverImage.setVisibility(View.VISIBLE);
                                adverImage.setImageBitmap(BitmapFactory.decodeFile(fileName));
                                try {
                                        Thread.sleep(time);
                                } catch (InterruptedException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                }
                        }
                }
        }

执行了adverImage.setImageBitmap(BitmapFactory.decodeFile(fileName));但是在真机上不现实图片,为什么?
因为我是在主线程里面执行的,故不会显示,以解决

我们曾经在其他文章中通过对录音以及录像的实现方法具体讲解过有Android多媒体录制功能的实现方式介绍 的相关操作技巧。在这里我们将会为大家详细介绍一下Android多媒体播放的应用方式,以帮助大家对这方面的应用知识有一个深刻的印象。


Android多媒体播放代码:

 代码如下 复制代码


import android.app.Activity; 
import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener; 
import android.widget.Button;
  import android.widget.VideoView; 
public class VideoPlayer extends Activity   {
  /**   Called when the activity is first created.
  */
@Override
  public void onCreate(Bundle icicle)   {
  super.onCreate(icicle);
  setContentView(R.layout.main);
  final VideoView w =(VideoView)findViewById(R.id.vdoplayer);
  Button cmdload = (Button)this.findViewById(R.id.cmd_load);   cmdload.setOnClickListener(new OnClickListener()  { 
public void onClick(View arg0)   {  
// TODO Auto-generated method stub
  w.setVideoPath("/sdcard/android/kongfu.mp4");
  } 

); 
Button cmdplay = (Button)this.findViewById(R.id.cmd_play); 
cmdplay.setOnClickListener(new OnClickListener()  {  
public void onClick(View arg0)   { 
// TODO Auto-generated method stub 
w.start(); 
}
  } 
);  
Button cmdpause = (Button)this.findViewById(R.id.cmd_pause);   cmdpause.setOnClickListener(new OnClickListener()  {
  public void onClick(View arg0)   {
  // TODO Auto-generated method stub
  w.pause(); 
}
  }
  );
  }

Android多媒体播放实现代码:
xml文件:

 代码如下 复制代码


< ?xml version="1.0" encoding="utf-8"?>
< LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
< Button android:id="@+id/cmd_load"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="load" />
< Button android:id="@+id/cmd_play"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Play" />
< Button android:id="@+id/cmd_pause"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="pause" />
< VideoView android:id="@+id/vdoplayer"
android:layout_width="fill_parent"
android:layout_height="300px" />
< /LinearLayout>

本文章来介绍在android开发中,我们通过button按钮来动态改变字体大小、字体颜色、背景颜色代码,有需要了解的朋友可参考参考。

实现的逻辑:通过遍历View的方式,判断View是否是TextView、EditText和Button类型,如果是的话,就修改。

代码如下:
1、xml布局文件,文件名:test4.xml,内容如下:

 代码如下 复制代码

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:orientation="vertical"
   android:id="@+id/mainLayout">
    
     
    <LinearLayout android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
         
        <EditText android:id="@+id/fontSize"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="30"
        android:hint="请输入数字"/>
         
        <Button android:id="@+id/ChangeSize"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="改变字体"/>    
         
    </LinearLayout>
     
    <LinearLayout android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
         
        <EditText android:id="@+id/fontColor"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="#ffffff"
        android:hint="请输入字体颜色"/>
         
        <Button android:id="@+id/ChangeColor"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="改变字体颜色" />    
         
    </LinearLayout>
     
     
    <LinearLayout android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
         
        <EditText android:id="@+id/bgColor"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="#ff0000"
        android:hint="请输入背景颜色"/>
         
        <Button android:id="@+id/ChangeBgColor"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="改变背景颜色"/>    
         
    </LinearLayout>
     
    <LinearLayout android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">
      
    
   <TextView android:id="@+id/TextView01"
                   android:layout_width="fill_parent"
                   android:layout_height="50dp"
                   android:text="top"
                   android:gravity="top"
                   android:textColor="#ffffff"
                   android:background="#00ff00"
                   android:layout_margin="2px"/>
                    
   <TextView android:id="@+id/TextView02"
                   android:layout_width="fill_parent"
                   android:layout_height="50dp"
                   android:text="bottom"
                   android:gravity="bottom"
                   android:textColor="#ffffff"
                   android:background="#00ff00"
                   android:layout_margin="2px"/>
                    
   <TextView android:id="@+id/TextView03"
                   android:layout_width="fill_parent"
                   android:layout_height="50dp"
                   android:text="left"
                   android:gravity="left"
                   android:textColor="#ffffff"
                   android:background="#00ff00"
                   android:layout_margin="2px"/>
                    
   <TextView android:id="@+id/TextView04"
                   android:layout_width="fill_parent"
                   android:layout_height="50dp"
                   android:text="right"
                   android:gravity="right"
                   android:textColor="#ffffff"
                   android:background="#00ff00"
                   android:layout_margin="2px"/>
                    
   <TextView android:id="@+id/TextView05"
                   android:layout_width="fill_parent"
                   android:layout_height="50dp"
                   android:text="center_vertical"
                   android:gravity="center_vertical"
                   android:textColor="#ffffff"
                   android:background="#00ff00"
                   android:layout_margin="2px"/>
                    
   <TextView android:id="@+id/TextView06"
                   android:layout_width="fill_parent"
                   android:layout_height="50dp"
                   android:text="fill_vertical"
                   android:gravity="fill_vertical"
                   android:textColor="#ffffff"
                   android:background="#00ff00"
                   android:layout_margin="2px"/>
                    
   <TextView android:id="@+id/TextView07"
                   android:layout_width="fill_parent"
                   android:layout_height="50dp"
                   android:text="center_horizontal"
                   android:gravity="center_horizontal"
                   android:textColor="#ffffff"
                   android:background="#00ff00"
                   android:layout_margin="2px"/>
                    
   <TextView android:id="@+id/TextView08"
                   android:layout_width="fill_parent"
                   android:layout_height="50dp"
                   android:text="fill_horizontal"
                   android:gravity="fill_horizontal"
                   android:textColor="#ffffff"
                   android:background="#00ff00"
                   android:layout_margin="2px"/>                                                                                                                                     
 
   <TextView android:id="@+id/TextView09"
                   android:layout_width="fill_parent"
                   android:layout_height="50dp"
                   android:text="center"
                   android:gravity="center"
                   android:textColor="#ffffff"
                   android:background="#00ff00"
                   android:layout_margin="2px"/>
                    
   <TextView android:id="@+id/TextView10"
                   android:layout_width="fill_parent"
                   android:layout_height="50dp"
                   android:text="fill"
                   android:gravity="fill"
                   android:textColor="#ffffff"
                   android:background="#00ff00"
                   android:layout_margin="2px"/>
                    
   <TextView android:id="@+id/TextView11"
                   android:layout_width="fill_parent"
                   android:layout_height="50dp"
                   android:text="clip_vertical"
                   android:gravity="clip_vertical"
                   android:textColor="#ffffff"
                   android:background="#00ff00"
                   android:layout_margin="2px"/>
                    
   <TextView android:id="@+id/TextView12"
                   android:layout_width="fill_parent"
                   android:layout_height="50dp"
                   android:text="clip_horizontal"
                   android:gravity="clip_horizontal"
                   android:textColor="#ffffff"
                   android:background="#00ff00"
                   android:layout_margin="2px"/>
    </LinearLayout>                                                                                               
</LinearLayout>

2、实现的代码文件:MainActivity.java,代码如下:

 代码如下 复制代码

package org.shuxiang.test;
 
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
public class MainActivity extends Activity{
         
        private LinearLayout mainLayout;
        private Button changeSize, changeColor, changeBgColor;
        private EditText fontSize, fontColor, bgColor;
 
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.test4);
         
        mainLayout = (LinearLayout) findViewById(R.id.mainLayout);
        changeSize = (Button) findViewById(R.id.ChangeSize);
        fontSize = (EditText) findViewById(R.id.fontSize);
         
        changeSize.setOnClickListener(new OnClickListener()
        {
                        @Override
                        public void onClick(View v)
                        {
                                // TODO Auto-generated method stub
                                setFontSize(mainLayout, Float.parseFloat(fontSize.getText().toString()));
                        }                
        });
         
        changeColor = (Button) findViewById(R.id.ChangeColor);
        fontColor = (EditText) findViewById(R.id.fontColor);
         
        changeColor.setOnClickListener(new OnClickListener()
        {
                        @Override
                        public void onClick(View v)
                        {
                                // TODO Auto-generated method stub
                                int color = Integer.parseInt(fontColor.getText().toString().replace("#", ""), 16);
                                int red = (color & 0xff0000) >> 16; 
                            int green = (color & 0x00ff00) >> 8; 
                            int blue = (color & 0x0000ff); 
                             
                            setFontColor(mainLayout, Color.rgb(red, green, blue));                                
                        }                
        });
         
        changeBgColor = (Button) findViewById(R.id.ChangeBgColor);
        bgColor = (EditText) findViewById(R.id.bgColor);
         
        changeBgColor.setOnClickListener(new OnClickListener()
        {
                        @Override
                        public void onClick(View v)
                        {
                                // TODO Auto-generated method stub
                                int color = Integer.parseInt(bgColor.getText().toString().replace("#", ""), 16);
                                int red = (color & 0xff0000) >> 16; 
                            int green = (color & 0x00ff00) >> 8; 
                            int blue = (color & 0x0000ff);
                             
                                setBgColor(mainLayout, Color.rgb(red, green, blue));
                        }                
        });        
 
        
    }
     
    /**
     * 改变字体
     * @param v
     * @param fontSize
     */
    public void setFontSize(View v, float fontSizeValue)
    {
            if(v instanceof TextView)
                {
                        ((TextView) v).setTextSize(fontSizeValue);
                }
                else if(v instanceof EditText)
                {
                        ((EditText) v).setTextSize(fontSizeValue);
                }
                else if(v instanceof Button)
                {
                        ((Button) v).setTextSize(fontSizeValue);
                }
                else
                {
                        int vChildCount = ((ViewGroup) v).getChildCount();
                    for(int i=0; i<vChildCount; i++)
                    {
                            View v1 = ((ViewGroup) v).getChildAt(i);
                            setFontSize(v1, fontSizeValue);
                    }
                }        
    }
     
    /**
     * 改变字体颜色
     * @param v
     * @param fontSize
     */
    public void setFontColor(View v, int fontColorValue)
    {
            if(v instanceof TextView)
                {
                        ((TextView) v).setTextColor(fontColorValue);
                }
                else if(v instanceof EditText)
                {
                        ((EditText) v).setTextColor(fontColorValue);
                }
                else if(v instanceof Button)
                {
                        ((Button) v).setTextColor(fontColorValue);
                }
                else
                {
                        int vChildCount = ((ViewGroup) v).getChildCount();
                    for(int i=0; i<vChildCount; i++)
                    {
                            View v1 = ((ViewGroup) v).getChildAt(i);
                            setFontColor(v1, fontColorValue);
                    }
                }        
    }
     
    /**
     * 改变背景字体
     * @param v
     * @param fontSize
     */
    public void setBgColor(View v, int bgColorValue)
    {
            if(v instanceof TextView)
                {
                        ((TextView) v).setBackgroundColor(bgColorValue);
                }
                else if(v instanceof EditText)
                {
                        ((EditText) v).setBackgroundColor(bgColorValue);
                }
                else if(v instanceof Button)
                {
                        ((Button) v).setBackgroundColor(bgColorValue);
                }
                else
                {
                        int vChildCount = ((ViewGroup) v).getChildCount();
                    for(int i=0; i<vChildCount; i++)
                    {
                            View v1 = ((ViewGroup) v).getChildAt(i);
                            setBgColor(v1, bgColorValue);
                    }
                }        
    }    
 
}

本文章介绍一段超张简单的关于android如何判断是用户还机器代码,有需要的朋友可参考。

我们写程序的时候可能需要判断用户到底使用的是模拟器还是真机,可以使用如下的代码

 代码如下 复制代码
private boolean isEmulator() {
    return (Build.MODEL.equals("sdk")) || (Build.MODEL.equals("google_sdk"));
}
[!--infotagslink--]

相关文章

  • php 中file_get_contents超时问题的解决方法

    file_get_contents超时我知道最多的原因就是你机器访问远程机器过慢,导致php脚本超时了,但也有其它很多原因,下面我来总结file_get_contents超时问题的解决方法总结。...2016-11-25
  • 图解PHP使用Zend Guard 6.0加密方法教程

    有时为了网站安全和版权问题,会对自己写的php源码进行加密,在php加密技术上最常用的是zend公司的zend guard 加密软件,现在我们来图文讲解一下。 下面就简单说说如何...2016-11-25
  • php抓取网站图片并保存的实现方法

    php如何实现抓取网页图片,相较于手动的粘贴复制,使用小程序要方便快捷多了,喜欢编程的人总会喜欢制作一些简单有用的小软件,最近就参考了网上一个php抓取图片代码,封装了一个php远程抓取图片的类,测试了一下,效果还不错分享...2015-10-30
  • HTTP 408错误是什么 HTTP 408错误解决方法

    相信很多站长都遇到过这样一个问题,访问页面时出现408错误,下面一聚教程网将为大家介绍408错误出现的原因以及408错误的解决办法。 HTTP 408错误出现原因: HTT...2017-01-22
  • Android子控件超出父控件的范围显示出来方法

    下面我们来看一篇关于Android子控件超出父控件的范围显示出来方法,希望这篇文章能够帮助到各位朋友,有碰到此问题的朋友可以进来看看哦。 <RelativeLayout xmlns:an...2016-10-02
  • ps怎么使用HSL面板

    ps软件是现在很多人都会使用到的,HSL面板在ps软件中又有着非常独特的作用。这次文章就给大家介绍下ps怎么使用HSL面板,还不知道使用方法的下面一起来看看。 &#8195;...2017-07-06
  • ps把文字背景变透明的操作方法

    ps软件是现在非常受大家喜欢的一款软件,有着非常不错的使用功能。这次文章就给大家介绍下ps把文字背景变透明的操作方法,喜欢的一起来看看。 1、使用Photoshop软件...2017-07-06
  • intellij idea快速查看当前类中的所有方法(推荐)

    这篇文章主要介绍了intellij idea快速查看当前类中的所有方法,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下...2020-09-02
  • Mysql select语句设置默认值的方法

    1.在没有设置默认值的情况下: 复制代码 代码如下:SELECT userinfo.id, user_name, role, adm_regionid, region_name , create_timeFROM userinfoLEFT JOIN region ON userinfo.adm_regionid = region.id 结果:...2014-05-31
  • js导出table数据到excel即导出为EXCEL文档的方法

    复制代码 代码如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta ht...2013-10-13
  • mysql 批量更新与批量更新多条记录的不同值实现方法

    批量更新mysql更新语句很简单,更新一条数据的某个字段,一般这样写:复制代码 代码如下:UPDATE mytable SET myfield = 'value' WHERE other_field = 'other_value';如果更新同一字段为同一个值,mysql也很简单,修改下where即...2013-10-04
  • ps怎么制作倒影 ps设计倒影的方法

    ps软件是一款非常不错的图片处理软件,有着非常不错的使用效果。这次文章要给大家介绍的是ps怎么制作倒影,一起来看看设计倒影的方法。 用ps怎么做倒影最终效果&#819...2017-07-06
  • Plesk控制面板新手使用手册总结

    许多的朋友对于Plesk控制面板应用不是非常的了解特别是英文版的Plesk控制面板,在这里小编整理了一些关于Plesk控制面板常用的使用方案整理,具体如下。 本文基于Linu...2016-10-10
  • js基础知识(公有方法、私有方法、特权方法)

    本文涉及的主题虽然很基础,在许多人看来属于小伎俩,但在JavaScript基础知识中属于一个综合性的话题。这里会涉及到对象属性的封装、原型、构造函数、闭包以及立即执行表达式等知识。公有方法 公有方法就是能被外部访问...2015-11-08
  • 安卓手机wifi打不开修复教程,安卓手机wifi打不开解决方法

    手机wifi打不开?让小编来告诉你如何解决。还不知道的朋友快来看看。 手机wifi是现在生活中最常用的手机功能,但是遇到手机wifi打不开的情况该怎么办呢?如果手机wifi...2016-12-21
  • PHP 验证码不显示只有一个小红叉的解决方法

    最近想自学PHP ,做了个验证码,但不知道怎么搞的,总出现一个如下图的小红叉,但验证码就是显示不出来,原因如下 未修改之前,出现如下错误; (1)修改步骤如下,原因如下,原因是apache权限没开, (2)点击打开php.int., 搜索extension=ph...2013-10-04
  • 使用insertAfter()方法在现有元素后添加一个新元素

    复制代码 代码如下: //在现有元素后添加一个新元素 function insertAfter(newElement, targetElement){ var parent = targetElement.parentNode; if (parent.lastChild == targetElement){ parent.appendChild(newEl...2014-05-31
  • Android开发中findViewById()函数用法与简化

    findViewById方法在android开发中是获取页面控件的值了,有没有发现我们一个页面控件多了会反复研究写findViewById呢,下面我们一起来看它的简化方法。 Android中Fin...2016-09-20
  • c#中分割字符串的几种方法

    单个字符分割 string s="abcdeabcdeabcde"; string[] sArray=s.Split('c'); foreach(string i in sArray) Console.WriteLine(i.ToString()); 输出下面的结果: ab de...2020-06-25
  • Android模拟器上模拟来电和短信配置

    如果我们的项目需要做来电及短信的功能,那么我们就得在Android模拟器开发这些功能,本来就来告诉我们如何在Android模拟器上模拟来电及来短信的功能。 在Android模拟...2016-09-20