说三道四技术文摘-感悟人生的经典句子
说三道四 > 文档快照

Android开发进阶之NIO非阻塞包(八)

HTML文档下载 WORD文档下载 PDF文档下载
Android开发进阶之NIO非阻塞包(八)

作者:Android开发网


   在整个DDMS中体现Android NIO主要框架的要数MonitorThread.java这个文件了,有关PC和Android手机同步以及NIO非阻塞编程的精髓可以在下面的文件中充分体现出来。

  final class MonitorThread extends Thread {

    private static final int CLIENT_READY = 2;

    private static final int CLIENT_DISCONNECTED = 3;

    private volatile boolean mQuit = false;

    private ArrayList<Client> mClientList; //用一个数组保存客户端信息

    private Selector mSelector;

    private HashMap<Integer, ChunkHandler> mHandlerMap; //这里Android123提示大家,由于在多线程中concurrentHashMap效率比HashMap更安全高效,推荐使用并发库的这个替代版本。

    private ServerSocketChannel mDebugSelectedChan; //一个用于调试的服务器通道

    private int mNewDebugSelectedPort;

    private int mDebugSelectedPort = -1;

    private Client mSelectedClient = null;

    private static MonitorThread mInstance;

    private MonitorThread() {
        super("Monitor");
        mClientList = new ArrayList<Client>();
        mHandlerMap = new HashMap<Integer, ChunkHandler>();

        mNewDebugSelectedPort = DdmPreferences.getSelectedDebugPort();
    }

    static MonitorThread createInstance() {  //创建实例
        return mInstance = new MonitorThread();
    }

    static MonitorThread getInstance() { //获取实例
        return mInstance;
    }

    synchronized void setDebugSelectedPort(int port) throws IllegalStateException { //设置调试端口号
        if (mInstance == null) {
            return;
        }

        if (AndroidDebugBridge.getClientSupport() == false) {
            return;
        }

        if (mDebugSelectedChan != null) {
            Log.d("ddms", "Changing debug-selected port to " + port);
            mNewDebugSelectedPort = port;
            wakeup(); //这里用来唤醒所有的Selector
        } else {
            // we set mNewDebugSelectedPort instead of mDebugSelectedPort so that it's automatically
            mNewDebugSelectedPort = port;
        }
    }

    synchronized void setSelectedClient(Client selectedClient) {
        if (mInstance == null) {
            return;
        }

        if (mSelectedClient != selectedClient) {
            Client oldClient = mSelectedClient;
            mSelectedClient = selectedClient;

            if (oldClient != null) {
                oldClient.update(Client.CHANGE_PORT);
            }

            if (mSelectedClient != null) {
                mSelectedClient.update(Client.CHANGE_PORT);
            }
        }
    }

    Client getSelectedClient() {
        return mSelectedClient;
    }

    boolean getRetryOnBadHandshake() {
        return true; // TODO? make configurable
    }

    Client[] getClients() {
        synchronized (mClientList) {
            return mClientList.toArray(new Client[0]);
        }
    }

    synchronized void registerChunkHandler(int type, ChunkHandler handler) {
        if (mInstance == null) {
            return;
        }

        synchronized (mHandlerMap) {
            if (mHandlerMap.get(type) == null) {
                mHandlerMap.put(type, handler);
            }
        }
    }

    @Override
    public void run() { //本类的主要线程
        Log.d("ddms", "Monitor is up");

        try {
            mSelector = Selector.open();
        } catch (IOException ioe) {
            Log.logAndDisplay(LogLevel.ERROR, "ddms",
                    "Failed to initialize Monitor Thread: " + ioe.getMessage());
            return;
        }

        while (!mQuit) {

            try {
                synchronized (mClientList) {
                }

                try {
                    if (AndroidDebugBridge.getClientSupport()) {
                        if ((mDebugSelectedChan == null ||
                                mNewDebugSelectedPort != mDebugSelectedPort) &&
                                mNewDebugSelectedPort != -1) {
                            if (reopenDebugSelectedPort()) {
                                mDebugSelectedPort = mNewDebugSelectedPort;
                            }
                        }
                    }
                } catch (IOException ioe) {
                    Log.e("ddms",
                            "Failed to reopen debug port for Selected Client to: " + mNewDebugSelectedPort);
                    Log.e("ddms", ioe);
                    mNewDebugSelectedPort = mDebugSelectedPort; // no retry
                }

                int count;
                try {
                    count = mSelector.select();
                } catch (IOException ioe) {
                    ioe.printStackTrace();
                    continue;
                } catch (CancelledKeyException cke) {
                    continue;
                }

                if (count == 0) {
                    continue;
                } //这里代码写的不是很好,Android开发网提示大家因为这个NIO是DDMS工作在PC端的还不明显,这样轮训的在一个while中,效率不是很高,CPU很容易占用率很高。

                Set<SelectionKey> keys = mSelector.selectedKeys();
                Iterator<SelectionKey> iter = keys.iterator(); //使用迭代器获取这个选择键

                while (iter.hasNext()) {
                    SelectionKey key = iter.next();
                    iter.remove();

                    try {
                        if (key.attachment() instanceof Client) { //判断收到的key的附件是否是Client的实例
                            processClientActivity(key);
                        }
                        else if (key.attachment() instanceof Debugger) { //如果是Debug实例
                            processDebuggerActivity(key);
                        }
                        else if (key.attachment() instanceof MonitorThread) {
                            processDebugSelectedActivity(key);
                        }
                        else {
                            Log.e("ddms", "unknown activity key");
                        }
                    } catch (Exception e) {
                        Log.e("ddms", "Exception during activity from Selector.");
                        Log.e("ddms", e);
                    }
                }
            } catch (Exception e) {
                Log.e("ddms", "Exception MonitorThread.run()");
                Log.e("ddms", e);
            }
        }
    }

    int getDebugSelectedPort() {
        return mDebugSelectedPort;
    }

    private void processClientActivity(SelectionKey key) {
        Client client = (Client)key.attachment();

        try {
            if (key.isReadable() == false || key.isValid() == false) {
                Log.d("ddms", "Invalid key from " + client + ". Dropping client.");
                dropClient(client, true /* notify */);
                return;
            }

            client.read();

            JdwpPacket packet = client.getJdwpPacket();
            while (packet != null) {
                if (packet.isDdmPacket()) {
                    // unsolicited DDM request - hand it off
                    assert !packet.isReply();
                    callHandler(client, packet, null);
                    packet.consume();
                } else if (packet.isReply()
                        && client.isResponseToUs(packet.getId()) != null) {
                    // reply to earlier DDM request
                    ChunkHandler handler = client
                            .isResponseToUs(packet.getId());
                    if (packet.isError())
                        client.packetFailed(packet);
                    else if (packet.isEmpty())
                        Log.d("ddms", "Got empty reply for 0x"
                                + Integer.toHexString(packet.getId())
                                + " from " + client);
                    else
                        callHandler(client, packet, handler);
                    packet.consume();
                    client.removeRequestId(packet.getId());
                } else {
                    Log.v("ddms", "Forwarding client "
                            + (packet.isReply() ? "reply" : "event") + " 0x"
                            + Integer.toHexString(packet.getId()) + " to "
                            + client.getDebugger());
                    client.forwardPacketToDebugger(packet);
                }

                packet = client.getJdwpPacket();
            }
        } catch (CancelledKeyException e) { //注意正确处理这个异常
            dropClient(client, true /* notify */);
        } catch (IOException ex) {
            dropClient(client, true /* notify */);
        } catch (Exception ex) {
            Log.e("ddms", ex);

            dropClient(client, true /* notify */);

            if (ex instanceof BufferOverflowException) { //可能存在缓冲区异常
                Log.w("ddms",
                        "Client data packet exceeded maximum buffer size "
                                + client);
            } else {
                // don't know what this is, display it
                Log.e("ddms", ex);
            }
        }
    }

    private void callHandler(Client client, JdwpPacket packet,
            ChunkHandler handler) {

        // on first DDM packet received, broadcast a "ready" message
        if (!client.ddmSeen())
            broadcast(CLIENT_READY, client);

        ByteBuffer buf = packet.getPayload();
        int type, length;
        boolean reply = true;

        type = buf.getInt();
        length = buf.getInt();

        if (handler == null) {
            // not a reply, figure out who wants it
            synchronized (mHandlerMap) {
                handler = mHandlerMap.get(type);
                reply = false;
            }
        }

        if (handler == null) {
            Log.w("ddms", "Received unsupported chunk type "
                    + ChunkHandler.name(type) + " (len=" + length + ")");
        } else {
            Log.d("ddms", "Calling handler for " + ChunkHandler.name(type)
                    + " [" + handler + "] (len=" + length + ")");
            ByteBuffer ibuf = buf.slice();
            ByteBuffer roBuf = ibuf.asReadOnlyBuffer(); // enforce R/O
            roBuf.order(ChunkHandler.CHUNK_ORDER);
            synchronized (mClientList) {
                handler.handleChunk(client, type, roBuf, reply, packet.getId());
            }
        }
    }

    synchronized void dropClient(Client client, boolean notify) {
        if (mInstance == null) {
            return;
        }

        synchronized (mClientList) {
            if (mClientList.remove(client) == false) {
                return;
            }
        }
        client.close(notify);
        broadcast(CLIENT_DISCONNECTED, client);

        /*
         * http://forum.java.sun.com/thread.jspa?threadID=726715&start=0
         * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5073504
         */
        wakeup();
    }

    /*
     * Process activity from one of the debugger sockets. This could be a new
     * connection or a data packet.
     */
    private void processDebuggerActivity(SelectionKey key) {
        Debugger dbg = (Debugger)key.attachment();

        try {
            if (key.isAcceptable()) { //处理Server响应这个事件
                try {
                    acceptNewDebugger(dbg, null);
                } catch (IOException ioe) {
                    Log.w("ddms", "debugger accept() failed");
                    ioe.printStackTrace();
                }
            } else if (key.isReadable()) { //如果是收到的数据,则可读取
                processDebuggerData(key);
            } else {
                Log.d("ddm-debugger", "key in unknown state");
            }
        } catch (CancelledKeyException cke) { //记住,NIO处理这个异常,很多入门的开发者很容易忘记
            // key has been cancelled we can ignore that.
        }
    }

     private void acceptNewDebugger(Debugger dbg, ServerSocketChannel acceptChan) //这里用到了阻塞方式
            throws IOException {

        synchronized (mClientList) {
            SocketChannel chan;

            if (acceptChan == null)
                chan = dbg.accept();
            else
                chan = dbg.accept(acceptChan);

            if (chan != null) {
                chan.socket().setTcpNoDelay(true);

                wakeup();

                try {
                    chan.register(mSelector, SelectionKey.OP_READ, dbg);
                } catch (IOException ioe) {
                    // failed, drop the connection
                    dbg.closeData();
                    throw ioe;
                } catch (RuntimeException re) {
                    // failed, drop the connection
                    dbg.closeData();
                    throw re;
                }
            } else {
                Log.w("ddms", "ignoring duplicate debugger");
            }
        }
    }

    private void processDebuggerData(SelectionKey key) {
        Debugger dbg = (Debugger)key.attachment();

        try {
            dbg.read();

            JdwpPacket packet = dbg.getJdwpPacket();
            while (packet != null) {
                Log.v("ddms", "Forwarding dbg req 0x"
                        + Integer.toHexString(packet.getId()) + " to "
                        + dbg.getClient());

                dbg.forwardPacketToClient(packet);

                packet = dbg.getJdwpPacket();
            }
        } catch (IOException ioe) {
            Log.d("ddms", "Closing connection to debugger " + dbg);
            dbg.closeData();
            Client client = dbg.getClient();
            if (client.isDdmAware()) {
                   Log.d("ddms", " (recycling client connection as well)");

                    client.getDeviceImpl().getMonitor().addClientToDropAndReopen(client,
                        IDebugPortProvider.NO_STATIC_PORT);
            } else {
                Log.d("ddms", " (recycling client connection as well)");
                // we should drop the client, but also attempt to reopen it.
                // This is done by the DeviceMonitor.
                client.getDeviceImpl().getMonitor().addClientToDropAndReopen(client,
                        IDebugPortProvider.NO_STATIC_PORT);
            }
        }
    }

    private void wakeup() {
        mSelector.wakeup();
    }

    synchronized void quit() {
        mQuit = true;
        wakeup();
        Log.d("ddms", "Waiting for Monitor thread");
        try {
            this.join();
            // since we're quitting, lets drop all the client and disconnect
            // the DebugSelectedPort
            synchronized (mClientList) {
                for (Client c : mClientList) {
                    c.close(false /* notify */);
                    broadcast(CLIENT_DISCONNECTED, c);
                }
                mClientList.clear();
            }

            if (mDebugSelectedChan != null) {
                mDebugSelectedChan.close();
                mDebugSelectedChan.socket().close();
                mDebugSelectedChan = null;
            }
            mSelector.close();
        } catch (InterruptedException ie) {
            ie.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        mInstance = null;
    }

    synchronized void addClient(Client client) {
        if (mInstance == null) {
            return;
        }

        Log.d("ddms", "Adding new client " + client);

        synchronized (mClientList) {
            mClientList.add(client);

            try {
                wakeup();

                client.register(mSelector);

                Debugger dbg = client.getDebugger();
                if (dbg != null) {
                    dbg.registerListener(mSelector);
                }
            } catch (IOException ioe) {
                // not really expecting this to happen
                ioe.printStackTrace();
            }
        }
    }

    /*
     * Broadcast an event to all message handlers.
     */
    private void broadcast(int event, Client client) {
        Log.d("ddms", "broadcast " + event + ": " + client);

        /*
         * The handler objects appear once in mHandlerMap for each message they
         * handle. We want to notify them once each, so we convert the HashMap
         * to a HashSet before we iterate.
         */
        HashSet<ChunkHandler> set;
        synchronized (mHandlerMap) {
            Collection<ChunkHandler> values = mHandlerMap.values();
            set = new HashSet<ChunkHandler>(values);
        }

        Iterator<ChunkHandler> iter = set.iterator();
        while (iter.hasNext()) {
            ChunkHandler handler = iter.next();
            switch (event) {
                case CLIENT_READY:
                    try {
                        handler.clientReady(client);
                    } catch (IOException ioe) {
                        // Something failed with the client. It should
                        // fall out of the list the next time we try to
                        // do something with it, so we discard the
                        // exception here and assume cleanup will happen
                        // later. May need to propagate farther. The
                        // trouble is that not all values for "event" may
                        // actually throw an exception.
                        Log.w("ddms",
                                "Got exception while broadcasting 'ready'");
                        return;
                    }
                    break;
                case CLIENT_DISCONNECTED:
                    handler.clientDisconnected(client);
                    break;
                default:
                    throw new UnsupportedOperationException();
            }
        }

    }

    /**
     * Opens (or reopens) the "debug selected" port and listen for connections.
     * @return true if the port was opened successfully.
     * @throws IOException
     */
    private boolean reopenDebugSelectedPort() throws IOException {

        Log.d("ddms", "reopen debug-selected port: " + mNewDebugSelectedPort);
        if (mDebugSelectedChan != null) {
            mDebugSelectedChan.close();
        }

        mDebugSelectedChan = ServerSocketChannel.open();
        mDebugSelectedChan.configureBlocking(false); // required for Selector

        InetSocketAddress addr = new InetSocketAddress(
                InetAddress.getByName("localhost"), //$NON-NLS-1$
                mNewDebugSelectedPort);
        mDebugSelectedChan.socket().setReuseAddress(true); // enable SO_REUSEADDR

        try {
            mDebugSelectedChan.socket().bind(addr);
            if (mSelectedClient != null) {
                mSelectedClient.update(Client.CHANGE_PORT);
            }

            mDebugSelectedChan.register(mSelector, SelectionKey.OP_ACCEPT, this);

            return true;
        } catch (java.net.BindException e) {
            displayDebugSelectedBindError(mNewDebugSelectedPort);

            // do not attempt to reopen it.
            mDebugSelectedChan = null;
            mNewDebugSelectedPort = -1;

            return false;
        }
    }

    /*
     * We have some activity on the "debug selected" port. Handle it.
     */
    private void processDebugSelectedActivity(SelectionKey key) {
        assert key.isAcceptable();

        ServerSocketChannel acceptChan = (ServerSocketChannel)key.channel();

        /*
         * Find the debugger associated with the currently-selected client.
         */
        if (mSelectedClient != null) {
            Debugger dbg = mSelectedClient.getDebugger();

            if (dbg != null) {
                Log.d("ddms", "Accepting connection on 'debug selected' port");
                try {
                    acceptNewDebugger(dbg, acceptChan);
                } catch (IOException ioe) {
                    // client should be gone, keep going
                }

                return;
            }
        }

        Log.w("ddms",
                "Connection on 'debug selected' port, but none selected");
        try {
            SocketChannel chan = acceptChan.accept();
            chan.close();
        } catch (IOException ioe) {
            // not expected; client should be gone, keep going
        } catch (NotYetBoundException e) {
            displayDebugSelectedBindError(mDebugSelectedPort);
        }
    }

    private void displayDebugSelectedBindError(int port) {
        String message = String.format(
                "Could not open Selected VM debug port (%1$d). Make sure you do not have another instance of DDMS or of the eclipse plugin running. If it's being used by something else, choose a new port number in the preferences.",
                port);

        Log.logAndDisplay(LogLevel.ERROR, "ddms", message);
    }
}

  从上面来看Android的开源代码有关PC上的写的不是很好,很多实现的地方都是用了严重的缝缝补补方式解决,有些习惯不是很到位,有关本NIO例子由于涉及的项目对象多,理解需要网友深入分析DDMS源码中的每个对象。细节写的不是很理想,Android123推荐大家,画出UML后再分析更清晰。

【MDCC 2014】电信技术专场:运营商与开发者如何合作共赢 【MDCC 2014】高德LBS大赛闭幕式暨颁奖典礼:下一个50亿应用花落谁家? MDCC 2014移动开发者大会开幕:全生态系统齐聚 开发者成主角 蓝港互动有限公司董事长&amp;amp;首席执行官王峰:移动互联网泛娱乐化趋势 多盟联合创始人&amp;amp;总裁张鹤:多盟DSPAN助力开发者高效变现 创新工场联合创始人汪华:移动互联网时代的跃迁式增长 阿里巴巴集团UC移动事业群总裁俞永福:AMAP Inside——更专业、更开放 《程序员+》移动应用上线 启动“2014 MDCC十大人气应用/产品评选活动” 微软开发体验与平台合作事业部大中华区DX部门总经理Srikanth Raju:基于云的跨平台开发 Facebook平台工程合作部亚太区总经理张博:通过Facebook构建下一代移动应用 Vungle工程副总裁Wayne Chan:移动视频广告的未来 友盟副总裁焦岳:2014移动互联网行业趋势&amp;amp;大数据的行业价值与运营支持 联发科技创意实验室副总裁Marc Naddell:以小博大的可穿戴方案 用友软件股份有限公司高级副总裁谢志华:企业互联网移动化触手可及 【MDCC 2014】英雄会晚宴——厉兵秣马,再上征程 移动开发技术与平台峰会(上):流量优化、数据管理、IM、LBS与跨平台开发 【推广、盈利与投资论坛】探寻推广与盈利新趋势 【企业移动化论坛】翻山越岭,创新突围企业移动化 解读微信与开发者双赢的开放能力 2014年10月操作系统份额:Windows 8.1份额喜人,Linux跌惨了 智能硬件峰会(下):苹果、微信、小米带给移动医疗产品开发的启示 移动游戏峰会(下):从端游转型手游、如何做一款不一样的游戏 移动游戏峰会(上):小团队如何做出大制作、游戏防作弊攻防战 深圳微信开发者大会:拒绝概念 这次只谈“怎么做” AMD应邀出席HPC China 2014,重磅推出新一代Firepro-S系列高性能显卡 你就是主角,MDCC 2014交流对接活动回顾(组图) 解读最具O2O属性—哈根达斯微信企业号的成功之道 值得Java开发者参与贡献的十个开源项目 LokiJS:纯JavaScript实现的轻量级数据库 OpenStack第七次北京Meet Up:谈私有云现状 中国电信携手电商打造跨界O2O联盟 关于译码器的问题,急!! *******在red hat linux下怎么设置DNS?网络设置里没有嘛 help 一个简单的问题 怎样删除干净OCX控件? 我用QQ的自定义查找输入一个QQ号码,但现在忘了我输入的是哪个号码,能不能找回? 框架制作!! 框架的问题 提个弱问! 使用treeview控件,我想给它们的节点图标都换一下,可它默认图标都在上面,怎么去掉默认的。 有牛人吗?准考证英文怎么说? 请大家帮我看看,我的机器是怎么回事?我的机器很不稳定!!! 我为大家共享的资源.找我的人太多了,我吃不消.在这里列BILL.大家看看,书不算太多。 很傻的问题,在线等 ★★如何实现按一下按钮可以终止一个正在运行中的循环?请举个例子,谢谢! 谁能帮我提供一点资料或文档! 告急?(在线等待) 用正则表达式,怎么验证日期(yyyy-mm-dd)的输入啊? kao~ 请教有关MSWORD9.OLB的帮助文档是哪个? 怎样知道一个调度执行失败或没有执行???(MSSQL7)上火呀~~~ 如何将自己定义的记录类型转化成Tmemorystream对象? c++builder5的下载地址? 做个调查,来者有分。 ODBC下的数据库查询,急!急! 初学者的问题--com dll服务器如何在客户程序中使用? 如何统计 DBGrid 中记录的个数???? 请教:m_fLogfile.Read(pBuffer , sizeof(VNumAndPassWord)); 错在哪? 谁能替我做一张图片啊? 气死人了,安装红帽子在输入根口令时遇到的尴尬:( 奇怪的oracle数据库错误? 公布我的软件了——网络邮盘,国内日下载量>1000,国外<10 关于堆和栈的队! 请问,准考证的英文怎么说? ASP终极开发:请成功用INSTALLSHIELD设置好IIS的高手朋友进来看看。100分全散了!!!!! 是屏保的问题?还是硬件故障? 紧急救命啊!各位大虾:)98关机时断电出现的故障 初级问题,请教大侠 在C#里面如何取得这个SQL値那? 请教, 扫描的问题... 不好意思,还有问题,关于span,恳请高手答完再下班。 心情郁闷,各位朋友安慰我一下好么。 如何注册JDBC驱动啊!我手头好多的驱动但是我不知道如何的注册这些驱动 在RICHEDIT里怎么实现换行输出? 200分求快速取中值的算法!(thirdapple) Flash Action 如何定时,就像Javascript中的setTimeout()? 保护的问题 用一个关于Printer对象的问题?各位大虾,初来乍到,请多多关照。 请问如何自动提交一个FORM? 请问各位师兄:web开发如何起步?例如使用JSP? 求助! 如何知道电脑中的网卡是什么型号的? It was 3 years ago ______ he came back.我知道答案是after,请知道的告诉我,原题是:用before after since填空It was 3 years ______ he came back.It was 3 years ago ______ he came back.It is 3 years ______ he came b 句子转换 1.i like action movies best( because thye're really exciting).对打括号部分提问.2.cina can (swim and play chess)对打括号的部分提问 英语作文 The city of GuangZhou麻烦帮我写篇英语作文!是 The city of GuangZhou 只要六句话就够了!句子单词要简单! 为什么I thought he came back after five years的come要用过去式 求2011年6月英语四级听力mp3,最好还有卷子! 麻烦发到moying845@163.com 谢谢了! btnStart.enabled = false; btnSubmit.enabled = true; 代码的意思? It was three years before he came 哪有2011年6月英语四级真题答案详解 就是像买的卷子一样的那样的详解 Logoff.Enabled=False是什么意思? we left after he came back home 2011年江西6月18号四级英语考卷和答案? this.SetAll("enabled",IIF(l,.T.,.F.),"TextBox")是什么意思 dragon boat races 是什么意思 英语翻译A healthy person is often happy and positive about life.Each one of us should make it a point to take care of our health and physical fitness. The stuedents come from_countries and there many__between them.(different) dragon boat races翻译中文 the man's father is my father's only son我跟the man什么关系?有英语老师或者英语8级能按语法分段指点分析下么?我英语语法不好。有人说只有一种关系。姑侄?------------------------------------请注意Only S be different from与have/has difference between的区别(5分悬赏) (The tall man)is the doctor(对括号部分提问)怎么写? 用who whom that which 填空The girl ____you saw just now is my sisterDo you remember the words ____ we learned last year.This is the watch ____ my mother gave me for my birthday.Tom is the fist boy____ left the class room.Uncle Li is a person ____ different between sth 和 different from 的区别 读《世说新语二则》有感600字,急! 英语翻译难道不是“但是那个男人的父亲是我父亲的儿子”吗? 公式be different from······ 用适当的关系代词 who,whom,whose,that,which填空The boy____name is Wilson helps me a lot.That song is the only one____I really like.The war____lasted three months came to an end. a man lonked at photo and said,"that person's father is my father's son.i've1.T( ) put the pot under the s(un) and add water often.Add t( ) wait for the s( ).At last wait for a flower to grow.2.Zoom:H(ow) do we save water?Zip:F(un),do not waste water acknowledge和admit做承认时的区别eg.Many people no longer ______ him as their president. 广州话有多少个读音?分别是什么? What would you like to be?怎么回答What would you like to be?怎么回答 acknowledge admit 有什么区别 和胡歌一起玩穿越为主题,写个600字左右的作文、. 英语翻译富有激情,思想积极、前卫,性格开朗善于与人交际,认定做一件事就会全力以赴,在工作上有较强的组织管理和动手能力,集体荣誉感强,团队协作、创新意识较好.三楼五楼的不想说你们 老天爷、、admit和acknowledge作承认的时候到底有啥子区别啊? watch the dragon boat john is no longer the man ___ he was a few years ago.A.who B.whom C.that 应该选什么啊? confess,acknowledge,recognize,admit,concede的用法有什么区别 I love the races on the dragon boat festival.I think ( )fun to watchA. it'sB. they'reC. it wasD. they were He is no longer the man ___he was 15 years agoA which.B whom.C who.D that 英语翻译买了瓶粉底液写着LANCǒME (O上面是^)Whitening & MoistureFoundationNIDSǒ(O上面是^)ME+SYSTE(E上面有^)ME A(A上面有^)NTI-AGERE(E上面有^)INVENTE(E上面有^)是真是假啊? The man is under the tree .He is my father.改为同义句.The man_____ _____ _____is my father. 4.The man under the tree is his father.(就划线部分提问) ------------------5.There are some boys playing football in the park.(改为否定句)The man under the tree is his father.(就划线部分提问]----------------- which letter is the difference between here and there? The man is under the tree.He is my father.(改为同义句) a和one的区别?关系代词如何运用?如:who which that whose what is the difference between letters and emails 求一篇英语作文,what you would like and how you would feel when you are at age of 80? 2011年6月英语四级选项顺序不同吗 the difference between of which and whoseThe owner of the cinema needed to make a lot of improvements and employ more people to keep it running,______meant spednding tens of thousands of pounds.A whose B which C of which Dthat为什么这题选A 而 A:what are you doing in the park B:I am looking at the children They___volleyballA.plays B.are playing C.playing D.to play 选B还是C? 英语翻译高手呢?一句话!不难After heavy use of the product or on a weekly basis, the water should be shock dosed with sanitiser(消毒剂).后半句不是很明白 Though she talks ______,she has made ________ friends here.A.a little,aThough she talks ______,she has made ________ friends here.A.a little,a fewB.little,fewC.little,a fewD.few,a few为什么? He and his father like action movies的同义词转换是什么 急求一句话英语翻译不难她已经14个月大了吧,每天看着你们发过来的她的日常照片,看着她一步步长大, admit that;admit sth;admit doing sth的区别 ( ) is your father?The tall man over there.A.Who B.Which He and his father resly like action movies的同义句:He realy likes action movies______his father.空格处该填什么单词? allow和admit的区别 英语 came back home after four years’ study at university阅读短文,从方框中选出适当的动词,并用其适当形式填空.有的需要加助动词或不定式符号.be write give day workJim came back home after four years’ study at u really,like,Jack,action,movies连词成句 英语作文:If I were the president of America,150字
备案号:鲁ICP备13029499号-2 说三道四 www.s3d4.cn 说三道四技术文摘