Trouble with android.intent.action.VIEW

715 views
Skip to first unread message

TruthSpitter

unread,
Oct 18, 2012, 9:08:25 AM10/18/12
to tas...@googlegroups.com
I am trying to send an intent to open my bible app to "today's reading" for my reading plan.  I got the information I need from the developers of the app to do this, but I am failing to get any response when I try it with Tasker.  In tasker I'm using

android.intent.action.VIEW 
Cat: Default
Data: youversion://reading_plan_day?id=60&day=260
Target: Activity

However when I run that task it does nothing.   This java does exactly what I want it to do

Intent in = new Intent();

in.setAction(Intent.ACTION_VIEW);
                    in.setData(Uri.parse("youversion://reading_plan_day?id=60&day=260"));
            
startActivity(in);

so any ideas if I can make this work from Tasker?

Vladimir Oz

unread,
Oct 18, 2012, 9:39:06 AM10/18/12
to tas...@googlegroups.com
try to fill Package field if app doesn't accept broadcast intent

ktmom

unread,
Oct 18, 2012, 9:48:49 AM10/18/12
to tas...@googlegroups.com
I really don't know much about this, just the trial and error I went through to get another app to work.  Using intent designed into that other app, I had to change "Cat: Default" to "Cat: None" and if the app you have has a broadcast receiver then "Target: Activity" should be "Target:Broadcast Receiver"


TruthSpitter

unread,
Oct 18, 2012, 9:59:20 AM10/18/12
to tas...@googlegroups.com
Thank you for the replies.  

Vladimir - What value would I try to use in the package field?

ktmom - I did try Cat: None and that didn't work...I also tried all 3 targets with Cat: Default and that didn't work.

TruthSpitter

unread,
Oct 18, 2012, 10:06:44 AM10/18/12
to tas...@googlegroups.com
I tried com.sirma.mobile.bible.android in the package field and still no success.  That's what I figured you had in mind, but it still did nothing when I ran the task.

Vladimir Oz

unread,
Oct 18, 2012, 10:29:55 AM10/18/12
to tas...@googlegroups.com
Yeap.
The best way is to analyze decompiled with apktool android_manifest.xml of your apk
there you'll find needed intent filter and the appropriate data for fields

четверг, 18 октября 2012 г., 18:06:44 UTC+4 пользователь TruthSpitter написал:

TruthSpitter

unread,
Oct 18, 2012, 11:50:20 AM10/18/12
to tas...@googlegroups.com
Vladmir - When I run this java through a native android app it works perfectly

if (StaticClass.isAppInstalled(HomeActivity.this, "com.sirma.mobile.bible.android")) { 
Intent in = new Intent();   
in.setAction(Intent.ACTION_VIEW); 

in.setData(Uri.parse("youversion://reading_plan_day?id=60&day=260"));  
startActivity(in);
}

Doesn't it reason that it should work with tasker with:

android.intent.action.VIEW 
Cat: Default
Data: youversion://reading_plan_day?id=60&day=260
Target: Activity

or are you saying I still need to find some other values to use to make it work with tasker?

Vladimir Oz

unread,
Oct 18, 2012, 1:31:46 PM10/18/12
to tas...@googlegroups.com
two differences:
1 ACTION_VIEW != VIEW
2. don't know how to set Category in java

I think manifest will help, though

TruthSpitter

unread,
Oct 18, 2012, 2:11:23 PM10/18/12
to tas...@googlegroups.com
I figured it out.  Not sure why, but uninstalling the Bible app and re-installing it made it work with the original settings I posted.  Not really sure why that is, but a buddy suggested it and it sure enough made it work.  Here are some of the other intents you can use with this app in case they help people who find this in the future.

youversion://bible?reference=&version= (version is optional)

For the reference code, you would use exactly what appears on the website. So:

Website shows: ...ps.83.niv84 you would use

youversion://bible?reference=ps.83&version=niv84 (and the version would be optional. If you don't include it it should default to what the user last used).

Here are some additional ones that you can use:

* reading_plans?category= (category optional)
* reading_plan_detail?id= 
* reading_plan_day?id=&day=
* reading_plan_read?id=&day=&position= (position is zero-indexed, meaning 0 is first reading, 1 is second, etc;
* versions?version=
* note?id= 
* live_event?id=

Reply all
Reply to author
Forward
0 new messages