Skip to first unread message

Roberto Grasso

unread,
Aug 21, 2016, 6:25:49 AM8/21/16
to mitappinv...@googlegroups.com
Hello everyone,

Hope this message finds you all well.

Can someone please help showing some actual example on how to setup an activity starter to retreive multiple files (images) accordingly?

Thank you so much for your help and support.

Kind Regards,
Roberto

Ghica

unread,
Aug 21, 2016, 8:51:10 AM8/21/16
to MIT App Inventor Forum
Why do you need an activity starter? Maybe this example can help: http://puravidaapps.com/filebyfile.php
Cheers, Ghica.

Roberto Grasso

unread,
Aug 21, 2016, 9:01:44 AM8/21/16
to MIT App Inventor Forum
Hi Ghica,

Thank you very much for the quick reply, very much appreciated.

The example you sent is very helpful to open up to many other opportunities, and I thank you for that.

Main reason I think I need an activity starter is that I'd like to retain just a set of image details in order to launch a customed presentation. Sort of a refine search to allow to browse through just a limited selection of "chosen's".
Reading around I got the understanding that using an action intent like GET_CONTENT or PICK if above android 4.3 using EXTRA_ALLOW_MULTIPLE set to true you should be able to select multiple files which I'm then going to redirect into a tagged db.
Definitely failing in understanding how to properly set up activity starter for this purpose I'd really love an easy, visual example.

Hope you can help.
Thank you very much for your time.

Cheers,
Roberto

Taifun

unread,
Aug 21, 2016, 9:58:36 AM8/21/16
to MIT App Inventor Forum
you probably can modify this example https://puravidaapps.com/pick.php to your needs
Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

Roberto Grasso

unread,
Aug 21, 2016, 10:04:16 AM8/21/16
to mitappinv...@googlegroups.com
Hi Taifun,

found already that one, and very helpful indeed. Thanks.

Still struggling though on how to properly set the action, class, package, etc.. to achieve that goal.
Whatever I try I can't succeed in making multiple selection.
Could you please be so kind to provide an easy set up example of those parameters?

Thank you,
Regards,
Roberto

Roberto Grasso

unread,
Aug 21, 2016, 10:14:07 AM8/21/16
to MIT App Inventor Forum
I'm sure that I'm doing something totally wrong. Below is what I use to pick a single file:

action: android.intent.action.GET_CONTENT
extrakey: android.intent.action.CATEGORY_OPENABLE
dataType: image/*
dataUri: getdata()

how would I setup properly for multiple selection using the EXTRA_ALLOW_MULTIPLE set to true, also taking into consideration that I'd like to open it directly into a desired folder, ex. file:///storage/sdcard0/sample_folder?

Thank you very much for your time and comprehension.
Cheers,
Roberto

Taifun

unread,
Aug 21, 2016, 10:54:47 AM8/21/16
to MIT App Inventor Forum
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

Roberto Grasso

unread,
Aug 22, 2016, 4:47:33 AM8/22/16
to MIT App Inventor Forum
Hi Taifun,

Thank you for your help and sorry for getting back to you only now.

I've attached a screenshot to show, on the left, how I set up the activity starter to retrieve a single image and show it with image1. (not sure if that's correctly written, but it works)

On the right, I'd like to understand how to setup the activity starter in order to select multiple items and then store those info in a db to be later recalled. Taking into consideration that unlike the left one, here I'd like to open a specific folder in the device from where to chose the files.

I can take the long road and have the single selection process repeating itself until the user is satisfied, but reading from different sources, this forum, puravida, etc.. I got the understanding that using EXTRA_ALLOW_MULTIPLE set to true, and somewhat getClipData() I should be able to fulfill the desired action, but definitely failing at that.

Could you kindly fill in the blanks to give an example on how to write the blocks accordingly to achieve that?
Thank you so very much.

Cheers,
Roberto

activitystarter_ex.jpg

Taifun

unread,
Aug 22, 2016, 10:29:50 AM8/22/16
to MIT App Inventor Forum
you might want to simplify your first example like this

 I'd like to understand how to setup the activity starter in order to select multiple items
it is not the activity starter, which picks the files, it is a file manager app you are calling with the activity starter and some file managers might offer that functionality and others not, it depends on your file manager app

 I got the understanding that using EXTRA_ALLOW_MULTIPLE set to true
where did you read that?

to give an example on how to write the blocks accordingly to achieve that?
to find that out, you will have to do some experiments... 
the examples on my page https://puravidaapps.com/snippets.php#2activity and the documentation Using the Activity Starter can help you
let us know, what you find out

Taifun

Roberto Grasso

unread,
Aug 22, 2016, 10:53:09 AM8/22/16
to MIT App Inventor Forum
Hi Taifun,

thanks for your reply and support.

 
you might want to simplify your first example like this
 Thanks for correcting those blocks, I wasn't sure either and now I have a clearer idea. though the last one was actually there for a different purpose.

 I'd like to understand how to setup the activity starter in order to select multiple items
it is not the activity starter, which picks the files, it is a file manager app you are calling with the activity starter and some file managers might offer that functionality and others not, it depends on your file manager app
I've tried with many and didn't succeed with any. :P I'm actually having problem even in picking a directory from the device using the act.starter, using documentsui I can open a specific location and manage only folders but still can pick any of them. Anyway I found a way around thanks to one of your extensions. You're great my friend, and I'm very glad and grateful you taking your time to help me. 

 I got the understanding that using EXTRA_ALLOW_MULTIPLE set to true
where did you read that?
Here's where I read about the extra_allow_multiple: https://developer.android.com/guide/components/intents-common.html#Storage 
 

to give an example on how to write the blocks accordingly to achieve that?
to find that out, you will have to do some experiments... 
the examples on my page https://puravidaapps.com/snippets.php#2activity and the documentation Using the Activity Starter can help you
let us know, what you find out
Experimenting big time, brain-melting down accordingly... ;)
Definitely going to check the above links, very keen to learn.  Will keep you posted.Thank you 
 
Cheers,
Roberto 
Reply all
Reply to author
Forward
0 new messages