小编Car*_*los的帖子

如何使用WiFi Direct打印文本文件

我有一个可以显示用户统计信息的Android应用程序.我想将一个带有纯文本格式(.txt)的小报告发送到WiFi Direct打印机.我从Android 下载了示例演示应用程序.我做了正确的修改,以便查找.txt文件.但我不明白为什么我的代码不起作用.选择我要打印的文件后,没有任何反应.

我的EPSON打印机的当前配置如下.

  • Wi-Fi直连模式:开启

  • 通讯模式:AP

  • 操作模式:IEEE802.11g/n

  • 通讯速度:自动

  • SSID:DIRECT-D3A36C54
  • 频道:7
  • 安全等级:WPA2-PSK(AES)

  • 链接状态:未知

这是DeviceDetailFragment类

public class DeviceDetailFragment extends Fragment implements WifiP2pManager.ConnectionInfoListener {
    protected static final int CHOOSE_FILE_RESULT_CODE = 20;
    private View mContentView = null;
    private WifiP2pDevice device;
    private WifiP2pInfo info;
    ProgressDialog progressDialog = null;
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
    }
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        mContentView = inflater.inflate(R.layout.device_detail, null);
        mContentView.findViewById(R.id.btn_connect).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                WifiP2pConfig config = new …
Run Code Online (Sandbox Code Playgroud)

java printing android wifi-direct

23
推荐指数
1
解决办法
1337
查看次数

Maven将Target中生成的JAR复制到外部文件夹

在常规 Netbeans 项目中,您有一个 build.xml,我可以使用以下命令将生成的 JAR 文件复制到不同的文件夹:

<target name ="-post-jar" > 
    <copy file ="${dist.jar}" todir ="../Plugin Jars" failonerror ="true"/> 

    <copy file ="${dist.jar}" todir ="/Users/dev/Desktop/plugins" failonerror ="true"/> 
</target>
Run Code Online (Sandbox Code Playgroud)

现在我有一个使用 Maven 的项目,但我找不到完成相同任务的方法。

编辑:感谢我们的贡献者,我能够通过以下条目做到这一点

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>copy-installed</id>
            <phase>install</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>${project.artifactId}</artifactId>
                  <version>${project.version}</version>
                  <type>${project.packaging}</type>
                </artifactItem>
              </artifactItems>
              <outputDirectory>/Users/dev/Desktop/plugins</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
Run Code Online (Sandbox Code Playgroud)

java netbeans pom.xml maven

7
推荐指数
1
解决办法
1万
查看次数

如何使用 Swift 以编程方式粘贴图像?

我有一个工作代码,可以将图像复制到 UIPasteboard,但找不到以编程方式实现 PASTE 功能的方法。任何想法或提示?

uipasteboard ios swift swift2

1
推荐指数
1
解决办法
3722
查看次数

标签 统计

java ×2

android ×1

ios ×1

maven ×1

netbeans ×1

pom.xml ×1

printing ×1

swift ×1

swift2 ×1

uipasteboard ×1

wifi-direct ×1