How do i test input fields in the windows simulator if they are not supported?

I tried running the example code below and the Output screen says:

“Warning: Native text fields are not currently supported in the simulator. Please build for device.”

So does that mean I have to build it for my device(an ipad) and install it on there EVERY time I want to test?!  Is there some other non-native ojbect to use for showing a text field and a keyboard to test user input?

Please help, I am new but like what I’ve seen so far.

Gib

local defaultField local function textListener( event ) if event.phase == "began" then -- user begins editing textField print( event.text ) elseif event.phase == "ended" then -- textField/Box loses focus elseif event.phase == "ended" or event.phase == "submitted" then -- do something with defaulField's text elseif event.phase == "editing" then print( event.newCharacters ) print( event.oldText ) print( event.startPosition ) print( event.text ) end end -- Create our Text Field defaultField = native.newTextField( 10, 30, 180, 30 ) defaultField.userInput = textListener defaultField:addEventListener( "userInput", defaultField )  

Unfortunately you must build and test on device if you want to use native input and have simulator on Windows.

Oh, well I don’t want to use native controls then if we can’t test them.  Is there some examples you know of that show how to accept user input with a keyboard on the screen to tap out on?  I only see tutorials and samples use these darn native controls for user input.

Thanks again!

Gib

Only native ones can open os keyboard because there are part of android/ios, not open es canvas which sdk uses. With Corona it’s the only way to use input fields

I see.  Is there nothing but native controls for input text boxes?  Isn’t this a huge pain to build, transfer, then run the app on the device?  I test constantly so it would be for me.

Is this a *feature* of Corona or doesn’t the Lua languange include text boxes to accept user input?

Thanks again,

Gib

It’s not that hard to build, test and transfer. Honestly, it’s the only way you’re going to know exactly how your app behaves in the wild. You’re going to run into other issues (screen sizing and locations, IAP, json/file maintenance) that will only present themselves when testing on a device. It’s best to get in the habit of testing something on a device before you consider that development hurtle overcome.

It’s so easy to implement with Lua/Corona that you’re cutting down on the time that it would take to code it all in another (ob-c/Xcode,java/eclipse) solution would allow simulator. Corona has it’s warts but this isn’t one of them.

*Moved to correct forum post*

Ok, I’ll give it a go.  But the FAQ says you are prevented from buildng an iOS app from a windows pc how do you get around this?  I am a windows pc guy but I do have an iPad so I was wanted to develop for the iPad.  

It is of VITAL importance that you read the below linked thread CAREFULLY. Read EVERY post to understand Apple’s stance on development.

https://discussions.apple.com/thread/3740174?start=0&tstart=0

If you were to google “develop for ios on windows” you’ll get a bunch of forum posts kind of like your other one being angry about one development architecture or another saying they are cross-platform, but not allowing you to develop for iOS on Windows. the answers to each are pretty identical: It’s an Apple policy, and has nothing to do with the architecture itself. If one had a Mac machine, they could develop cross platform without changing architecture.

I had to buy a Mac just so I could release for iOS; I suspect that a lot of other people had to do the same thing. If you don’t want to do that, I get it. But you have to spend money to make money, and that is the real American way. Google is your friend. You might find good solution there.

just posting here so in the future if anyone looking to do the same thing

use this in place of native text fields.

http://developer.coronalabs.com/code/onscreenkeyboard

You 2 are now acting more like gentlemen, thanks.

The Apple article makes sense, they are out to make money and I appreciate that, its the American way!.  I did some other research and found that indeed other SDK companies are saying the same thing(ya sure you can), but in fact no you can’t :wink:  I don’t understand they are all are getting away with fraudulent claims but that is another matter I guess.

I can continue to learn Corona and lua and when I am ready for real testing, go with the MacInCloud.com to do finaly testing and fixes before submitting to iTunes.  It’s late and got paged on our servers tonight so I will have to make sure to reread that apply policy article to make sure I got a full comprehension on Apples rules.

Gib

Sounds like you’ve got some stuff sorted out, but let me answer the “Why can’t I don’t native.textFields in the Windows Simulator?” question.

A. Blame Microsoft.   But since that answer doesn’t say way, here’s the issue.  On Microsoft Windows, you cannot mix native display objects, like text fields, with OpenGL canvases.  Corona SDK is an OpenGL application.  That’s how we get the graphics performance we do.   Apple’s OS-X and iOS as well as Android permit native objects and OpenGL canvases can co-exist (though you cannot put native objects inside of OpenGL constructions like displayGroups.

There are a couple of routes… one, the seemingly painful one is to simply build as much of your app as you can that doesn’t involve keyboard input and if you need the input, you can just hard-code the text while testing.  Then when you need to work out the kinks of the input system, then build for device.  You will find there are quite a few things that have to be tested on device, like Facebook, Ads, inApp Purchases, GameNetwork, etc.  We all love the speed of the simulator but at the end of the day, some things simply need to be done on the Simulator.

The other options is to build your own keyboard.  I did this for a client and while I didn’t support every character and shift-states, it was all done in an OpenGL friendly way so I could test it in the Sim.  It’s a lot of work.  Windows also supports the new key events and can be used to capture the Windows keyboard, so building your own is a real possibility.

Unfortunately you must build and test on device if you want to use native input and have simulator on Windows.

Oh, well I don’t want to use native controls then if we can’t test them.  Is there some examples you know of that show how to accept user input with a keyboard on the screen to tap out on?  I only see tutorials and samples use these darn native controls for user input.

Thanks again!

Gib

Only native ones can open os keyboard because there are part of android/ios, not open es canvas which sdk uses. With Corona it’s the only way to use input fields

I see.  Is there nothing but native controls for input text boxes?  Isn’t this a huge pain to build, transfer, then run the app on the device?  I test constantly so it would be for me.

Is this a *feature* of Corona or doesn’t the Lua languange include text boxes to accept user input?

Thanks again,

Gib

It’s not that hard to build, test and transfer. Honestly, it’s the only way you’re going to know exactly how your app behaves in the wild. You’re going to run into other issues (screen sizing and locations, IAP, json/file maintenance) that will only present themselves when testing on a device. It’s best to get in the habit of testing something on a device before you consider that development hurtle overcome.

It’s so easy to implement with Lua/Corona that you’re cutting down on the time that it would take to code it all in another (ob-c/Xcode,java/eclipse) solution would allow simulator. Corona has it’s warts but this isn’t one of them.

*Moved to correct forum post*

Ok, I’ll give it a go.  But the FAQ says you are prevented from buildng an iOS app from a windows pc how do you get around this?  I am a windows pc guy but I do have an iPad so I was wanted to develop for the iPad.  

It is of VITAL importance that you read the below linked thread CAREFULLY. Read EVERY post to understand Apple’s stance on development.

https://discussions.apple.com/thread/3740174?start=0&tstart=0

If you were to google “develop for ios on windows” you’ll get a bunch of forum posts kind of like your other one being angry about one development architecture or another saying they are cross-platform, but not allowing you to develop for iOS on Windows. the answers to each are pretty identical: It’s an Apple policy, and has nothing to do with the architecture itself. If one had a Mac machine, they could develop cross platform without changing architecture.

I had to buy a Mac just so I could release for iOS; I suspect that a lot of other people had to do the same thing. If you don’t want to do that, I get it. But you have to spend money to make money, and that is the real American way. Google is your friend. You might find good solution there.