我有我的电话号码,TextView想要打开"Intent-picker"来选择我想打电话的应用程序(Skype,Viber ......)或者只是拨打来拨打电话.
Intent callIntent = new Intent(Intent.ACTION_CALL); 立刻打电话,这对我没有帮助.
我有我uploadArhives的Maven存储库.aar发布.
但我必须一直gradlew uploadArhives从控制台运行,如何编写代码使其与每个构建或发布版本一起调用?
uploadArchives {
repositories {
mavenDeployer {
def credentials = [
userName: NEXUS_USERNAME,
password: NEXUS_PASSWORD
]
repository(url: MAVEN_REPO_URL, authentication: credentials)
pom.artifactId = 'aaa'
pom.version = version
pom.packaging = 'aar'
pom.groupId = 'bbb'
}
}
}
Run Code Online (Sandbox Code Playgroud)
编辑:
我认为,我们可以定义功能:
def uploadToMaven = {
uploadArchives
}
Run Code Online (Sandbox Code Playgroud)
但是如何在每次构建时执行它?
我有类似于 WebRtc 在 JavaAudioDeviceModule 中给出的短/字节音频流。
我想将它发送到 WebRtc 后端。是从它创建 AudioTrack 并添加到 peerConnection 的唯一方法吗?如果是,那么如何将自定义流提供给这个本机 C++ 指针?包 org.webrtc;
public class AudioTrack extends MediaStreamTrack {
public AudioTrack(long nativeTrack) {
super(nativeTrack);
}
public void setVolume(double volume) {
nativeSetVolume(this.getNativeAudioTrack(), volume);
}
public long getNativeAudioTrack() {
return this.getNativeMediaStreamTrack();
}
private static native void nativeSetVolume(long var0, double var2);
}
Run Code Online (Sandbox Code Playgroud) 这个问题在 C++ 中有答案。有没有办法做同样的事情或从 Java/Android 端调用代码?
java/kotlin 中的这段代码类似物是什么?
BYTE* source = buffer;
BYTE* destination = convertBuffer3D;
Run Code Online (Sandbox Code Playgroud)
这个 memcpy 函数(取自 c++ 参考memcopy)有什么类似的吗?
void * memcpy ( void * destination, const void * source, size_t num );
Run Code Online (Sandbox Code Playgroud) 我的Maven存储库中包含我的aar文件,位于https://cloudbuild.myompany.com/nexus/content/repositories/test_kirill/com/myompany/myompany-core/2.0.0/
顺便说一句,它是私有存储库,所以在我登录时应该使用凭据。
当我尝试将其添加到我的依赖项时,gradle给了我错误Failed to resolve。
apply plugin: 'com.android.application'
repositories {
mavenCentral()
maven {
credentials {
username 'admin'
password '*******'
}
url 'https://cloudbuild.myompany.com/nexus/content/repositories/test_kirill/'
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "ko.com.myapplication"
minSdkVersion 8
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile group: 'com.myompany', name: 'myompany-core', version: '2.0.0'
}
Run Code Online (Sandbox Code Playgroud)
也有我的POM文件从2.2.0文件夹 …
支持CardView的默认保证金是多少,所以我可以为我的情况定义保证金?
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
card_view:cardUseCompatPadding="true"
card_view:cardCornerRadius="4dp"
card_view:cardElevation="2dp">
Run Code Online (Sandbox Code Playgroud) 我有这个TextInputLayout,EditText我的文本提示是黑色,我想更改它。
顺便说一下,当提示出现在顶部时,它的颜色是白色的
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintTextAppearance="@style/TextAppearance.App.TextInputLayout">
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_password"
android:imeActionId="@+id/login"
android:imeActionLabel="@string/action_sign_in_short"
android:imeOptions="actionUnspecified"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true"
android:textColor="@android:color/white"
android:textColorHint="@android:color/white" />
</android.support.design.widget.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)
风格
<style name="TextAppearance.App.TextInputLayout" parent="@android:style/TextAppearance">
<item name="android:textColor">@android:color/white</item>
<item name="android:textColorHint">@android:color/white</item>
<item name="colorPrimary">@android:color/white</item>
<item name="colorAccent">@android:color/white</item>
</style>
Run Code Online (Sandbox Code Playgroud)
我们是否需要在创建通知通道之前检查它尚未创建?
private fun createChannel() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// todo: add here check if channel is already created
val defaultChannel = NotificationChannel(MEDIA_UPLOAD_NOTIFICATION_CHANNEL_ID, MEDIA_UPLOAD_NOTIFICATION_CHANNEL_NAME, NotificationManager.IMPORTANCE_HIGH)
defaultChannel.description = MEDIA_UPLOAD_NOTIFICATION_CHANNEL_DESC
defaultChannel.enableVibration(true)
notificationManager.createNotificationChannel(defaultChannel)
}
}
Run Code Online (Sandbox Code Playgroud)