Seek help for receiving intent code.

48 views
Skip to first unread message

Rajesh Pardhan

unread,
Mar 29, 2018, 7:56:10 AM3/29/18
to DroidScript
Tried all available example codes to create an activity that receive file open intent (.txt or .html, .jpg etc.). Huh.. proudly say " failed".

Can any one help with a function for the purpose?

Dave

unread,
Mar 29, 2018, 11:16:28 AM3/29/18
to DroidScript
Hi Rajesh,

If working in the IDE, then copy the "Shared Data" example and un-comment the line that says app.SetSharedApp( "My AppName" ) and change it to the name of your app and save the code.  Don't run your app, but just switch to a file explorer and open a .txt file or .jpg file and choose DroidScript as the target app when prompted.  You should then see your app launched and the path of the chosen file displayed in the lower text box.

When building an APK, you need to create a build.json file to allow your app to handle your chosen file types.  Search for 'pathPattern' on this forum to see how to do that.

Regards
David


Rajesh Pardhan

unread,
Apr 2, 2018, 11:37:10 AM4/2/18
to DroidScript
thank you sir
Reply all
Reply to author
Forward
0 new messages