Category:

Calculate month between two dates android

If you want to calculate age in month you can use this method . In this method pass dob year,dob month & dob date. public int monthsBetweenDates(int year, int month, int day) { Calendar dob = Calendar.getInstance(); dob.set(year, month, day); Calendar today = Calendar.getInstance(); int monthsBetween = 0; int dateDiff = today.get(Calendar.DAY_OF_MONTH) – dob.get(Calendar.DAY_OF_MONTH); if […]

Continue Reading
Posted On :
Category:

Share multiple photos whatsapp android

Last updated on August 1st, 2019 at 05:03 pmIn this post I explain to you how to send multiple images on WhatsApp from your android application using simple intent. ArrayList imageUriArray = new ArrayList(); imageUriArray.add(Uri.fromFile(imageFile)); imageUriArray.add(Uri.fromFile(imageFile)); Intent intent = new Intent(); intent.setAction(Intent.ACTION_SEND_MULTIPLE); intent.putExtra(Intent.EXTRA_TEXT, “https://www.trinitytuts.com”); intent.setType(“text/plain”); intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUriArray); intent.setType(“image/jpeg”); intent.setPackage(“com.whatsapp”); startActivity(intent); Above code is very easy […]

Continue Reading
Posted On :
Category:

Get Sha1 key from android studio

Last updated on October 10th, 2016 at 11:48 amHere is simple and shortcut method to get your SHA1 from android. We need SHA1 to verify on some application like Google and Facebook need your SHA1 to generate or verify your application. Follow below step to get your key.  follow bellow simple step as shown in […]

Continue Reading
Posted On :
Category:

Draw path between two points in google map application

ow to open google maps and navigate between two location or between your current location and destination location Here is simple and fast way to done. Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(“http://maps.google.com/maps?saddr=” + latitudes + “,” + longitudes + “&daddr=” + latitude + “,” + longitude)); startActivity(intent); Hope this will help 🙂

Continue Reading
Posted On :
Category:

Share Status on Facebook Android

This tip help you to share some text/link to Facebook from your android application. Copy below code and place where you you want to share no Facebook SDk integration required. String urlToShare = “https://trinitytuts.com”; Intent intent = new Intent(Intent.ACTION_SEND); intent.setType(“text/plain”); // intent.putExtra(Intent.EXTRA_SUBJECT, “Foo bar”); // NB: has no effect! intent.putExtra(Intent.EXTRA_TEXT, urlToShare); // See if official […]

Continue Reading
Posted On :
Category:

Tweet from android app

In this tip i am going to explain you how to post tweet on twitter from your android application. Copy bellow code and paste in your android app where you want to send tweet String tweetUrl = String.format(“https://twitter.com/intent/tweet?text=%s&url=%s”, urlEncode(“My Trinitytuts tweet”), urlEncode(“https://trinitytuts.com”)); Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(tweetUrl)); // arrow down to official Twitter app, […]

Continue Reading
Posted On :
Category:

ToolBar menu with Image,Text and CheckBox

Here is a simple XML menu file in which help to add icon, text and checkbox in your toolbar menu in your android application. <?xml version=”1.0″ encoding=”utf-8″?> <menu xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto”> <!– Settings, should always be in the overflow –> <item android:id=”@+id/action_settings” android:icon=”@drawable/ic_cutlery_white_26_32″ android:title=”” app:showAsAction=”always”> <menu> <group android:checkableBehavior=”all”> <item android:id=”@+id/top” android:checked=”true” android:enabled=”true” android:icon=”@drawable/ic_chef_cap_red_26_32″ android:title=”Cooking Now” app:showAsAction=”always|withText” /> <item android:id=”@+id/bottom” […]

Continue Reading
Posted On :