Use of Intent to Mail, SMS, MMS and Call

In Sketchware, the uses of Intent activity are limited as it contains only three setAction options: ACTION_VIEW, ACTION_DIAL, and ACTION_CALL.

Here I mention the logic/codes for a few uses of Intent.

1. Open a Url in mobile browser.
  • Intent (name) setAction ACTION_VIEW
  • Intent (name) setData http://xyz.com
  • StartActivity (name)
2. Open mobile contacts.
  • Intent (name) setAction ACTION_VIEW
  • Intent (name) setData content://contacts/people/
  • StartActivity (name)
3. Open mobile dialer.
  • Intent (name) setAction ACTION_DIAL
  • Intent (name) setData tel:894......
  • StartActivity (name)
Also,
  • Intent (name) setAction ACTION_VIEW
  • Intent (name) setData tel:894......
  • StartActivity (name)
4. Call a number.
  • Intent (name) setAction ACTION_CALL
  • Intent (name) setData tel:894......
  • StartActivity (name)
5. Send Email.
  • Intent (name) setAction ACTION_VIEW
  • Intent (name) setData mailto:myname@gmail.com
  • Intent (name) putExtra key subject value write your subject
  • Intent (name) putExtra key body value write your message which is to be mailed
  • StartActivity (name)
6. Send SMS.
  • Intent (name) setAction ACTION_VIEW
  • Intent (name) setData smsto:894......
  • Intent (name) putExtra key sms_body value write your message which is to be sent as sms
  • StartActivity (name)
7. Send MMS.
  • Intent (name) setAction ACTION_VIEW
  • Intent (name) setData mmsto:894......
  • Intent (name) putExtra key subject value write subject of your mms message
  • Intent (name) putExtra key EXTRA_STREAM value /sdcard/Coolpad/Screenshots/Screenshot_2017-07-20-19-03-53.png
  • StartActivity (name)

Note: Replace all underlined items in above codes with your desired values.

There are several other uses of Intent action.

Use of Intent to Share texts and links.

Comments

  1. How do i add progress bar which show loading when i click on anything in my wepsite....for example:-when i click on home loading appears till the next page not appears

    ReplyDelete
    Replies
    1. Add new elements

      webview onPageStarted:
      Textview setText loading...

      webview onPageFinished:
      Textview setText (blank)

      Delete
  2. Smsto:"num_cell" & sms_body = "a message", not working anymore? Any clue? Latest update Sketchware ver.1.6.4

    ReplyDelete
    Replies
    1. This works:
      Intent smsIntent = new Intent(android.content.Intent.ACTION_VIEW);
      smsIntent.setType("vnd.android-dir/mms-sms");
      smsIntent.putExtra("address","your desired phoneNumber");
      smsIntent.putExtra("sms_body","your desired message");
      startActivity(smsIntent);

      Delete
    2. sanjeev that solution is not working in android pie version am getting "No Activity found to handle Intent { act=android.intent.action.VIEW typ=vnd.android-dir/mms-sms (has extras) }" this error

      Delete
  3. How do I get the current gps position to insert in sms_body?

    ReplyDelete
    Replies
    1. hey did you ever get the answer to this? if so send me an email please. settopguy@gmail.com

      Delete
  4. But I want to do a thing like if I press the button we should choose which contact to open and send sms

    ReplyDelete
  5. But I want to do a thing like if I press the button we should choose which contact to open and send sms

    ReplyDelete
  6. How to get language input with intent

    ReplyDelete
  7. How to add special characters in

    Call a number.
    Intent (name) setAction ACTION_VIEW
    Intent (name) setData tel:*#*#...... /*This line*/
    StartActivity (name)

    ReplyDelete
    Replies
    1. intent call =new
      call.setAction(intent.ACTION_CALL);
      call.setData(Uri.parse("tel:"+ Uri.encode("Put The Ussd code here ")));
      startActivity(call);



      Use this

      Delete
  8. Hi, I use the intent mailto: but it works only with gmail then it show also the subject and the body, with the stock email only show the receiver. Why?

    ReplyDelete
  9. Help me how can I get permission massage of inbox to my sketware app.

    ReplyDelete
  10. I have allot of questions about the app that i dont get it where can i post my questions?

    ReplyDelete
  11. hello, in my web app I want to open fb page link in fb if facebook app is not installed then it should open in browser.. how can I do it...

    ReplyDelete
  12. hello how can i make a call from a number in fierbase

    ReplyDelete
  13. Seems new version of sketchware prevent to paste text into subject and body. Did anyone experiment same? Welcoming support.

    ReplyDelete
  14. How can we use brBroadcastReceive for detecting incomming calls

    ReplyDelete
  15. Any idea to automatically send an email? Like without having to click "send" manually and so on?

    Please send me the answer, if found, to markus.beyer10969@web.de , would really appreciate the effort.

    ReplyDelete
    Replies
    1. did you get it bro? please help me too

      Delete
    2. very sympol. put the intent blocks in "on activitie create". when any body open your app just automatic you will enjoy it

      Delete
  16. I want to hide phone number. I want to show sms body and sent button. How to do sir?

    ReplyDelete
  17. how can i add the symbol # ( hash )

    ReplyDelete
  18. Please directory app to button click contact save view code..

    ReplyDelete
  19. Ola! Como faço para criar um chat em grupo pelo Sketchware? Aguardando pelo obsequio.

    ReplyDelete
  20. I'm trying to create my own Aap or link but I can't.
    Please help me out.

    ReplyDelete
  21. It's a kindly request to you reply as soon as.
    Thanku.

    ReplyDelete
  22. Hello this error occurred
    Invalid intent operation: No activity found to handle intent {act=android.intent.action.VIEW dat=mailto:my@example.com}

    ReplyDelete
  23. How i can sending email without compose gmail interaction or intervention

    ReplyDelete

Post a Comment

Popular posts from this blog

A Flash Light App in Sketchware

Create Music Player app in Sketchware

Simple car racing android game in Sketchware

In Sketchware: How to create a calculator for any simple formula?

Firebase auth in Sketchware for Login Activity