This file contains 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
FirebaseDynamicLinks.getInstance().getDynamicLink(getIntent()) | |
.addOnSuccessListener(this, new OnSuccessListener<PendingDynamicLinkData>() { | |
@Override | |
public void onSuccess(PendingDynamicLinkData data) { | |
if (data == null) { | |
Log.d(TAG, "getInvitation: no data"); | |
return; | |
} | |
Log.d(TAG, "DeepLink: " + data.getLink()); |
This file contains 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
<?php | |
include_once 'FCM.php'; | |
/* | |
$token = array('TOKEN1', 'TOKEN2'); | |
*/ | |
$token = array(); | |
$notification = array( | |
'title' => 'Google I/O 2016', |
This file contains 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
private static final SparseIntArray ORIENTATIONS = new SparseIntArray(); | |
static { | |
ORIENTATIONS.append(Surface.ROTATION_0, 90); | |
ORIENTATIONS.append(Surface.ROTATION_90, 0); | |
ORIENTATIONS.append(Surface.ROTATION_180, 270); | |
ORIENTATIONS.append(Surface.ROTATION_270, 180); | |
} | |
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) | |
private int getRotationCompensation(String cameraId, Activity activity, Context context) |
This file contains 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
Task<FirebaseVisionText> result = detector.detectInImage(image) | |
.addOnSuccessListener(new OnSuccessListener<FirebaseVisionText>() { | |
@Override | |
public void onSuccess(FirebaseVisionText firebaseVisionText) { | |
// Task completed successfully | |
} | |
}) | |
.addOnFailureListener(new OnFailureListener() { | |
@Override | |
public void onFailure(@NonNull Exception e) { |
This file contains 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
Task<List<FirebaseVisionFace>> result = detector.detectInImage(image) | |
.addOnSuccessListener(new OnSuccessListener<List<FirebaseVisionFace>>() { | |
@Override | |
public void onSuccess(List<FirebaseVisionFace> faces) { | |
// Task completed successfully | |
// ... | |
} | |
}) | |
.addOnFailureListener(new OnFailureListener() { | |
@Override |
This file contains 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
for (FirebaseVisionFace face : faces) { | |
Rect bounds = face.getBoundingBox(); | |
float rotY = face.getHeadEulerAngleY(); // Head is rotated to the right rotY degrees | |
float rotZ = face.getHeadEulerAngleZ(); // Head is tilted sideways rotZ degrees | |
// If landmark detection was enabled (mouth, ears, eyes, cheeks, and | |
// nose available): | |
FirebaseVisionFaceLandmark leftEar = face.getLandmark(FirebaseVisionFaceLandmark.LEFT_EAR); | |
if (leftEar != null) { | |
FirebaseVisionPoint leftEarPos = leftEar.getPosition(); |
This file contains 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
Task<List<FirebaseVisionBarcode>> result = detector.detectInImage(image) | |
.addOnSuccessListener(new OnSuccessListener<List<FirebaseVisionBarcode>>() { | |
@Override | |
public void onSuccess(List<FirebaseVisionBarcode> barcodes) { | |
// Task completed successfully | |
// ... | |
} | |
}) | |
.addOnFailureListener(new OnFailureListener() { | |
@Override |
This file contains 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
for (FirebaseVisionBarcode barcode: barcodes) { | |
Rect bounds = barcode.getBoundingBox(); | |
Point[] corners = barcode.getCornerPoints(); | |
String rawValue = barcode.getRawValue(); | |
int valueType = barcode.getValueType(); | |
switch (valueType) { | |
case FirebaseVisionBarcode.TYPE_WIFI: | |
String ssid = barcode.getWifi().getSsid(); | |
String password = barcode.getWifi().getPassword(); |
This file contains 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
Task<List<FirebaseVisionCloudLandmark>> result = detector.detectInImage(image) | |
.addOnSuccessListener(new OnSuccessListener<List<FirebaseVisionCloudLandmark>>() { | |
@Override | |
public void onSuccess(List<FirebaseVisionCloudLandmark> firebaseVisionCloudLandmarks) { | |
// Task completed successfully | |
} | |
}) | |
.addOnFailureListener(new OnFailureListener() { | |
@Override | |
public void onFailure(@NonNull Exception e) { |
This file contains 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
for (FirebaseVisionCloudLandmark landmark: firebaseVisionCloudLandmarks) { | |
Rect bounds = landmark.getBoundingBox(); | |
String landmarkName = landmark.getLandmark(); | |
String entityId = landmark.getEntityId(); | |
float confidence = landmark.getConfidence(); | |
// Multiple locations are possible, e.g., the location of the depicted | |
// landmark and the location the picture was taken. | |
for (FirebaseVisionLatLng loc: landmark.getLocations()) { | |
double latitude = loc.getLatitude(); |