小编del*_*lor的帖子

如何将javadoc附加到Android Studio中的Google Play服务?

参考文档com.google.android.gms:play-services可以找到,<android-sdk>/extras/google/google_play_services/docs/reference但我无法弄清楚如何在Android Studio中附加它.

Android Studio 0.8.4,Gradle Android插件0.12.2

android google-play-services android-studio android-gradle-plugin

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

从Eclipse导入Android项目后,依赖项列表中的项无效

将Eclipse中的Android项目向导生成的通用HelloWorld项目导入IntelliJ IDEA CE后,我有两个错误:

invalid item 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK' in dependencies list
invalid item 'com.android.ide.eclipse.adt.LIBRARIES' in dependencies list
Run Code Online (Sandbox Code Playgroud)

如何正确导入项目以避免错误?

eclipse import android intellij-idea

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

Android蓝牙打印

我正在编写一个将数据发送到蓝牙打印机的应用程序.谁能帮我 ?如何使用Android蓝牙堆栈进行打印?或者是否有任何外部api或sdk使用?

这是我搜索蓝牙的代码...

bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
registerReceiver(ActionFoundReceiver,
        new IntentFilter(BluetoothDevice.ACTION_FOUND));

private final BroadcastReceiver ActionFoundReceiver = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if (BluetoothDevice.ACTION_FOUND.equals(action)) {
            BluetoothDevice device = intent
                    .getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
            btArrayAdapter.add(device.getName() + "\n"
                    + device.getAddress());
            btArrayAdapter.notifyDataSetChanged();
        }
    }
};
Run Code Online (Sandbox Code Playgroud)

这是我的数据发送到打印机的代码..

BluetoothDevice mDevice = bluetoothAdapter.getRemoteDevice("00:15:FF:F2:56:A4");
Method m = mDevice.getClass().getMethod("createRfcommSocket",
        new Class[] { int.class });
mBTsocket = (BluetoothSocket) m.invoke(mDevice, 1);
System.out.println("Connecting.....");
mBTsocket.connect();
System.out.println("Connected");
OutputStream os = mBTsocket.getOutputStream();
os.flush();
os.write(Receipt.getBytes());
// mBTsocket.close();
Run Code Online (Sandbox Code Playgroud)

当我写socket.close()时,数据没有打印到打印机,因为套接字连接在打印数据之前关闭..如果我没有写socket.close()那么数据只打印一次..我不会能够第二次打印数据,直到我重新启动手机的蓝牙.

任何人都可以解决它?还是有其他方法可以摆脱这种印刷?

printing android bluetooth

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

如何在Gradle Kotlin DSL中定义Jacoco报告聚合?

在Gradle Groovy中,我正在使用

task jacocoRootReport(type: JacocoReport) {
  dependsOn = subprojects.test

  subprojects.each {
    sourceSets it.sourceSets.main
  }

  executionData.from fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")

  reports {
    html.enabled = true
    xml.enabled = true
    csv.enabled = false
  }
}
Run Code Online (Sandbox Code Playgroud)

但我不知道如何将其转换为Kotlin DSL,这样子项目的Jacoco结果将汇总到根项目中的一个报告中。

gradle jacoco gradle-kotlin-dsl

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

如何为loadData文件中的每一行生成主键值

使用 Liquibase 填充表时,如何为主键自动增量列生成 id?使用我当前的配置 Liquibase 正在放入NULLID 列。

我的变更日志文件:

<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.2.xsd">

    <property name="now" value="now()" dbms="mysql,h2"/>
    <property name="now" value="current_timestamp" dbms="postgresql"/>

    <!--
        Added the entity Skill.
    -->
    <changeSet id="20141029084149" author="jhipster">
        <createTable tableName="T_SKILL">
            <column name="id" type="bigint">
                <constraints primaryKey="true" nullable="false"/>
            </column>
            <column name="value" type="varchar(255)"/>
            <column name="description" type="varchar(255)"/>
        </createTable>

        <loadData encoding="UTF-8"
            file="config/liquibase/skills.csv"
            separator="|"
            tableName="T_SKILL"/>
    </changeSet>
</databaseChangeLog>
Run Code Online (Sandbox Code Playgroud)

skills.csv文件:

value|description
java|Java
java-ee|Java Enterprise Edition
junit|JUnit
Run Code Online (Sandbox Code Playgroud)

liquibase

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