• How to send mail by java mail in Android uiautomator testing?


    1. Go to link

    http://www.cnblogs.com/rosepotato/admin/Files.aspx to download the libs_javamail_jars.7z which contains activation.jar,additionnal.jar and mail.jar and java file Mail.7z.

    2. put the activation.jar,additionnal.jar and mail.jar into libs directory.

    3. copy

        <property name="jar.libs.dir" value="libs" />
        <property name="jar.libs.absolute.dir" location="${jar.libs.dir}" />
        <path id="classpath">
            <fileset dir="${jar.libs.absolute.dir}">
                <include name="activation.jar"/>
                <include name="additionnal.jar"/>
                <include name="mail.jar"/>
            </fileset>
        </path>

    before the line

        <!-- version-tag: VERSION_TAG -->
        <import file="${sdk.dir}/tools/ant/uibuild.xml" />
    

     in build.xml.

    4. put

        <!-- overwrite the compile target in uibuild.xml to include to external jars -->
        <target name="compile" depends="-build-setup, -pre-compile">
            <javac encoding="${java.encoding}"
                    source="${java.source}" target="${java.target}"
                    debug="true" extdirs="" includeantruntime="false"
                    destdir="${out.classes.absolute.dir}"
                    bootclasspathref="project.target.class.path"
                    verbose="${verbose}"
                    fork="${need.javac.fork}">
                    <src path="${source.absolute.dir}" />
                    <classpath refid="classpath"/>
                    <compilerarg line="${java.compilerargs}" />
            </javac>
        </target>
    
        <!-- overwrite the -dex target in uibuild.xml to include external jar files into the target dex file. -->
        <target name="-dex" depends="compile, -post-compile">
            <dex executable="${dx}"
                    output="${intermediate.dex.file}"
                    nolocals="@{nolocals}"
                    verbose="${verbose}">
                <fileset dir="${jar.libs.absolute.dir}">
                     <include name="activation.jar"/>
                     <include name="additionnal.jar"/>
                     <include name="mail.jar"/>
                </fileset>
                <path path="${out.classes.absolute.dir}"/>
            </dex>
        </target>

    after the line

        <!-- version-tag: VERSION_TAG -->
        <import file="${sdk.dir}/tools/ant/uibuild.xml" />

    then, everything is ok.

  • 相关阅读:
    瑞士军刀DLib的VS2015编译
    win10编译libpng
    win10编译zlib
    win10编译jpeglib
    Hough Transform直线检测
    html+css简单的实现360搜索引擎首页面
    HTML和css简单日常总结
    MySQL中的分区(六)KEY分区
    CentOS 8 安装vsftpd 服务器
    linux负载过高 排查方法及说明 附:Centos安装iostat
  • 原文地址:https://www.cnblogs.com/rosepotato/p/3123969.html
Copyright © 2020-2023  润新知