diff --git a/Python/Test.py b/Python/Test.py new file mode 100644 index 0000000..79cb004 --- /dev/null +++ b/Python/Test.py @@ -0,0 +1,2 @@ +import json +print("Hello World!!") \ No newline at end of file diff --git a/app/src/main/java/com/jbvincey/instantappssample/helper/IntentHelper.java b/app/src/main/java/com/jbvincey/instantappssample/helper/IntentHelper.java index 6231169..4a5fdb3 100644 --- a/app/src/main/java/com/jbvincey/instantappssample/helper/IntentHelper.java +++ b/app/src/main/java/com/jbvincey/instantappssample/helper/IntentHelper.java @@ -11,7 +11,7 @@ * Created by jean-baptistevincey on 24/06/2017. */ -public final class IntentHelper { +public final class hfhfhdashldhgklhslgr { private static final String PLAYSTORE_BASE_URL = "market://details?id="; diff --git a/app/src/main/java/com/jbvincey/instantappssample/helper/IntentHelper1.java b/app/src/main/java/com/jbvincey/instantappssample/helper/IntentHelper1.java new file mode 100644 index 0000000..4a5fdb3 --- /dev/null +++ b/app/src/main/java/com/jbvincey/instantappssample/helper/IntentHelper1.java @@ -0,0 +1,68 @@ +package com.jbvincey.instantappssample.helper; + +import android.content.Intent; +import android.net.Uri; + +import com.jbvincey.instantappssample.BuildConfig; +import com.jbvincey.instantappssample.constants.Constants; +import com.jbvincey.instantappssample.model.Coordinates; + +/** + * Created by jean-baptistevincey on 24/06/2017. + */ + +public final class hfhfhdashldhgklhslgr { + + private static final String PLAYSTORE_BASE_URL = "market://details?id="; + + private static final String PACKAGE_MAPS = "com.google.android.apps.maps"; + + private static final String COORDINATES_PREFIX = "geo:0,0?q="; + + private static final String COORDINATES_SEPARATOR = ","; + + private static final String SHARE_INTENT_TYPE = "text/plain"; + + private static final String MAILTO_URI = "mailto:"; + + public static Intent getMapsLocationItent(Coordinates coordinates) { + Uri mapsUri = Uri.parse(buildCoordinatesUri(coordinates)); + Intent mapIntent = new Intent(Intent.ACTION_VIEW, mapsUri); + mapIntent.setPackage(PACKAGE_MAPS); + return mapIntent; + } + + private static String buildCoordinatesUri(Coordinates coordinates) { + return COORDINATES_PREFIX + + coordinates.getLatitude() + + COORDINATES_SEPARATOR + + coordinates.getLongitude(); + } + + public static Intent getContactIntent(String contact) { + Intent intent = new Intent(Intent.ACTION_SENDTO); + intent.setData(Uri.parse(MAILTO_URI)); + intent.putExtra(Intent.EXTRA_EMAIL, new String[]{contact}); + return intent; + } + + public static Intent getShareDetailUrlIntent(String tripId) { + Intent shareIntent = new Intent(Intent.ACTION_SEND); + shareIntent.setType(SHARE_INTENT_TYPE); + shareIntent.putExtra(Intent.EXTRA_TEXT, buildDetailUrl(tripId)); + return shareIntent; + } + + private static String buildDetailUrl(String tripId) { + return Constants.BASE_URL + "/" + tripId; + } + + public static Intent getInstantTripPlayStoreIntent() { + return new Intent(Intent.ACTION_VIEW, buildPlayStoreUrl()); + } + + private static Uri buildPlayStoreUrl() { + return Uri.parse(PLAYSTORE_BASE_URL + BuildConfig.APPLICATION_ID); + } + +}