[LAMW] is it possible sending key to another android app lazarus / 43-Android ---------------------------------------------------------------------- Mongkey · 2021-02-28 03:15 Any idea? ---------------------------------------------------------------------- ASBzone · 2021-02-28 03:54 You may need to be a bit more verbose in what you are requesting, and what you are already experiencing when you try to accomplish it. ---------------------------------------------------------------------- Mongkey · 2021-02-28 12:31 I just want to send / inject whatsapp activity with enter key, after opening whatsapp intent, so the message automatically sent without touching send button. ---------------------------------------------------------------------- Mongkey · 2021-02-28 12:36 I want to integrate whatsapp, as appointment reminder by sending whatsapp message automatically without doing 1 by 1 . Thank you for your reply ABSzone. This screenshots are what i did so far with awesome LAMW. ---------------------------------------------------------------------- jmpessoa · 2021-02-28 17:33 Hi, Mongkey... Look for some pure java/android example and you will learn what intent parameters you need.... ---------------------------------------------------------------------- Mongkey · 2021-03-01 00:29 all i did just learning from LAMW samples, pure java just like an alien for me  , opening WA intent -> put some text -> start intent -> pressing OK, i just need set auto pressing for OK/ENTER button, (hi hi hi, this just like what appium do) Thanks for your reply JMPessoa, I found many intent parameters here: https://github.com/aosp-mirror/platform_frameworks_base/blob/master/co re/res/AndroidManifest.xml#L2515 I think i need more coffee to accomplish this, for pull stuck type programmer like me, thank you. ---------------------------------------------------------------------- Segator · 2021-03-01 15:29 Hi, Mongkey, i think that you need an special android 8.0> function that interact with touch screen, this require special permission and is not recomended for securoty reason, try to find the correct Intent params to do that like @jmpessoa say, this is an java example from https://stackoverflow.com/questions/19081654/send-text-to-specific- contact-programmatically-whatsapp Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i PackageManager packageManager = context.getPackageManager();    Intent i = new Intent(Intent.ACTION_VIEW);     try {        String url = "https://api.whatsapp.com/send?phone="+ phone +"&text=" + URLEncoder.encode(message, "UTF-8");        i.setPackage("com.whatsapp");        i.setData(Uri.parse(url));      if (i.resolveActivity(packageManager) != null) {            context.startActivity(i);        }    } catch (Exception e){        e.printStackTrace();    }  and you can adapt to the pascal lamw way like this (not tested): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TAndroidModule1.jButton1Click(Sender: TObject);var  phone,message:string;begin  phone:='12345678';  message:='I am the body.';  jIntentManager1.SetAction(iaSENDTO);  jIntentManager1.SetData Uri(self.ParseUri('https://api.whatsapp.com/send?phone='+ phone +'&text=' + self.UriEncode(message)));  jIntentManager1.SetDataAndType (self.ParseUri('https://api.whatsapp.com/send?phone='+ phone +'&text=' + self.UriEncode(message)),'text/plain');  jIntentManager1.SetPackage('com.whatsapp');  jIntentManager1.StartActivity()end; ---------------------------------------------------------------------- Mongkey · 2021-03-02 00:18 thanks, segator, IaSENDTO not working on my android 10 handset, only IaVIEW does the job, am i missing something? IaSEND working code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  phone,message:string;begin  phone:='62123456';  message:='I am the body.';  if jIntentManager1.IsPackageInstalled('com.whatsapp') then  begin      jIntentManager1.SetPackage('com.whatsapp');      jIntentManager1.SetAction(IaSEND);      jIntentManager1.SetMimeType('text/plain');      jIntentManager1.SetFlag(ifActivityNewTask);      jIntentManager1.PutExtraText(message);      //jIntentManager1.SetDataU ri(self.ParseUri('https://api.whatsapp.com/send?phone='+ phone +'&text=' + self.UriEncode(message)));      //jIntentManager1.PutExtraString('Jid', phone +'@s.whatsapp.net');     jIntentManager1.StartActivity()  end