B4J Question some thing like intent for b4j

ArminKH

Well-Known Member
hi in b4a we can call some intents which are a part of an app like this
B4X:
Sub OpenOurTelegram
    Private BTIntent   As Intent
        BTIntent.Initialize(BTIntent.ACTION_VIEW, "https://telegram.me/uniazadanzali")
        BTIntent.SetComponent("org.telegram.messenger/org.telegram.ui.LaunchActivity")
        StartActivity(BTIntent)      
End Sub
when i call this sub the Telegram app is lunched and then my channel is opened
but what about b4j? we have also telegram desktop app and i want to lunch it and raise my channel
is there any way to achieve to it?
i know intents are a part of android api so i'm looking for some thing just like that maybe shell scripts etc,...
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Seems that you are searching for jshell library to start an external program.
 
Upvote 0

ArminKH

Well-Known Member
Seems that you are searching for jshell library to start an external program.
yes but i want to raise internal intent of telegram app
for example the package name for telegram is "org.telegram.messenger"
but i want to raise this intent directly "org.telegram.messenger/org.telegram.ui.LaunchActivity"
i'm not familiar with shell commands at all
 
Upvote 0

ArminKH

Well-Known Member
i dont know maybe like this code but it is not works
B4X:
   Dim shl As Shell
   shl.Initialize("shl", "java", _
     Array As String("-cp", "Telegram.exe", "org.telegram.messenger/org.telegram.ui.LaunchActivity", "https://telegram.me/uniazadanzali"))
   shl.WorkingDirectory = "C:\Users\LOVE\Desktop"
   shl.Run(10000) 'set a timeout of 10 seconds
 
Upvote 0

ArminKH

Well-Known Member
@DonManfred
this code will raise Telegram.exe
B4X:
Dim shl As Shell
        shl.Initialize("shl", "C:\Users\LOVE\AppData\Roaming\Telegram Desktop\Telegram.exe", Null)
        shl.WorkingDirectory = "C:\Users\LOVE\AppData\Roaming\Telegram Desktop"
        shl.Run(10000)
but how to raise channel intent?
 
Upvote 0

ArminKH

Well-Known Member
if you know.. it needs to be place in the parameters of the call (null in your example)
yes,the problem is this "org.telegram.messenger/org.telegram.ui.LaunchActivity"
which should changed with desktop codes
 
Upvote 0
Top