to make my application I am using tier 1, agk v10811 (beta). this is the script I have used:
SetDisplayAspect( 0.61 )
//load images
background = loadimage ("background.png")
bodybox = loadimage ("bodybox.png")
send = loadimage ("send.png")
subjectbox = loadimage ("subjectbox.png")
//create sprites
dim sprites[4] as integer
sprites[1] = createsprite (background)
sprites[2] = createsprite (bodybox)
sprites[3] = createsprite (send)
sprites[4] = createsprite (subjectbox)
//set sizes
setspritesize (sprites[1],100,100)
setspritesize (sprites[2],90,-1)
setspritesize (sprites[3],20,-1)
setspritesize (sprites[4],90,-1)
//set positions
setspriteposition (sprites[1],0,0)
setspriteposition (sprites[2],5,33)
setspriteposition (sprites[3],77,70)
setspriteposition (sprites[4],5,18)
//rem store text
body$ = ""
subject$ = ""
//rem make variable to differentiate between text inputs
texttype = 0
//rem make the text input visible
text = createtext (body$)
settextcolor (text,0,0,0,255)
settextsize (text,3)
settextposition (text,7,35)
settextmaxwidth (text,88)
//rem make the text input visible
text2 = createtext (subject$)
settextcolor (text2,0,0,0,255)
settextsize (text2,3)
settextposition (text2,7,20)
settextmaxwidth (text2,88)
do
// check for waiting for input
if texttype > 0
// check for input done
if GetTextInputCompleted()
// store in correct string and update display
if texttype = 1
body$ = GetTextInput()
settextstring (text,body$)
else
subject$ = GetTextInput()
settextstring (text2,subject$)
endif
// clear the text input flag
texttype = 0
endif
else
// check for pointer pressed
if GetPointerReleased()
// get the pointer
x# = GetPointerX()
y# = GetPointerY()
// figure out what was pressed
// check for subject first
if GetSpriteHitTest(sprites[4],x#,y#)
// set input type and start input
texttype = 2
StartTextInput()
elseif GetSpriteHitTest(sprites[2],x#,y#)
// set input type and start input
texttype = 1
StartTextInput()
elseif GetSpriteHitTest(sprites[3],x#,y#)
// time to send the message
openbrowser("mailto:novaappz@gmail.com?subject="+HTTPEncode(subject$)+"&body="+HTTPEncode(body$))
endif
endif
endif
Sync()
loop
I have used eclipse and set it up as explained in the agk documentation. I have ran the application using the emulator and then taken the apk file from the folder names 'bin' and installed it via dropbox onto a Samsung galaxy note and a htc sensation.
-this is your reworked code
kirtnicholls