This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ublic static final String NEW_LIFEFORM_DETECTED = | |
| “com.paad.action.NEW_LIFEFORM”; | |
| Intent intent = new Intent(LifeformDetectedReceiver.NEW_LIFEFORM); | |
| intent.putExtra(LifeformDetectedReceiver.EXTRA_LIFEFORM_NAME, | |
| detectedLifeform); | |
| intent.putExtra(LifeformDetectedReceiver.EXTRA_LONGITUDE, | |
| currentLongitude); | |
| intent.putExtra(LifeformDetectedReceiver.EXTRA_LATITUDE, | |
| currentLatitude); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try { | |
| //replace package name with your package | |
| PackageInfo info = getPackageManager().getPackageInfo( | |
| "com.cp.app.checkpoint", | |
| PackageManager.GET_SIGNATURES); | |
| for (Signature signature : info.signatures) { | |
| MessageDigest md = MessageDigest.getInstance("SHA"); | |
| md.update(signature.toByteArray()); | |
| Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (somethingWeird && itDontLookGood) { | |
| // Create the impliciy Intent to use to start a new Activity. | |
| Intent intent = | |
| new Intent(Intent.ACTION_DIAL, Uri.parse(“tel:555-2368”)); | |
| // Check if an Activity exists to perform this action. | |
| PackageManager pm = getPackageManager(); | |
| ComponentName cn = intent.resolveActivity(pm); | |
| if (cn == null) { | |
| // If there is no Activity available to perform the action |
NewerOlder