用户William建议我更改我的代码以显示插页式广告
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
//setDebugMode(true);
initialiseAccelerometer();
interstitial = new InterstitialAd(this);
interstitial.setAdUnitId(getResources().getString(R.string.InterstitialAd_unit_id));
interstitial.setAdListener(new AdListener() {
public void onAdClosed() {
// Create another ad request.
final AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
interstitial.loadAd(adRequest);
}
});
// Create ad request.
final AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
interstitial.loadAd(adRequest);
}
Run Code Online (Sandbox Code Playgroud)
并显示广告:
public synchronized void GameOver() {
if (lives_left > 0) {
//success! - game passed - save score
ScoreManager.save_localscore_simple(score_times[currentLevel], "" + currentLevel, false);
if (Level_Buttons.length >= currentLevel …Run Code Online (Sandbox Code Playgroud) 我们有一个非常具体的情况,我想知道有人已经做了类似的事情。在 Woocommerce 订单上,我们使用订单邮件在 WP 中生成用户。然后我们的代理需要手动更改他们的密码,因为这个密码就像是他们内容的 PIN 码。我们通过传统邮件将这些 PIN 码装在信封中寄送。问题是代理需要手动从订单仪表板转到用户 - 找到正确的用户并更改他们的密码。有什么方法可以input field在订单仪表板上为链接到此订单的用户设置密码?
我想将一个源代码从旧更新GoogleAds SDK到新Google Play Service Library,但是有一个问题.每次我收到此错误:
获得广告响应时出现问题.
ErrorCode:0
无法加载广告:0
这是来自playactivty的代码:
public String BANNER_AD_UNIT_ID;
AdRequest adRequest;
private void LoadAds()
{
LinearLayout layout = (LinearLayout) findViewById(R.id.adView);
this.BANNER_AD_UNIT_ID = getResources().getString(R.string.admob_id);
// Create the adView
AdView adView = new AdView(this);
adView.setAdSize(AdSize.BANNER);
adView.setAdUnitId(BANNER_AD_UNIT_ID);
// Add the adView to it
layout.addView(adView);
// Initiate a generic request to load it with an ad
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
// AdRequest.setTesting(true);
adView.loadAd(adRequest);
}
Run Code Online (Sandbox Code Playgroud)
并从layout.xml
</RelativeLayout>
<com.google.android.gms.ads.AdView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="@string/admob_id">
</com.google.android.gms.ads.AdView>
<LinearLayout
android:orientation="horizontal" …Run Code Online (Sandbox Code Playgroud) 我们有很多回头客,因此我尝试在 WooCommerce 管理订单列表上显示用户生命周期价值(LTV - 所有过去订单的总和),以快速识别最佳用户。
但我什至不知道这是否可能。我有一个自定义专栏来查看是否有回头客,但不知道从哪里开始获得生命周期价值。
我用于标记退货买家的代码:
add_filter( 'manage_shop_order_posts_columns',
'shalior_wc_set_custom_edit_post_columns',99,1 );
function shalior_wc_set_custom_edit_post_columns($columns) {
$columns['is-returning'] = __( 'Is returning?', 'your_text_domain' );
return $columns;
}
add_action( 'manage_shop_order_posts_custom_column' , 'shalior_wc_is_returning', 99, 2 );
function shalior_wc_is_returning( $column, $post_id ) {
switch ( $column ) {
case 'is-returning':
$order = new WC_Order( $post_id );
$user_id = $order->get_user_id();
$orders_count = wc_get_customer_order_count( $user_id );
echo $orders_count > 1 ? '<span style="color: #040404; background: #9ae288;
padding: 3px; padding-left: 12px; padding-right: 12px; border-radius: 3px;">Yes</span>' : "No" ;
break; …Run Code Online (Sandbox Code Playgroud) 在带有下面代码的 WooCommerce 中,我使用随机密码创建新的 WP_User并将用户角色设置为“客户”(我想在购买时自动创建帐户)。然后我WC_Emails用来向买家发送登录详细信息。在那种情况下,我需要简单的密码,但我真的不知道为什么附加所有其他数据(用户名、姓名等),但电子邮件通知中的密码仍然为空。
我的代码是:
// random password with 12 chars
$user_pass = wp_generate_password();
// create new user with email as username & newly created pw
$user_id = wp_create_user( $order_email, $user_pass, $order_email );
$user_id_role = new WP_User($user_id);
$user_id_role->set_role('customer');
$wc = new WC_Emails();
$wc->customer_new_account($user_id, $user_pass);
//WC guest customer identification
update_user_meta( $user_id, 'guest', 'yes' );
update_user_meta( $user_id, 'first_name', $order->billing_first_name );
update_user_meta( $user_id, 'last_name', $order->billing_last_name );
//user's billing data
update_user_meta( $user_id, 'billing_address_1', $order->billing_address_1 );
update_user_meta( $user_id, 'billing_address_2', $order->billing_address_2 ); …Run Code Online (Sandbox Code Playgroud) 我的谷歌开发帐户中只有游戏,我看到很多关于谷歌的应用程序索引最新更新和新功能的嗡嗡声,所以我想问你们这些应用程序索引适用于Android游戏吗?因为我不确切地知道它是如何工作的,但是如果它适用于游戏,那么这个益智游戏还有一个关于ASO和驱动安装的内容.
android ×3
java ×3
woocommerce ×3
wordpress ×3
admob ×2
orders ×2
php ×2
google-play ×1
interstitial ×1
jquery ×1
user-data ×1