我通过阅读官方说明实施了Google许可检查程序.
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.IBinder;
import android.provider.Settings.Secure;
import android.widget.Toast;
import com.google.android.vending.licensing.AESObfuscator;
import com.google.android.vending.licensing.LicenseChecker;
import com.google.android.vending.licensing.LicenseCheckerCallback;
import com.google.android.vending.licensing.ServerManagedPolicy;
public class Splash extends Activity {
MyLicenseCheckerCallback mLicenseCheckerCallback;
LicenseChecker mChecker;
byte[] SALT = new byte[] { -73, 95, 70, -126, -103, -57, 14, -46, 51, 88, -5,
-60, 77, -88, -63, -13, -1, 82, -4, 9 };
//Handler mHandler;
String BASE64_PUBLIC_KEY="My base key";
Context mContext;
IBinder serviceBinder;
String deviceId; …
Run Code Online (Sandbox Code Playgroud) 我想实现安装引用跟踪并希望引用参数和存储在后端数据库中我已经看到许多例子或问题,如获取Android Google Analytics引用标记或Android Google Analytics广告系列跟踪未显示但没有获得我生成链接的方式去尝试代码
package SimpleDemo.ReferralTrack;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.Map;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
public class ReferralReceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
// Workaround for Android security issue: http://code.google.com/p/android/issues/detail?id=16006
try
{
final Bundle extras = intent.getExtras();
if (extras != null) {
extras.containsKey(null);
}
}
catch (final Exception e) {
return;
}
Map<String, String> referralParams = new HashMap<String, String>();
// …
Run Code Online (Sandbox Code Playgroud) 我正在使用 Google Wallet Instant Buy, 按照此处给出的描述和 Google 提供的示例以及 Android SDK 在此路径或类似路径D:\android-sdk-windows\extras\google\google_play_services\samples\wallet(根据 SDK)显示在您的电脑上。
我成功运行了该应用程序并在我的应用程序中实现了相同的功能,并且它在沙盒模式下运行良好
现在我必须进入应用程序的最后阶段才能将其发布到游戏商店中,我需要将沙盒模式更改为生产模式,以便我们可以进行实时交易(购买)。
据我理解代码并得到我需要更改的内容,我已在特定类中进行了如下所示的更改
课程
常量.类
// 创建 WalletClient 实例时使用的环境
public static final int WALLET_ENVIRONMENT = WalletConstants.ENVIRONMENT_SANDBOX;
Run Code Online (Sandbox Code Playgroud)
取而代之
public static final int WALLET_ENVIRONMENT = WalletConstants.ENVIRONMENT_PRODUCTION;
Run Code Online (Sandbox Code Playgroud)LoginFragment.class
private static final String WALLET_SANDBOX_SCOPE ="https://www.googleapis.com/auth/paymentssandbox.make_payments";
Run Code Online (Sandbox Code Playgroud)
取而代之
private static final String WALLET_SANDBOX_SCOPE ="https://www.googleapis.com/auth/payments.make_payments";
Run Code Online (Sandbox Code Playgroud)所有类均在 GOOGLE 提供的示例中给出,并 根据您电脑上的 SDK 位于D:\android-sdk-windows\extras\google\google_play_services\samples\wallet位置。
我已经在我的应用程序中直接使用了它,并进行了必要的包更改和其他设计相关的更改。
我已经按照此处给出的说明完成了所有必需的设置Android Google Wallet Integration
由于我必须在生产模式下工作,所以我使用Sign APK Keystore创建了客户端 id 和 Android 密钥。 …