I have a Contact manager program that I use on PC and MAC.
Big Deal I hear you say, but it has brought me in a great deal of business that I would never have got, without it. Trust me, the commercial stuff is rubbish, you need a real world application to do the job.
The issue is that I tried it on a Galaxy note 10.1 and apart from the file handling, it works very well. It looks just like it would on Mac or PC, No stupid icons etc.
I use this to save on PC or Mac (and it even saves and recalls from skydrive without mods).
local recalledfile
on mouseUp
answer file "Select a text file:" with type "Contact Manager|mge|"
if it is empty then exit mouseUp
put it into recalledfile
put recalledfile into field "FilePath"
--set the itemdelimiter to tab
put "file:" & recalledfile into recalledfile
put url recalledfile into Field "TempTable1"
RecallFromDisk -- Recalled data file manipulation
priority
--Enable buttons after initial startup with data
--enablesysbuttons
enable field id 1004 --Table Field
enable button id 1173 --Change Database
--For safety, dsisable OPEN & AS until SAVE or AS
disable button id 1093 --Open
disable button id 1017 -- A
end mouseUp
I use this to recall the file
local counter, tFileDatax, MyFileName
on mouseUp
set the itemdelimiter to tab
-- bring up the system standard file selector to choose a file on disk
--ask file "Please select a file:" with filter "Contact Manager,*.mge"
ask file "Enter file name:" with type "Contact Manager|mge|"
-- if cancel is clicked, exit
if it is empty then exit mouseUp
-- display the file path in the File Path field
put it into MyFileName
-- load the contents of the file, into a variable
if MyFileName ends with ".mge" then
put "File:" & MyFileName into MyFileName
else
put "File:" & MyFileName & ".mge" into MyFileName
end if
SavetoDisk --Common save data code in stack script
set the itemdelimiter to tab
put field "Table 1" into url MyFileName
--For safety, enable OPEN & AS until SAVE or AS
enable button id 1093 --Open
enable button id 1017 -- As
put Field "TempTable1" into field "Table 1" --Puts page content back as it was before save
priority
end mouseUp
What I actually need now is the changes that would allow the above to save on an Android tablet.
Can any one help please?
What code would you use?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: What code would you use?
Hi user#606,
since you cannot "ASK/ANSWER file..." on ANDROID, you will need to "automate" reading/writing your files on mobile!
Best do this in -> specialfolderpath("documents") where you have read and write permissions.
...
if the environment <> "mobile" then
## let the user save or choose a file on disk:
ask file "..."
else
## do automatic read/writing here
end if
...
OR if your want to let the user select a file:
...
set the folder to specialfolderpath("documents")
put the files into tFiles
filter tFiles with "*.mge"
put tFiles into field "the listfield, where you want the user to select one of the (prefs-) files"
...
Know what I mean?
Best
Klaus
since you cannot "ASK/ANSWER file..." on ANDROID, you will need to "automate" reading/writing your files on mobile!
Best do this in -> specialfolderpath("documents") where you have read and write permissions.
...
if the environment <> "mobile" then
## let the user save or choose a file on disk:
ask file "..."
else
## do automatic read/writing here
end if
...
OR if your want to let the user select a file:
...
set the folder to specialfolderpath("documents")
put the files into tFiles
filter tFiles with "*.mge"
put tFiles into field "the listfield, where you want the user to select one of the (prefs-) files"
...
Know what I mean?
Best
Klaus
Re: What code would you use?
Hi Klaus,
Thank you for the help on this one.
It looks clear enough, but I will need to try it out to see what needs adjustment.
It is unlikely I will store data on the tablet, just to read amend and save from the main server, for the very rare situation that needs it.
Thank you for the help on this one.
It looks clear enough, but I will need to try it out to see what needs adjustment.
It is unlikely I will store data on the tablet, just to read amend and save from the main server, for the very rare situation that needs it.
Re: What code would you use?
Do you solve this problem now, i meet the same problem.user#606 wrote: What I actually need now is the changes that would allow the above to save on an Android table.
Can any one help please?
Re: What code would you use?
Hola altaqzmqa,
...
## Your app has WRITE permission in this folder!
put specialfolderpath("documents") & "/your_name_for_the_prefs_file_here" into tPrefsFile
put content_of_a_variable_or_whetever_you_want_to_store into url("file:" & tPrefsFile)
## Done
...
Best
Klaus
Do you mean saving something on a tablet on Android?altaqzmqa wrote:Do you solve this problem now, i meet the same problem.user#606 wrote: What I actually need now is the changes that would allow the above to save on an Android table.
Can any one help please?
...
## Your app has WRITE permission in this folder!
put specialfolderpath("documents") & "/your_name_for_the_prefs_file_here" into tPrefsFile
put content_of_a_variable_or_whetever_you_want_to_store into url("file:" & tPrefsFile)
## Done

...
Best
Klaus