Search code examples
androidbitmapsmsscreenshot

How send a bitmap in SMS?


I have tried to send a text to a phone number by using below code. Now I want to send a screenshot of the screen to the mobile number on button click.

  public class MainActivity extends AppCompatActivity {
Button send;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
send= (Button) findViewById(R.id.send);
    send.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            smssend("03006110857","hi");
        }
    });




}
public void smssend(String phoneno,String msg){
try {
    SmsManager smsManager=SmsManager.getDefault();
    smsManager.sendTextMessage(phoneno,null,msg,null,null);
    Toast.makeText(this, "msg send", Toast.LENGTH_SHORT).show();

    }catch (Exception e)
{

    Toast.makeText(this, e.getMessage().toString(), Toast.LENGTH_SHORT).show();

}

}


Solution

  • May be this library will help you.

    https://github.com/klinker41/android-smsmms