revMobile: built in?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
dhurtt
Posts: 42
Joined: Sat Nov 09, 2013 7:37 pm

revMobile: built in?

Post by dhurtt » Wed Nov 27, 2013 4:59 pm

I keep reading references to revMobile and was expecting to see it in the plugins list, but it is not there. Is revMobile built in?

For example, reading the iOS notes I see a reference to an iOS text field and all of its properties. Can I simply set and get those properties on a "normal" text field or do I need to use a revMobile control? I figure I am missing a file somewhere. I have the commercial version of Livecode, but I did not see it in the Community version either.

Thanks in advance,

Dale

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

Re: revMobile: built in?

Post by Klaus » Wed Nov 27, 2013 7:02 pm

Hi Dale,

yes, "mobile" is built-in :D

But no, the "mobile" properties and commands are only available in the simulator or the actual device!
You will even need to check if you are on "mobile" or the IDE will throw an error on these commands! :(

Like this:

Code: Select all

on opencard

  ## Do "general" opencard stuff here...

  ## Mobile only stuff here:
  if the environment = "mobile" then
   moblecontrolcreate...
   ### more mobile stuff...
  end if
end opencard
Best

Klaus

dhurtt
Posts: 42
Joined: Sat Nov 09, 2013 7:37 pm

Re: revMobile: built in?

Post by dhurtt » Wed Nov 27, 2013 7:35 pm

Thanks Klaus, that really helps. So I guess it would be best to place normal controls on the screen, and then in code use those controls' properties to help you set the properties of the mobile controls you are creating on the fly then. Hmmmm....

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: revMobile: built in?

Post by Simon » Thu Nov 28, 2013 2:12 am

Hi Dale,
After using mobileControlCreate you use mobileControlSet, one of the properties that you set is the controls rectangle. You can use an object on the card (such as an image or rectangle) as a place holder while in the IDE then;
mobileControlSet "myControl","rect", the rect of image "myPlaceHolderImage"

You wont have the functionality to test the control in the IDE but you'll know it's shape and where it is. Heck it's only a field or browser or such.
hmmm... I have never tried using an input field For the IDE then setting the mobile control to that fields rect.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

dhurtt
Posts: 42
Joined: Sat Nov 09, 2013 7:37 pm

Re: revMobile: built in?

Post by dhurtt » Thu Nov 28, 2013 2:36 am

It didn't work and I am now trying to figure out how to debug something that does not exist in the IDE but only does on the simulator or device ... :^/

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: revMobile: built in?

Post by Simon » Thu Nov 28, 2013 2:45 am

What does "Didn't work" mean?
Here is the lesson;
http://lessons.runrev.com/s/lessons/m/4 ... -on-mobile
It is a very complex stack, the part you need is group together in the "on inputCreate" some of that you won't need.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

dhurtt
Posts: 42
Joined: Sat Nov 09, 2013 7:37 pm

Re: revMobile: built in?

Post by dhurtt » Thu Nov 28, 2013 4:28 am

The code in that stack breaks. As soon as you load it, it dumps you into the debugger.

By "doesn't work" I meant the field did not appear.

So I started simpler still. I created a new stack with a Create button and a field placeholder (a graphic so I would know where the rectangle would be). I put "answer" code in everywhere and I found out that when an error trips, all scripts in the simulator stop executing (i.e. no error message). So I dug further into the code and found the error (which the compiler/save does not catch). After a few minutes more I have a stack with radio buttons to change the keyboard, etc. and have exercised all the options. So now I need to go back to the original code and see where my fat fingers made the mistake. The main thing is that I know the concept works and that I have all the mobile libraries I need (i.e. my install is not broken).

Long story short: I used answer to debug on the simulator to see where the code stops running. Somewhere between the last successful answer and your first unsuccessful one is where the error lies. :)

Regards,

Dale

Post Reply