Page 1 of 6

Test the app in my Ipad

Posted: Tue Jan 06, 2015 6:07 pm
by aebki
Hello,

I made one app for Ipad.
I have the license of LiveCode and i already signed up the apple's developers program.

I can test my app in the iOS simulator with the button of LiveCode but i am not able to do it directly in my Ipad...

I tried to make what is explained in the lesson
"How-do-I-build-an-iPhone-#!prettyPhoto"

But i can't drag nothing as it is explained in this link...:-(

What is the problem?

And the standalone i have ( the one i am trying to drag but i can't ) is not appearing with the icon (72x72) i added in the configuration.
What am i doing wrong because the icon is not appearing?

Thanks in advance!

aebki

Re: Test the app in my Ipad

Posted: Tue Jan 06, 2015 6:39 pm
by jmburnod
Hi aebki,
Welcome in this forum.
But i can't drag nothing as it is explained in this link...
You didn't talk about xCode.
Open xCode
Choose "organiser" in the Window menu.
Your device appear on right
Drag your app to the window
That's all 8)
Good luck
Jean-Marc

Re: Test the app in my Ipad

Posted: Wed Jan 07, 2015 11:37 am
by aebki
Hi Jean-Marc,

Yes, i didn't speak about Xcode...:-)
But, in fact is what i did...As i followed what was written in the lesson i said in my other post...:-)

So, when i go to the option 'Organizer' in the menu 'Window' i find that there are two options: 'Projects' and 'Archives'
And i tried to drag in both but i can't...:-(

And i didn't see nothing on the right...No devices and no other things...

So i went to the option 'Devices' in the same menu 'Window' and i see on the left my Ipad...So, it is connected and recognized for the mac.

Do you have one idea why i can't drag it???

Regards.

Re: Test the app in my Ipad

Posted: Wed Jan 07, 2015 4:24 pm
by aebki
Hi,

I attach the two screenshots to show what and where i am making...

Regards.

Re: Test the app in my Ipad

Posted: Wed Jan 07, 2015 5:01 pm
by Klaus
Hi all,

using Xcodes "Organizer" window worked with Xcode < 6.x! And that was more than a year ago.
Sorry, no idea how this is supposed to work with Xcode >= 6.x, RunRev really should update some of their online lessons! :(


Best

Klaus

Re: Test the app in my Ipad

Posted: Wed Jan 07, 2015 5:02 pm
by bn
Hi,

that is what compiled iOS apps look on my system also. Try to drag them to the "installed apps" area when you have selected "Devices" and your iPad.

Sometimes the first time I drop an iOS app into this area Xcode somehow complains, repeating it does install the app.

Alternatively you can click on the "+" sign and search for your app-name. It will only find iOS apps of that name.

If you profile includes your iPad and the profile is valid it should work.

Kind regards

Bernd

Re: Test the app in my Ipad

Posted: Wed Jan 07, 2015 5:13 pm
by Dixie
Hi...

It seems things have changed with xCode 6.1... under the heading 'Installed Apps' you will see a '+" sign... click on it and you will be presented with a system file dialog window... select your compiled app, it will then be placed onto your device...

Re: Test the app in my Ipad

Posted: Wed Jan 07, 2015 6:06 pm
by aebki
Hi,

Thanks for your answers...:-)

I could do it using the '+' from the option 'devices' in the menu 'Window'...
Even if it took me twice or three times that i tried before it was accepted.

Now i have one doubt / problem.

In the iOS simulator all what i tried it worked fine, but in the Ipad is not changing the data values in the database!
Someone knows why???

Regards.

Re: Test the app in my Ipad

Posted: Wed Jan 07, 2015 6:11 pm
by Klaus
Hi aebki,
aebki wrote:In the iOS simulator all what i tried it worked fine, but in the Ipad is not changing the data values in the database!
Someone knows why???
sorry, our crystal ball is currently in the workshop 8)
Maybe you could provide a BIT more info?


Best

Klaus

Re: Test the app in my Ipad

Posted: Wed Jan 07, 2015 10:09 pm
by aebki
Hi Klaus,

I will try to explain it better as your Crystal ball is not ready!!! Hahaha

When i created the standalone and i tested it in the iOs simluator it worked well...So, all the info i changed was updated in the database i have.
But not when i tried in my Ipad.

And i am wondering if there is something to do with the fact that i added the app from the 'device' option (in the menu 'Window') and not from the 'organizer' option (in the menu 'Window'). Or there is nothing to do????

Because in the beginning when i tried with the iOs simulator i thought that this was the same as send it to my Ipad...Is this correct or am i wrong????

I don't know if now i expressed myself better or not...I hope so!!! :-)

Regards.

Re: Test the app in my Ipad

Posted: Thu Jan 08, 2015 1:00 pm
by Klaus
Hi aebki,

AHA! :D

OK, where is your database file located?
How do you access the db file?
Please show us your script(s).


Best

Klaus

Re: Test the app in my Ipad

Posted: Thu Jan 08, 2015 4:23 pm
by aebki
Hi,

I will attach you one screenshot of where is my database...:-)

What do you want to see exactly? Which script?

This is what i have in the beginning of my program:

On OpenCard
global mypath

put the effective filename of this stack into mypath

set itemdel to "/"
## remove filename of runtime/stack:
delete item -1 of mypath
put "/Documents/GestComp.sqlite" AFTER mypath

set enabled the button "btnConfig" to false
put CmpExist("VGestComp") into numb

if numb = 0 then
set enabled the button "btnConfig" to true
end if
end OpenCard

These are another methods i use:

command databaseConnect

local tDatabasePath, tDatabaseID
global ruta

put ruta into tDatabasePath
put revOpenDatabase ("sqlite",tDatabasePath,,,,) into tDatabaseID

setDatabaseID tDatabaseID

end databaseConnect

command setDatabaseID pDatabaseID
put pDatabaseID into sDatabaseID
end setDatabaseID

function getDatabaseID
return sDatabaseID
end getDatabaseID

function CmpExist theData

databaseConnect
put getDatabaseID() into tDatabaseID
put revDataFromQuery(tab,return,tDatabaseID,"SELECT " & theData & " FROM VGest_Comp ") into theResult
return theResult

end CmpExist


I hope it is useful and you can know why...:-)

Is it normal that it is working in the iOS simulator and not in my Ipad?

Regards

Re: Test the app in my Ipad

Posted: Thu Jan 08, 2015 6:28 pm
by Klaus
Hi aekbi,

OUCH! :shock:

OK, lts make small steps...
1. Local and global variables should be declared at the TOP of a script and not inside of a handler, unless that is the ONLY handler in the script!

Code: Select all

local tDatabasePath, tDatabaseID
global ruta

command databaseConnect
  ...
  ...
end databaseconnect

command another_handler_that_will_access_your_globals_and_locals
  ...
end another_handler_that_will_access_your_globals_and_locals
2. global ruta
You did not fill ruta with content in the scripts you have posted here?
Maybe you mean: global MyPath?

3. Do not add the complete "Documentes" folder in the standalone builder!
Every mobile app has its own "documents" folder which you need to address differently!
See 4.

4.

Code: Select all

...
put the effective filename of this stack into mypath
set itemdel to "/"
## remove filename of runtime/stack:
delete item -1 of mypath
put "/Documents/GestComp.sqlite" AFTER mypath
...
THIS folder does not exist on your device!
It works in the simulator, because the simulator uses the same filesystem as its host, which is your Mac!
And you do not have write permissons in the engine folder!

Sio you need to copy your db file to the users documents folder when the app starts.
Of course only if you did not copy it before!

Do something like this:

Code: Select all

## THIS variable mypath will hold the correct path to the database file on the device later! And not ruta
global mypath

On OpenCard
  
  ## Create pathnames:
  ## Everything you add via the "Copy files" tab in the standalone builder will be found in ->
  ## specialfolderpath("engine") on the device and also in the simulator
  
  ## iOS and Android have CASE sensitive file systems, so I recommend to only use small caps in any file and folder name!
  
  ## Path to TARGET file on device:
  put specialfolderpath("documents") & "/GestComp.sqlite" into mypath
  
  ## 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 mypath then
    put url("binfile:" & tEngineDB) into url("binfile:" & mypath)
  end if
  
  ## NOW we can access/open the database at -> mypath, see 5.
  ...
end openCard
5.

Code: Select all

local tDatabasePath, tDatabaseID
global mypath

command databaseConnect
  put revOpenDatabase ("sqlite",mypath,,,,) into tDatabaseID
  ...
end databaseConnect
6. Check these great stacks:
http://www.hyperactivesw.com/revscriptc ... ences.html
:D

Best

Klaus

Re: Test the app in my Ipad

Posted: Thu Jan 08, 2015 7:20 pm
by aebki
Hi Klaus,

Thanks for your help!!! :-)

Yes, my variable was 'ruta', but i thought that putting 'mypath' for you was more clear...:-) But i forgot to change it in the declaration...:-(

So, i will make the changes in my code with what you told me...

One last thing:

When i am trying to close the app i can't...:-(

I used this in my button "Exit"

on mouseUp
close stack "Principal"
end mouseUp

and i also tried with one 'quit'...

But anyone is working to close it and to clean it from the memory...:-(

How it should be?

Regards

Re: Test the app in my Ipad

Posted: Thu Jan 08, 2015 7:30 pm
by Klaus
HI aebki,

Quitting your iOS app lies in the hands of the USER, s/he needs to press the HOME button on the device!
Remember, on mobile things are different 8)


Best

Klaus