MessagingStyle
setShowWhen(true)
NotificationCompat.Builder
RemoteViews
DecoratedCustomViewStyle
DecoratedMediaCustomViewStyle
setCustomContentView()
Activity
Service
BroadcastReceiver
RemoteInput
Action
// Where should direct replies be put in the intent bundle (can be any string) private static final String KEY_TEXT_REPLY = "key_text_reply"; // Create the RemoteInput specifying this key String replyLabel = getString(R.string.reply_label); RemoteInput remoteInput = new RemoteInput.Builder(KEY_TEXT_REPLY) .setLabel(replyLabel) .build();
addRemoteInput()
setAllowGeneratedReplies(true)
// Add to your action, enabling Direct Reply for it NotificationCompat.Action action = new NotificationCompat.Action.Builder(R.drawable.reply, replyLabel, pendingIntent) .addRemoteInput(remoteInput) .setAllowGeneratedReplies(true) .build();
pendingIntent
RemoteInput.getResultsFromIntent()
private CharSequence getMessageText(Intent intent) { Bundle remoteInput = RemoteInput.getResultsFromIntent(intent); if (remoteInput != null) { return remoteInput.getCharSequence(KEY_TEXT_REPLY); } return null; }
setRemoteInputHistory()
addMessage()
builder.setStyle(new NotificationCompat.MessagingStyle("Me") .setConversationTitle("Team lunch") .addMessage("Hi", timestampMillis1, null) // Pass in null for user. .addMessage("What's up?", timestampMillis2, "Coworker") .addMessage("Not much", timestampMillis3, null) .addMessage("How about lunch?", timestampMillis4, "Coworker"));
BigTextStyle
setGroup()
setGroupSummary(true)
InboxStyle
NotificationCompat
SomeClass.getInstance("SomeAlgorithm", "SomeProvider");
SomeClass.getInstance("SomeAlgorithm");
Cipher.getInstance(“AES/CBC/PKCS5PADDING”); SecureRandom.getInstance(“SHA1PRNG”);
SecretKey key = new SecretKeySpec(keyBytes, "AES");
/* User types in their password: */ String password = "password"; /* Store these things on disk used to derive key later: */ int iterationCount = 1000; int saltLength = 32; // bytes; should be the same size as the output (256 / 8 = 32) int keyLength = 256; // 256-bits for AES-256, 128-bits for AES-128, etc byte[] salt; // Should be of saltLength /* When first creating the key, obtain a salt with this: */ SecureRandom random = new SecureRandom(); byte[] salt = new byte[saltLength]; random.nextBytes(salt); /* Use this to derive the key from the password: */ KeySpec keySpec = new PBEKeySpec(password.toCharArray(), salt, iterationCount, keyLength); SecretKeyFactory keyFactory = SecretKeyFactory .getInstance("PBKDF2WithHmacSHA1"); byte[] keyBytes = keyFactory.generateSecret(keySpec).getEncoded(); SecretKey key = new SecretKeySpec(keyBytes, "AES");
InsecureSHA1PRNGKeyDerivator
private static SecretKey deriveKeyInsecurely(String password, int keySizeInBytes) { byte[] passwordBytes = password.getBytes(StandardCharsets.US_ASCII); return new SecretKeySpec( InsecureSHA1PRNGKeyDerivator.deriveInsecureKey( passwordBytes, keySizeInBytes), "AES"); }
「私たちは、Kochava を最高のツールの一部として活用していただくことを通して、デベロッパーの皆様のお役に立ちたいと常に願っています。Firebase を活用した私たちの Google タグ マネージャのサポートはすぐにご利用いただけます。このようなサポートを提供できることをとてもうれしく思っています」 - Kochava CEO、Charles Manning
externalNativeBuild