使用 Tasker 将文件发送到有意图的应用程序
Send file to app with intents using Tasker
使用应用 "Total Commander"(Link) I can select a .csv file and 'Open with' my selected app, "My Budget Book" (Link - 付费应用)。这会打开应用程序并提示用户是否要导入数据。我试图这样做,而不是从 Tasker。
有一点我觉得很奇怪,我不能从我的股票 (Samsung S8+) 文件资源管理器中做到这一点?
tl;dr 我需要帮助重新创建将文件共享到我的预算簿以供导入的意图。
我联系了 "My Budget Book" 的开发者,他们给了我这个:
ImportCsvActivity:
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:mimeType="text/csv"
android:pathPattern=".*\.csv"
android:scheme="content"
tools:ignore="AppLinkUrlError"/>
<data
android:mimeType="text/csv"
android:pathPattern=".*\.CSV"
android:scheme="content"
tools:ignore="AppLinkUrlError"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="*"
android:mimeType="*/*"
android:pathPattern=".*\.csv"
android:scheme="file"/>
<data
android:host="*"
android:mimeType="*/*"
android:pathPattern=".*\.CSV"
android:scheme="file"/>
</intent-filter>
我一直在尝试使用 Tasker Java 操作在线遵循指南,但到目前为止我最多只能在 'Import CSV' 页面上启动应用程序,但它不会提示导入。
使用 "Intent Intercept" (Link) 我明白了:
intent:///storage/emulated/0/My%20Budget%20Book/TaskerImport_1584702040.csv#Intent;scheme=file;type=text/comma-separated-values;launchFlags=0x13100000;end
------------
ACTION: android.intent.action.VIEW
DATA: file:///storage/emulated/0/My%20Budget%20Book/TaskerImport_1584702040.csv
MIME: text/comma-separated-values
URI: intent:///storage/emulated/0/My%20Budget%20Book/TaskerImport_1584702040.csv#Intent;scheme=file;type=text/comma-separated-values;launchFlags=0x13100000;end
FLAGS:
FLAG_RECEIVER_FOREGROUND
FLAG_ACTIVITY_FORWARD_RESULT
FLAG_ACTIVITY_PREVIOUS_IS_TOP
FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY
------------
MATCHING ACTIVITIES:
Excel (com.microsoft.office.excel - com.microsoft.office.excel.excelMainActivity)
anWriter free (com.ansm.anwriter - com.ansm.anwriter.MainActivityFree)
Totalcmd-Editor (com.ghisler.android.TotalCommander - com.ghisler.android.TotalCommander.TCEditActivity)
Sheets (com.google.android.apps.docs.editors.sheets - com.google.android.apps.docs.editors.trix.quicksheet.QuickSheetDocumentOpenerActivityAlias)
CSV import (com.onetwoapps.mh - com.onetwoapps.mh.ImportCsvActivity)
QuickEdit (com.rhmsoft.edit - com.rhmsoft.edit.activity.MainActivity)
我当前的任务:
Intent Testing (13)
A1: Java Function [ Return:theIntent Class Or Object:Intent Function:new
{Intent} () Param:Intent.ACTION_SEND Param: Param: Param: Param: Param: Param: ]
A2: Java Function [ Return: Class Or Object:theIntent Function:setAction
{Intent} (String) Param:android.intent.action.VIEW Param: Param: Param: Param: Param: Param: ]
A3: Java Function [ Return: Class Or Object:theIntent Function:setClassName
{Intent} (String, String) Param:com.onetwoapps.mh Param:com.onetwoapps.mh.ImportCsvActivity Param: Param: Param: Param: Param: ]
A4: Java Function [ Return: Class Or Object:theIntent Function:addFlags
{Intent} (int) Param:theIntent.FLAG_ACTIVITY_NEW_TASK Param: Param: Param: Param: Param: Param: ]
A5: Java Function [ Return:parsedurl Class Or Object:Uri Function:parse
{Uri} (String) Param:file:///My Budget Book/TaskerImport_1584702040.csv Param: Param: Param: Param: Param: Param: ]
A6: Java Function [ Return: Class Or Object:theIntent Function:putExtra
{Intent} (String, Parcelable) Param:android.intent.extra.STREAM Param:parsedurl Param: Param: Param: Param: Param: ]
A7: Java Function [ Return: Class Or Object:CONTEXT Function:startActivity
{} (Intent) Param:theIntent Param: Param: Param: Param: Param: Param: ]
编辑:我需要帮助重新创建将 Tasker 生成的文件共享到我的预算簿以供导入的意图。
非常感谢任何帮助,谢谢!
使用 Tasker ADB Wifi 操作解决:
am start -a android.intent.action.VIEW -d file://%filepath -t text/comma/separated-values -n come.onetwoapps.mh/.ImportCsvActivity
文件路径名中的'Spaces'需要转换为'%20'
使用应用 "Total Commander"(Link) I can select a .csv file and 'Open with' my selected app, "My Budget Book" (Link - 付费应用)。这会打开应用程序并提示用户是否要导入数据。我试图这样做,而不是从 Tasker。
有一点我觉得很奇怪,我不能从我的股票 (Samsung S8+) 文件资源管理器中做到这一点?
tl;dr 我需要帮助重新创建将文件共享到我的预算簿以供导入的意图。
我联系了 "My Budget Book" 的开发者,他们给了我这个:
ImportCsvActivity:
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:mimeType="text/csv"
android:pathPattern=".*\.csv"
android:scheme="content"
tools:ignore="AppLinkUrlError"/>
<data
android:mimeType="text/csv"
android:pathPattern=".*\.CSV"
android:scheme="content"
tools:ignore="AppLinkUrlError"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="*"
android:mimeType="*/*"
android:pathPattern=".*\.csv"
android:scheme="file"/>
<data
android:host="*"
android:mimeType="*/*"
android:pathPattern=".*\.CSV"
android:scheme="file"/>
</intent-filter>
我一直在尝试使用 Tasker Java 操作在线遵循指南,但到目前为止我最多只能在 'Import CSV' 页面上启动应用程序,但它不会提示导入。
使用 "Intent Intercept" (Link) 我明白了:
intent:///storage/emulated/0/My%20Budget%20Book/TaskerImport_1584702040.csv#Intent;scheme=file;type=text/comma-separated-values;launchFlags=0x13100000;end
------------
ACTION: android.intent.action.VIEW
DATA: file:///storage/emulated/0/My%20Budget%20Book/TaskerImport_1584702040.csv
MIME: text/comma-separated-values
URI: intent:///storage/emulated/0/My%20Budget%20Book/TaskerImport_1584702040.csv#Intent;scheme=file;type=text/comma-separated-values;launchFlags=0x13100000;end
FLAGS:
FLAG_RECEIVER_FOREGROUND
FLAG_ACTIVITY_FORWARD_RESULT
FLAG_ACTIVITY_PREVIOUS_IS_TOP
FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY
------------
MATCHING ACTIVITIES:
Excel (com.microsoft.office.excel - com.microsoft.office.excel.excelMainActivity)
anWriter free (com.ansm.anwriter - com.ansm.anwriter.MainActivityFree)
Totalcmd-Editor (com.ghisler.android.TotalCommander - com.ghisler.android.TotalCommander.TCEditActivity)
Sheets (com.google.android.apps.docs.editors.sheets - com.google.android.apps.docs.editors.trix.quicksheet.QuickSheetDocumentOpenerActivityAlias)
CSV import (com.onetwoapps.mh - com.onetwoapps.mh.ImportCsvActivity)
QuickEdit (com.rhmsoft.edit - com.rhmsoft.edit.activity.MainActivity)
我当前的任务:
Intent Testing (13)
A1: Java Function [ Return:theIntent Class Or Object:Intent Function:new
{Intent} () Param:Intent.ACTION_SEND Param: Param: Param: Param: Param: Param: ]
A2: Java Function [ Return: Class Or Object:theIntent Function:setAction
{Intent} (String) Param:android.intent.action.VIEW Param: Param: Param: Param: Param: Param: ]
A3: Java Function [ Return: Class Or Object:theIntent Function:setClassName
{Intent} (String, String) Param:com.onetwoapps.mh Param:com.onetwoapps.mh.ImportCsvActivity Param: Param: Param: Param: Param: ]
A4: Java Function [ Return: Class Or Object:theIntent Function:addFlags
{Intent} (int) Param:theIntent.FLAG_ACTIVITY_NEW_TASK Param: Param: Param: Param: Param: Param: ]
A5: Java Function [ Return:parsedurl Class Or Object:Uri Function:parse
{Uri} (String) Param:file:///My Budget Book/TaskerImport_1584702040.csv Param: Param: Param: Param: Param: Param: ]
A6: Java Function [ Return: Class Or Object:theIntent Function:putExtra
{Intent} (String, Parcelable) Param:android.intent.extra.STREAM Param:parsedurl Param: Param: Param: Param: Param: ]
A7: Java Function [ Return: Class Or Object:CONTEXT Function:startActivity
{} (Intent) Param:theIntent Param: Param: Param: Param: Param: Param: ]
编辑:我需要帮助重新创建将 Tasker 生成的文件共享到我的预算簿以供导入的意图。
非常感谢任何帮助,谢谢!
使用 Tasker ADB Wifi 操作解决:
am start -a android.intent.action.VIEW -d file://%filepath -t text/comma/separated-values -n come.onetwoapps.mh/.ImportCsvActivity
文件路径名中的'Spaces'需要转换为'%20'