Test the app in my Ipad

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

Test the app in my Ipad

Post by aebki » Tue Jan 06, 2015 6:07 pm

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

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Test the app in my Ipad

Post by jmburnod » Tue Jan 06, 2015 6:39 pm

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
https://alternatic.ch

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

Re: Test the app in my Ipad

Post by aebki » Wed Jan 07, 2015 11:37 am

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.

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

Re: Test the app in my Ipad

Post by aebki » Wed Jan 07, 2015 4:24 pm

Hi,

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

Regards.
Attachments
img2.jpg
img1.jpg

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

Re: Test the app in my Ipad

Post by Klaus » Wed Jan 07, 2015 5:01 pm

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

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4166
Joined: Sun Jan 07, 2007 9:12 pm

Re: Test the app in my Ipad

Post by bn » Wed Jan 07, 2015 5:02 pm

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

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Test the app in my Ipad

Post by Dixie » Wed Jan 07, 2015 5:13 pm

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...
Attachments
lussign.png
lussign.png (22.14 KiB) Viewed 9248 times

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

Re: Test the app in my Ipad

Post by aebki » Wed Jan 07, 2015 6:06 pm

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.

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

Re: Test the app in my Ipad

Post by Klaus » Wed Jan 07, 2015 6:11 pm

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

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

Re: Test the app in my Ipad

Post by aebki » Wed Jan 07, 2015 10:09 pm

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.

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

Re: Test the app in my Ipad

Post by Klaus » Thu Jan 08, 2015 1:00 pm

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

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

Re: Test the app in my Ipad

Post by aebki » Thu Jan 08, 2015 4:23 pm

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
Attachments
Standalone.png

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

Re: Test the app in my Ipad

Post by Klaus » Thu Jan 08, 2015 6:28 pm

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

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

Re: Test the app in my Ipad

Post by aebki » Thu Jan 08, 2015 7:20 pm

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

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

Re: Test the app in my Ipad

Post by Klaus » Thu Jan 08, 2015 7:30 pm

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

Post Reply