Test the app in my Ipad

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: Test the app in my Ipad

Post by dave.kilroy » Sun Jan 11, 2015 1:09 pm

glad you're making progress

Assuming that you copy GestComp.sqlite to the same folder as your standalone (with the 'copy files' tab of the standalone application settings dialog box) then you will need the following locations:

tEngineDB = specialfolderpath("engine") & "/GestComp.sqlite"
ruta = specialfolderpath("documents") & "/GestComp.sqlite"

Each time your app opens on the iOS device it should check for the existence of a file at ruta. If there it finds no file then this is the first time the app has been launched and you need to copy the database from tEngineDB to ruta

Thereafter in all your dealings with your database you should only deal with the database at the ruta location - this is because you won't be able to write back to the database in the engine folder.

So, the tEngineDB location should only ever be used once, and only do one copy from tEngineDB to ruta, and after that use ruta all the time

Good luck!

Dave
"...this is not the code you are looking for..."

aebki
Posts: 126
Joined: Tue Jan 06, 2015 5:48 pm

Re: Test the app in my Ipad

Post by aebki » Sun Jan 11, 2015 2:52 pm

Hi,


Yes, i am copying GestComp.sqlite with the copy files...:-)
I don't know if i understood well what you are telling me about the location of my database and the standalone...:-(

So, i am not sure is if the database is in the same folder as the standalone...:-(
I have it in the same folder of my program "gc.livecode" but when the standalone is created is in another folder and alone...So, i don't know if is included in this app or not...I suppose that yes! :-)

So, if i use this code, i have no error with the database as it finds the table...and with answer ruta i have like result this: "users/aebki/Documents/gc/Gestcomp.sqlite"

Code: Select all

put the effective filename of this stack into ruta

set itemdel to "/"
## remove filename of runtime/stack:
delete item -1 of ruta
put "/GestComp.sqlite" AFTER ruta
answer ruta
   
   ## Just to be sure! Shoulod be true!
   ANSWER (there is a file tEngineDB)
     
     ## Path to db file in engine folder:
     put specialfolderpath("engine") & "/GestComp.sqlite" into tEngineDB
     
     ## Check if we already copied the db file to users doc folder:
     if there is NOT a file ruta then
          put url("binfile:" & tEngineDB) into url("binfile:" & ruta)
     end if

if i use the next code, the result of the 'answer ruta' is:
"users/aebki/Documents/Gestcomp.sqlite", even if in this folder i have not my database, as i have my code and my database inside the folder 'gc'

Code: Select all

put specialfolderpath("documents") & "/GestComp.sqlite" into ruta
answer ruta
   
   ## Just to be sure! Shoulod be true!
   ANSWER (there is a file tEngineDB)
     
     ## Path to db file in engine folder:
     put specialfolderpath("engine") & "/GestComp.sqlite" into tEngineDB
     
     ## Check if we already copied the db file to users doc folder:
     if there is NOT a file ruta then
          put url("binfile:" & tEngineDB) into url("binfile:" & ruta)
     end if

So how should i do it?
Because doing it as the first option is doing it but not using the specialfolderpath("documents"), so i imagine it is not correct...:-(
But with the other option is putting in ruta one path is not corresponding with the real path...:-(

Regards

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Test the app in my Ipad

Post by Klaus » Sun Jan 11, 2015 5:44 pm

Hi aebki,

hmm, you almost had it, but now you are mixing Desktop-IDE, Desktop-standalone and standalone-iOS stuff :(

Things are different on mobile and desktop, especially when it comes to the DOCUMENTS folder AND ENGINE folder.
Please look up the specialfolderpath() part in the dictionary!

Now do you want to make it work on the desktop, too?
Or in mobile/iOS only?


Best

Klaus

aebki
Posts: 126
Joined: Tue Jan 06, 2015 5:48 pm

Re: Test the app in my Ipad

Post by aebki » Sun Jan 11, 2015 7:42 pm

Hi,

Yes, i think i always mixed everything...:-(

I finished to read what is written in the dictionary about the specialfolderpath...

I will try to put order in my ideas and then i hope i will manage to make it for mobile!!! :-)

Regards.

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: Test the app in my Ipad

Post by dave.kilroy » Sun Jan 11, 2015 8:34 pm

hi aebki

OK good - you'll need to get it straight in your head how LiveCode 'packages' apps differently for each platform you want to deploy to or you'll never manage the resources you want to accompany your apps properly.

Come back to us with questions or when you think you've got it straight!

Kind regards

Dave
"...this is not the code you are looking for..."

aebki
Posts: 126
Joined: Tue Jan 06, 2015 5:48 pm

Re: Test the app in my Ipad

Post by aebki » Mon Jan 12, 2015 3:30 pm

Hi,

Thanks a lot for all the councils / help from Dave, Klaus, Simon, Neil, etc...:-)

For the moment i came back to tell you that now the database is working in iOS as i want! :-)
Now i have to test everything in the mobile, as in the desktop version was already working...

So, maybe i will have more doubts soon...:-)

Regards.

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: Test the app in my Ipad

Post by dave.kilroy » Mon Jan 12, 2015 3:50 pm

Sweet! :)

Take a photo of yourself now, print it out and put beside your computer - then when you get hit by your next bug look at the pic of yourself to remind you of the good times!
"...this is not the code you are looking for..."

aebki
Posts: 126
Joined: Tue Jan 06, 2015 5:48 pm

Re: Test the app in my Ipad

Post by aebki » Mon Jan 12, 2015 4:42 pm

Yes,

it seems a good council!!! :-)

Regards.

aebki
Posts: 126
Joined: Tue Jan 06, 2015 5:48 pm

Re: Test the app in my Ipad

Post by aebki » Tue Jan 13, 2015 11:06 am

Hi,

For the moment in what i am testing in my Ipad it seems to work well...:-)

But i have one problem with the objects ( text field, button, checkbox, etc... ). They seem less pretty in the Ipad version in comparison with the desktop version...:-(

Is it normal? I wonder as for the desktop version i only used the object ( without customize it int the option of "color & pattern" or "Geometry", etc. )...

And i have another doubt...Is it possible to make the text field with rounded corners?

Regards.

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Test the app in my Ipad

Post by Klaus » Tue Jan 13, 2015 1:50 pm

Hi aebki,

on the mobile platform LC unfortunately uses the MOTIF Look and Feel (see menu "View -> Look and feel"),
which is an old UNIX theme and yes, it looks shi.. erm not so well.

You need to create your own theme or use something like MobGUI: http://mobgui.com

But no there are no fields with rounded corners in Livecode!
Maybe you could simply FAKE it with a transparent field and a graphic with rounded corners behind it 8)


Best

Klaus

aebki
Posts: 126
Joined: Tue Jan 06, 2015 5:48 pm

Re: Test the app in my Ipad

Post by aebki » Tue Jan 13, 2015 3:34 pm

Hi Klaus,

Thanks for the answer...

It is a pity that LiveCode uses these kind of controls for the mobile app...:-(

Thanks also for the idea about the rounded corners! :-)

Regards

aebki
Posts: 126
Joined: Tue Jan 06, 2015 5:48 pm

Re: Test the app in my Ipad

Post by aebki » Wed Jan 14, 2015 4:35 pm

Hi,

I am still testing the app in the ipad, and for the moment is working well or quite well...
In one of my card i have to fill many data and some of these data are recollected in text fields.
And for the text fields in the medium or bottom of my card, i can't see what i am writing as the ipad keyboard is taking the half of the screen...:-(

Any idea about how to resolve this?

Regards.

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: Test the app in my Ipad

Post by dave.kilroy » Wed Jan 14, 2015 4:51 pm

hi aebki

Yes the motif look on iOS and Android is VERY UGLY - Klaus mentioned mobGUI, I'm going to mention another tmControls2 (http://tmtools.tactilemedia.com/tmcontrol2/index.html) which is also excellent. I've bought and have used both in the past - at the moment I use a mixture of own-rolled-solutions and tmControls2

As regards the covering-up-stuff-with-virtual-keyboard problem - try this lesson http://lessons.runrev.com/m/847/l/13672 ... y-keyboard
"...this is not the code you are looking for..."

aebki
Posts: 126
Joined: Tue Jan 06, 2015 5:48 pm

Re: Test the app in my Ipad

Post by aebki » Wed Jan 14, 2015 5:31 pm

Hi Dave,

Thanks for your answer for both things...:-)

I will look the link you gave me later and see which one will be better for what i need...

And about the keyboard i read the lesson and then i copied the code to put it in my app to see what is doing and then try to adapt it t what i need...
But nothing is happening. Is as i didn't put this code in the card script...:-(

And in the end of the lesson is written this:
"You should now see that when the keyboard is activated on a device/simlator, the input field moves appropriately."

In my case i will have 4 text fields that will be hidden by the keyboard...So, how is the way to control them???

Regards.

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: Test the app in my Ipad

Post by dave.kilroy » Wed Jan 14, 2015 5:48 pm

Hi aebki - copying and pasting the code from the lesson will only work if you paste ALL of it - including the local declaration of sinputId. You'll also need a graphic named "rectangle"

If you want to move more than 1 field just add their new locations to the keyboardactivated and keyboarddeactivated handlers.

Do you have another handlers that might interfere with the code? Have you tried the sample stack file associated with the lesson? What happens when you debug the code and step-through-it-line-by-line?

If none of the above helps, post your code here and we'll have a look...
"...this is not the code you are looking for..."

Post Reply