alternative to answer file for mobile device

The place to discuss anything and everything about running your LiveCode on Android

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
cusingerBUSCw5N
Posts: 338
Joined: Wed Jul 11, 2012 9:24 pm

alternative to answer file for mobile device

Post by cusingerBUSCw5N » Tue Sep 25, 2012 3:21 pm

I would like my app to upload docs and so I have

Code: Select all

answer file "Select a file" 
which on the web or my computer nicely opens up so people can select files.

but - according to the dictionary, it only works on desktop and web - which I can confirm. It doesn't work on an android.

Is there an equivalent for a mobile environment?

qberty1337
Posts: 35
Joined: Sun Sep 09, 2012 1:09 pm

Re: alternative to answer file for mobile device

Post by qberty1337 » Sun Oct 21, 2012 3:10 pm

Well there' isn't any equivalent for normal files. (just mobilePickPhoto,mobilePickMedia).

A tedious, but working way would be to set the defaultFolder to whatever the folder is that has the files in it. Then 'put the files' into a variable and show them to the user using the Modal Pick-Wheel = 'mobilePick optionList'

Should give you roughly the same effect and ease of use.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5087
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: alternative to answer file for mobile device

Post by jacque » Sun Oct 21, 2012 7:36 pm

All the Android apps I have that show a file directory have created their own interface for it. I have a couple of different "office" apps and they each present their own. I have three different file managers and they all have their own too. Dropbox and Google Drive also each have a different one. So I don't think it's a standard Android interface, every developer has to do it themselves.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

qberty1337
Posts: 35
Joined: Sun Sep 09, 2012 1:09 pm

Re: alternative to answer file for mobile device

Post by qberty1337 » Tue Oct 23, 2012 9:04 am

jacque wrote:All the Android apps I have that show a file directory have created their own interface for it. I have a couple of different "office" apps and they each present their own. I have three different file managers and they all have their own too. Dropbox and Google Drive also each have a different one. So I don't think it's a standard Android interface, every developer has to do it themselves.
Actually there is a user stack level api for when you're coding Android apps from scratch. Yeah all apps have their own interfaces but Android has it's own simple function for pulling a list of currently existing files. Of course it depends what you feed the function but still, it's a global API.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5087
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: alternative to answer file for mobile device

Post by jacque » Tue Oct 23, 2012 9:19 pm

Good to know, thanks. So the apps I have are creating their own GUI but using a system call to get the file lists. Sounds like a LiveCode feature request to me...
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

cusingerBUSCw5N
Posts: 338
Joined: Wed Jul 11, 2012 9:24 pm

Re: alternative to answer file for mobile device

Post by cusingerBUSCw5N » Wed Oct 24, 2012 1:16 am

OK... your posts are beyond my comprehension...but this is what worked for me.

There is something called fillfilesfolders that works on my android


First, create two scrolling fields, field1 and field2

In the card level put:

command fillfilesfolders
put the folders into field "field1"

put the files into field "field2"
end fillfilesfolders

On field1's object script put

on mouseup
set the defaultfolder to the defaultfolder & "/" & the clicktext
fillfilesfolders

end mouseup


That gives me in field1 all the folders on the android (including pictures and downloads, which is what I want).
Click on those and it gives me the files in field2.

qberty1337
Posts: 35
Joined: Sun Sep 09, 2012 1:09 pm

Re: alternative to answer file for mobile device

Post by qberty1337 » Wed Oct 24, 2012 5:39 am

I don't see why you need that command.

After setting the defaultFolder, "the files" and "the folders" should already give you everything from the defaultfolder. Works for me :/

cusingerBUSCw5N
Posts: 338
Joined: Wed Jul 11, 2012 9:24 pm

Re: alternative to answer file for mobile device

Post by cusingerBUSCw5N » Wed Oct 24, 2012 1:52 pm

you're right. I realized that after I put in the post. I just didn't know it was as simple as calling files and folders.

Post Reply

Return to “Android Deployment”