Help me being lazy

boten

Active Member
Licensed User
Longtime User
Being naturally lazy, I write programs to make my life easier. One daily task is to send fairly fixed SMS to several contacts, so I wrote a small program that sends my SMS to the fixed contacts. Basically it is:

B4X:
Dim smsmsg As PhoneSms
smsmsg.Send("0123456789","my msg here")
... more numbers to send
smsmsg.Send("0987654321","my msg here")

Now I want to save money too. I installed Viber and I wonder if there's a way to interface into Viber for sending SMS.
What I'm looking is the equivalent of Windows VB:

rc = Shell("viber.exe parms")


Any idea how to do that?
 

magarcan

Active Member
Licensed User
Longtime User
Maybe calling Viber as activity and passing phone number and message as parameters... but I don't know if Viber has any activity that allow you to do this.
:signOops:
 
Upvote 0

boten

Active Member
Licensed User
Longtime User
can you point to a general example on how to use intents ? (assuming they are supported by Viber)
 
Upvote 0

boten

Active Member
Licensed User
Longtime User
I got this far by trial & (lots of) error :

B4X:
Dim i As Intent
i.Initialize(i.ACTION_MAIN,"")
i.SetComponent("com.viber.voip/.IdleActivity")
StartActivity(i)

Brings up Viber's main screen.

How can I query the possible actions/activities available under Viber?
How can I pass the parameters for making a call/send sms?
 
Upvote 0

boten

Active Member
Licensed User
Longtime User
No documentation on their site and cudn't find any *viber*.xml on my phone (not rooted).

How wud PackageManager show the available actions?
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
No documentation on their site and cudn't find any *viber*.xml on my phone (not rooted).

How wud PackageManager show the available actions?
For documented intents you may want to contact the developers because they may change support at any time.
PackageManager only gives the intent to start the application, my bad.
You may find more intents in the AndroidManifest.xml file, that is inside the apk file of the app. They are in /data/apps I think, but you need to be rooted to access that area.
 
Upvote 0
Top