1. Web development
  2. Machine Learning
  3. Cryptography
  4. Games
  5. Data Structure
  6. Data Science
  7. Computer Vision
  8. Artificial intelligence
  9. Web Application
  10. Web crawler
  11. Business Application
  12. GUI Based Desktop Application
  13. Mobile Application
  14. Web frameworks

How to send SMS from android using java programming

Photo by Daria Nepriakhina on Unsplash

Step 1: Add Permissions to the Manifest File and OnCreate Method of Activity. If you are dealing with fragment you must add it to OnCreateView Method.

Code Snippet for Manifest File

First you need to declare these variables on top of the activity or fragment class

private static final int REQUEST_SMS = 0;private static final int REQ_PICK_CONTACT = 2;private BroadcastReceiver sentStatusReceiver, deliveredStatusReceiver;

<uses-permission android:name=”android.permission.SEND_SMS”/>

Code Snippet for OnCreate or OnCreateView method

if (ContextCompat.checkSelfPermission(getActivity(), SEND_SMS)        != PackageManager.PERMISSION_GRANTED){    ActivityCompat.requestPermissions(getActivity(), new String [] {SEND_SMS},            1);}

Step 2:

In the this…


Photo by Henrik Dønnestad on Unsplash

Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, create a Blank Activity and click on Finish button.
Step 2 : Open res -> layout ->activity_main.xml and add following code :

< RelativeLayout xmlns : android = “http://schemas.android.com/apk/res/android"

xmlns : tools = “http://schemas.android.com/tools"

android : layout_width = “match_parent”

android : layout_height = “match_parent”

android : paddingBottom = “@dimen/activity_vertical_margin”

android : paddingLeft = “@dimen/activity_horizontal_margin”

android : paddingRight = “@dimen/activity_horizontal_margin”

android : paddingTop = “@dimen/activity_vertical_margin”

tools : context =”com.saud.listview_listactivity.MainActivity” >

< ListView

android : id = “@+id/list”

android : layout_width = “match_parent”

android : layout_height…


Photo by Glenn Carstens-Peters on Unsplash

Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, create a Blank Activity and click on Finish button.
Step 2 : Open res -> layout ->activity_main.xml and add following code :

< RelativeLayout xmlns : android = “http://schemas.android.com/apk/res/android"

xmlns : tools = “http://schemas.android.com/tools"

android : layout_width = “match_parent”

android : layout_height = “match_parent”

android : paddingBottom = “@dimen/activity_vertical_margin”

android : paddingLeft = “@dimen/activity_horizontal_margin”

android : paddingRight = “@dimen/activity_horizontal_margin”

android : paddingTop = “@dimen/activity_vertical_margin”

tools : context =”com.saud.android.listview_customarrayadapter.MainActivity”>

< ListView

android : id = “@+id/listView1”

android : layout_width = “match_parent”

android : layout_height =…


Photo by Muhammad Rosyid Izzulkhaq on Unsplash

Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, create a Blank Activity and click on Finish button.
Step 2 : Open res -> layout ->activity_main.xml and add following code :

< RelativeLayout xmlns : android = “http://schemas.android.com/apk/res/android"

xmlns : tools = “http://schemas.android.com/tools"

android : layout_width = “match_parent”

android : layout_height = “match_parent”

android : paddingBottom = “@dimen/activity_vertical_margin”

android : paddingLeft = “@dimen/activity_horizontal_margin”

android : paddingRight = “@dimen/activity_horizontal_margin”

android : paddingTop = “@dimen/activity_vertical_margin”

tools : context =”com.skholingua.android.listfragment.MainActivity” >

< fragment

android : id = “@+id/fragment1”

android : name =”com.skholingua.android.listfragment.MyListFragment”

android : layout_width =…


About understanding of Activity Life Cycle in Android Studio

Activity life cycle
Photo by Tolga Ulkan on Unsplash

Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, create a Blank Activity and click on Finish button.

Step 2 : Open res -> layout ->activity_main.xml and add following code :

< RelativeLayout xmlns : android = “http://schemas.android.com/apk/res/android"

xmlns : tools = “http://schemas.android.com/tools"

android : layout_width = “match_parent”

android : layout_height = “match_parent” >

< TextView

android : layout_width = “wrap_content”

android : layout_height = “wrap_content”

android : text = “@string/hello_world” / >

< / RelativeLayout >

Step 3 : Open src -> package…


Python 2 vs Python 3
Python 2 vs Python 3

Difference between Python 2 and Python 3


TOP PRODUCTS OF THE GOOGLE

  1. Google Play also branded as the Google Play Store and formerly Android Market, is a digital distribution service operated and developed by Google. Wikipedia

Date launched: October 22, 2008

Initial release: October 22, 2008; 12 years ago (as Android Market); March 6, 2012; 9 years ago (as Google Play)

Platforms: AndroidChrome OSAndroid TVWear OSWeb applicationAndroid Automotive

2. Google Earth is a computer program, formerly known as Keyhole EarthViewer, that renders a 3D representation of Earth based primarily on satellite imagery. Wikipedia

Preview release: WindowsmacOSLinux; 7.3.3 …


package com.saud_khan_dev.speed_test.backend.services;

import android.app.IntentService;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Icon;
import android.net.TrafficStats;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;

import androidx.annotation.RequiresApi;
import androidx.core.app.NotificationCompat;

import com.saud_khan_dev.speed_test.MyApp;
import com.saud_khan_dev.speed_test.PrefHelper.AppSharedPref;
import com.saud_khan_dev.speed_test.R;
import com.saud_khan_dev.speed_test.ui.activities.MainActivity;

import java.util.Locale;

/**
* Author: Muhammad Saud khan
*/

public class
SpeedMonitorService extends IntentService {

private final int mNotificationId = 1;
private Handler mHandler;
private Notification.Builder mBuilder;
private NotificationManager mNotifyMgr;
private String mDownloadSpeedOutput;
private String mUnits;
private boolean mDestroyed = false;
AppSharedPref pref;
public SpeedMonitorService() {…

Internet connectivity broadcast receiver

NetworkUtills

package com.saud_khan_dev.speed_test.backend.network_utills;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class NetworkUtil {
public static final int TYPE_WIFI = 1;
public static final int TYPE_MOBILE = 2;
public static final int TYPE_NOT_CONNECTED = 0;
public static final int NETWORK_STATUS_NOT_CONNECTED = 0;
public static final int NETWORK_STATUS_WIFI = 1;
public static final int NETWORK_STATUS_MOBILE = 2;

public static int getConnectivityStatus(Context context) {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);

NetworkInfo activeNetwork =…

CodingwithSaud

I’m a good husband, father and Senior Developer.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store