小编Kil*_*ler的帖子

谷歌手机广告创意预览不起作用

我是移动广告的新手。我正在加载PublisherAdView. 当我在onAdLoaded().

以下是显示广告加载成功的日志。

I/CommonAdsUtility: loadCarouselSearchScreen() [Thread: main]
I/CommonAdsUtility: screenName: android_pnr_search [Thread: main]
I/CommonAdsUtility: card_type 2 [Thread: main]
I/CommonAdsUtility: card_ad_unit/12756069/android_pnr_search_banner [Thread: main]
I/CommonAdsUtility: loadBannerAd() [Thread: main]
I/CommonAdsUtility: adUnitId: /12756069/android_pnr_search_banner [Thread: main]
I/CommonAdsUtility: ryTag: null [Thread: main]
I/CommonAdsUtility: adSizes: [320x100_as, 320x160_as, 320x50_mb, 300x250_as, fluid, smart_banner] [Thread: main]
I/Ads: Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("B1EFAF80C6D9B2BB3EDF01B714EC2319") to get test ads on this device.
I/CommonAdsUtility: dfpCarouselEntity::: [] [Thread: main]
W/Ads: Not retrying to fetch app settings
I/CommonAdsUtility: onAdLoaded() >>> adUnitId/12756069/and_carousel_small_home [Thread: main]
I/Ads: SDK version: …
Run Code Online (Sandbox Code Playgroud)

android ad-management google-ad-manager google-dfp google-mobile-ads

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

"PayU"Android集成中的INVALID_USER_CREDENTIALS/JSON_EXCEPTION

我想将payU支付网关与我的电子商务应用程序集成.我在测试payU上有一个帐户,包含商家ID,密钥和盐.

我正在研究这个演示应用程序,每当我更改参数时merchant key,salt.我得到了error code 5014.

哪个可以是其中之一.

  • int INVALID_USER_CREDENTIALS = 5014;
  • int JSON_EXCEPTION = 5014;

注意:我得到的是response string:

"Something went wrong : Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject"

我正在尝试调试它.但我找不到合适的文档.

请帮忙.

android payment-gateway payu

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

当从最近的应用程序中刷过应用程序时,前台服务将被终止,通知将被删除

我有foreground-service通知。当应用程序从最近的应用程序托盘中滑走时,服务将被终止,通知也将被删除。这是我的服务代码VoiceService.class

@Override
public IBinder onBind(Intent intent) {
    return null;
}

@Override
public int onStartCommand(Intent intent, int flags, int startId) {

        showNotification();
        Toast.makeText(this, "Service Started!", Toast.LENGTH_SHORT).show();


    return START_STICKY;
}
private void showNotification() {
    new SetupTask(this).execute(); // a method in my code which works fine.
    Intent notificationIntent = new Intent(this, MainActivity.class);
    notificationIntent.setAction(Constants.ACTION.MAIN_ACTION);
    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
            | Intent.FLAG_ACTIVITY_CLEAR_TASK);
    PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,
            notificationIntent, 0);



    Notification notification = new NotificationCompat.Builder(this)
            .setContentTitle("TutorialsFace Music Player")
            .setContentText("My song")
            .setSmallIcon(R.drawable.ic_launcher_foreground)
            .setContentIntent(pendingIntent)
            .setOngoing(true)
            .build();
    startForeground(Constants.NOTIFICATION_ID.FOREGROUND_SERVICE, notification); …
Run Code Online (Sandbox Code Playgroud)

android android-service foreground-service

6
推荐指数
0
解决办法
322
查看次数

找不到与包名称 processAppDebugGoogleServices 匹配的客户端

我已经尝试了 Stack Overflow 上几乎所有相关的解决方案。但问题仍然没有解决。

Error: Execution failed for task ':App:processAppDebugGoogleServices'.
> No matching client found for package name 'com.example.application'
Run Code Online (Sandbox Code Playgroud)

设置.gradle:

include ':App'
Run Code Online (Sandbox Code Playgroud)

这是清单代码:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.application"
    android:versionCode="17"
    android:versionName="1.17">
Run Code Online (Sandbox Code Playgroud)

以下是应用程序级别的 Gradle 依赖项:

classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:2.0.0-alpha3'
Run Code Online (Sandbox Code Playgroud)

问题:flavor1,即应用程序,正在生成错误,而 application_rtl 工作正常。

android google-play-services android-productflavors

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

使用 DEFAULT_SERIALIZE_NULLS 值时不会跳过 Retrofit2/Gson 空值

我遇到了一些未知错误。这打破了我对 Kotlin 数据类和 Api 响应的空安全假设。

说,我有一个数据类说Person

 data class Person(val name: String) {
    constructor() : this("")
}
Run Code Online (Sandbox Code Playgroud)

这将生成一个具有默认名称值(即非空)的对象 Person。早些时候,当我使用默认改造客户端时GsonConverterFactory.create()(添加为转换器工厂)。在默认模式下,Gson 不会序列化空值。但是今天我发现该字段被序列化为 null。

我在https://github.com/google/gson/blob/master/gson/src/main/java/com/google/gson/internal/bind/ReflectiveTypeAdapterFactory.java#L206 中验证相同ReflectiveTypeAdapterFactory

这里的实例值具有非空字段,但在读取每个字段 ( field.read(in, instance);) 后,它分配了空值。我期望在序列化过程中跳过空值还是反序列化?


编辑:看起来它是反序列化空值而不是序列化空值问题。参考:https : //github.com/google/gson/issues/1148

如果缺少任何细节或造成混淆,请告诉我。

android json gson kotlin retrofit2

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

修复了ViewPager内容布局中CoordinatorLayout下的视图

我的应用程序有一个ActivityTabLayout,和3 Fragments.在Activity's布局,我都CoordinatorLayoutViewPager.我也需要动画工具栏.现在在Fragments布局中,我需要在底部放置一个固定的TextView.下面给出的是XML活动和片段.

我面临的问题是,TextView在Fragment的布局中修复的问题是在底部导航栏下面并且也在滚动,我不想要.

怎么能实现这个?

activity.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/clMain"
    android:layout_width="match_parent"
    android:layout_height="match_parent">


    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:layout_scrollFlags="scroll|enterAlways|snap"
            app:popupTheme="@style/AppTheme.PopupOverlay">

            <TextView
                android:id="@+id/toolbar_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/app_name"
                android:textColor="#FFFFFF"
                android:textSize="22sp"
                android:textStyle="bold" />
        </android.support.v7.widget.Toolbar>

        <android.support.design.widget.TabLayout
            android:id="@+id/tab_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/toolbar"
            android:background="?attr/colorPrimary"
            android:minHeight="?attr/actionBarSize"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />

    </android.support.design.widget.AppBarLayout>

    <android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

</android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)

fragment.xml之

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent" …
Run Code Online (Sandbox Code Playgroud)

android android-viewpager material-design android-coordinatorlayout android-appbarlayout

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

Facebook app app上的'缺少应用程序链接URL'

我正在尝试设置Facebook应用邀请,但我不断得到:'此邀请中使用的应用链接不包含Android或iOS网址'

我使用我的网站作为URL,其中包含以下元标记:

<meta property="al:ios:url" content="(myapplink)" />
<meta property="al:ios:app_store_id" content="(myappid)" />
<meta property="al:ios:app_name" content="(myappname)" />
<meta property="og:title" content="(myappname)" />
<meta property="og:type" content="website" />
Run Code Online (Sandbox Code Playgroud)

谁知道我做错了什么?谢谢

facebook ios

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

将熔化输出保存到另一个avi/mp4文件

我正在尝试使用mltframework合并2+个视频.我想从这些合并的视频文件中生成另一个.avi文件.我怎样才能做到这一点?

media media-player mlt melt-framework

2
推荐指数
2
解决办法
7566
查看次数