boten Active Member Licensed User Longtime User Nov 2, 2011 #1 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: Code: Copy 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?
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: Code: Copy 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?
M magarcan Active Member Licensed User Longtime User Nov 2, 2011 #2 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
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:
Erel B4X founder Staff member Licensed User Longtime User Nov 3, 2011 #3 This should be done with Intents. You should check whether Viber supports intents. Upvote 0
boten Active Member Licensed User Longtime User Nov 3, 2011 #4 can you point to a general example on how to use intents ? (assuming they are supported by Viber) Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Nov 6, 2011 #5 There are many relevant threads: Basic4android Search: intent Upvote 0
boten Active Member Licensed User Longtime User Nov 6, 2011 #6 I got this far by trial & (lots of) error : Code: Copy 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
I got this far by trial & (lots of) error : Code: Copy 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?
thedesolatesoul Expert Licensed User Longtime User Nov 6, 2011 #7 Look into Viber's manifest xml file to see what it exposes. EDIT: or I think PackageManager can also tell you. Last edited: Nov 6, 2011 Upvote 0
Look into Viber's manifest xml file to see what it exposes. EDIT: or I think PackageManager can also tell you.
Erel B4X founder Staff member Licensed User Longtime User Nov 6, 2011 #8 You should check their website. If they support any intents then it should be documented somewhere. Upvote 0
boten Active Member Licensed User Longtime User Nov 6, 2011 #9 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
No documentation on their site and cudn't find any *viber*.xml on my phone (not rooted). How wud PackageManager show the available actions?
thedesolatesoul Expert Licensed User Longtime User Nov 6, 2011 #10 boten said: No documentation on their site and cudn't find any *viber*.xml on my phone (not rooted). How wud PackageManager show the available actions? Click to expand... 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
boten said: No documentation on their site and cudn't find any *viber*.xml on my phone (not rooted). How wud PackageManager show the available actions? Click to expand... 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.