Posts

Showing posts from July, 2023

Google Map Intent | Android Studio | Kotlin

Image
How to open Google Maps with directions to a specific location (Latitude, Longitude)? You may have a scenario when you want to open a specific location on Google Maps by clicking a button. In this tutorial, we will input the latitude and longitude and by clicking a button we will open that location in Google Maps. >>Check For Java Complete Code activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http://schemas.android.com/tools" xmlns:app= "http://schemas.android.com/apk/res-auto" android:layout_width= "match_parent" android:layout_height= "match_parent" android:orientation= "vertical" android:gravity= "center" android:padding= "10dp" tools:context= ".MainActivity" > <!--TextView: To show label--> <TextV

Google Map Intent | Android Studio | Java

Image
How to open Google Maps with directions to a specific location (Latitude, Longitude)? You may have a scenario when you want to open a specific location on Google Maps by clicking a button. In this tutorial, we will input the latitude and longitude and by clicking a button we will open that location in Google Maps.  >>Check For Kotlin Complete Code activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http://schemas.android.com/tools" xmlns:app= "http://schemas.android.com/apk/res-auto" android:layout_width= "match_parent" android:layout_height= "match_parent" android:orientation= "vertical" android:gravity= "center" android:padding= "10dp" tools:context= ".MainActivity" > <!--TextView: To show label--> <Te

SMS Intent | Android Studio | Kotlin

Image
SMS Intent: We will use intent to open the sms screen with the phone number the user entered. In this example, we will input a phone number using an input field i.e. EditText, and open that phone number in the sms screen by clicking the button. >>Check For Java Code Snippet: val intent = Intent(Intent.ACTION_VIEW, Uri.parse( "sms:" + Uri.encode(phone))) startActivity(intent) Full Example: activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_parent" android:layout_height= "match_parent" android:gravity= "center" android:orientation= "vertical" android:padding= "10dp" tools:context= ".MainActivity1" >

SMS Intent | Android Studio | Java

Image
SMS Intent: We will use intent to open the sms screen with the phone number the user entered. In this example, we will input a phone number using an input field i.e. EditText, and open that phone number in the sms screen by clicking the button. >>Check For Kotlin Code Snippet: Intent intent = new Intent ( Intent . ACTION_VIEW , Uri . parse ( "sms:" + Uri . encode ( phone ))); startActivity ( intent ); Full Example: activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:app= "http://schemas.android.com/apk/res-auto" xmlns:tools= "http://schemas.android.com/tools" android:layout_width= "match_parent" android:layout_height= "match_parent" android:gravity= "center" android:orientation= "vertical" android:padding= "10dp" tools:context= &quo