Air code working the other way around

Say I was developing an app that would not only be for the iPad but for the iPhone/android phone as well. What if I wanted to test my current code on an actual smartphone? I would like it if there could be a way to connect your phone to your iPads codea app so that you could test your code on an actual smartphone and see how things would work with the smaller screen, rather than simply being able to test it on an iPad. For this, I would suggest an app that can be purchased on any device that allows you to connect to your iPad so that you could access and test your projects. This should preferably be a free app that would not exist for the sake of editing code, but simply for the sake of testing it. This app could also benefit you guys at two lives left incase one of the many smartphone users were looking for a lua programming app. They would stumble across this app, download it, and see something like this: open up the codea app on your iPad to test your projects. Don’t have codea? purchase it now!!! (Like that only more professional). If you people were to create this app, it would create better convenience for us, and more advertisement for you. It is the definition of a win win proposition.

It’s just a teensy weensy bit difficult, is all

It may well be difficult, but the real question is whether or not the benefits outweigh the challenge.

I suspect the real question is whether it is even possible (or permitted)

Even if we could do it for iPhones, I don’t think you could do it for Android… But if you’re looking to develop like that for Android, the Android Eclipse plugin actually has that built in (it’s pretty awesome).

If you are serious about developing for iOS, you might as well learn to use Test Flight, which allows you to ad-hoc test on your various iOS devices.

It’s actually pretty simple to use, the hardest part is making your app universal in Codea… and even that isn’t too difficult.

Once your app is made universal in Codea, you just change the WIDTH and HEIGHT to iPhone size and you can see how the game looks at iPhone size.

For example (in the code below just delete the 2 dashes in front of WIDTH and HEIGHT for the device size that you want to test):

PS. What makes it universal is that there are no fixed numbers, everything is relative to WIDTH and HEIGHT.


-- Asteroid Dodger

-- Created by Crumble

displayMode(FULLSCREEN)
supportedOrientations(PORTRAIT_ANY)
function setup()
    -- iphone 4
    --WIDTH=320
    --HEIGHT=480
    -- iphone 5
    --WIDTH=320
    --HEIGHT=568
    ast={}
    ship=readImage("Space Art:Red Ship")
    asteroid=readImage("Space Art:Asteroid Large")
    bg=readImage("SpaceCute:Background")
    astFreq=1.5
    astSpeed=-HEIGHT/114
    score=0 -- starting score
    timer=0
    rectMode(CENTER)
    if readLocalData("HS")== nil then
        saveLocalData("HS", 0)
    end
    music("A Hero's Quest:Battle",true,.5)
    gameState=0
    font("Futura-CondensedExtraBold")
    fontSize(HEIGHT/16)
    fill(0, 255, 0, 255)
    shipX=WIDTH/2
    shipY=HEIGHT/4
end
function spawn()
    table.insert(ast,vec2(math.random(WIDTH/8,WIDTH-WIDTH/8),HEIGHT+HEIGHT/8))
end
function draw()
    if gameState==0 then
        sprite(bg,WIDTH/2,HEIGHT/2,WIDTH,HEIGHT)
        text("PLAY",WIDTH/2,HEIGHT/2)
        if CurrentTouch.state==BEGAN then
            if CurrentTouch.x>WIDTH/2-WIDTH/3 and CurrentTouch.x<WIDTH/2+WIDTH/3
            and CurrentTouch.y>HEIGHT/2-HEIGHT/8 and
            CurrentTouch.y<HEIGHT/2+HEIGHT/8 then
                gameState=1
            end
        end
    end
    if gameState==1 then
        sprite(bg,WIDTH/2,HEIGHT/2,WIDTH,HEIGHT)
        pushStyle()
        text("Score: "..score, WIDTH/2, HEIGHT/1.2)
        popStyle()
    for a,b in pairs(ast) do
        sprite(asteroid,b.x,b.y,WIDTH/4,HEIGHT/4)
        b.y=b.y+astSpeed
    end
    timer=timer+DeltaTime
    if timer>astFreq then
        spawn()
        spawn()
        spawn()
        timer=0 
        end
    for a,b in pairs(ast) do
        if b.y<-HEIGHT/8 then
            table.remove(ast,a)
            score=score+10
        end
    end
    if CurrentTouch.x <= WIDTH / 2 and CurrentTouch.state ~= ENDED and 
        CurrentTouch.state ~= CANCELLED then
            shipX=shipX-WIDTH/64
        end
    if CurrentTouch.x>WIDTH/2 and CurrentTouch.state ~= ENDED and 
        CurrentTouch.state ~= CANCELLED then
            shipX=shipX+WIDTH/64
        end
    sprite(ship,shipX,shipY,WIDTH/12,HEIGHT/10.67)
    for a,b in pairs(ast) do
            if b.y-HEIGHT/10.667<=shipY+HEIGHT/21.33 and
            b.y+HEIGHT/6.4>=shipY-HEIGHT/21.33 and
            b.x-WIDTH/8<=shipX+WIDTH/24 and b.x+WIDTH/8>=shipX-WIDTH/24 then
                gameState=2
            end
        end
    if shipX-WIDTH/24<0 or shipX+WIDTH/24>WIDTH then
            gameState=2
        end
    end
    if gameState==2 then
        sprite(bg,WIDTH/2,HEIGHT/2,WIDTH,HEIGHT)
        text("RETRY",WIDTH/2,HEIGHT/4)
        if score > readLocalData("HS") then
            saveLocalData("HS", score)
            end
        text("Score: "..score, WIDTH/2,HEIGHT/1.2)
        text("HighScore: "..readLocalData("HS"),WIDTH/2,HEIGHT/2)
        if CurrentTouch.state==BEGAN then
            if CurrentTouch.x>WIDTH/2-WIDTH/7.68 and 
            CurrentTouch.x<WIDTH/2+WIDTH/7.68
            and CurrentTouch.y>HEIGHT/4-HEIGHT/16 and 
                CurrentTouch.y<HEIGHT/4+HEIGHT/16 then
                score=0
                gameState=0
                shipX=WIDTH/2
                for i,t in pairs(ast) do ast[i]= nil
                end
            end
        end
    end
end


Ok I won’t complain. Simply changing the width and height variables pretty much yields the same results with the slight inconvenience of a bulky physical object in your hands rather than a more fitting smaller device… I honestly did not think that the WIDTH and HEIGHT variables were alter able. But still, I have a suggestion on how this app could be done. You could make it so that you can create a storage account in your iPad via the codea app. You could upload your projects onto it and make the universal app access that database so that you can run (but not edit) those projects remotely. What I love about this is that you can also make an account for beta testers to use if you wanted to have people test your program on their phones without having to share the code or require them to own an iPad with the app. I mean, I’m not sure how the apple permissions are in terms of data sharing between apps, but idk… I’m just putting that idea out there.

@Paintcannon What do you mean by “storage account?”

I mean like a Dropbox or iCloud account, yet that’s specifically designed to hold onto Codea projects.

That is essentially what testflight does, but you need an apple developer membership.