Discuz! Board

 

 

Search
Discuz! Board Forum Integration Questions speeding up dev/code/run cycle - loading updated .as ...
View: 601|Reply: 7
go

speeding up dev/code/run cycle - loading updated .as files from server

Rank: 2

Post on 2011-10-14 06:16 |All posts
this is about loading updated .as files from server, rather than build + installing a new .apk each time.

my big issue with Papaya is long cycle from code to running.
compiling the .as files is quick, but then building the .apk takes 30s~60s each time.

BUT papaya is able to load just the updated files without a new apk, right?
eg if i compile to main and also put the main.md5 on the server, the old .apk should now load in my updated .as code?

So i tried to get this working but am a bit stuck.

if i take just the new main + main.md5
move to a webserver
now, when i hit the app (2nd time) the md5 is different so the app knows to try and download the main again, which it does.
I see this in webserver log:

192.168.2.45 - - [Tue, 11 Oct 2011 00:38:43 GMT] "GET /main.md5 HTTP/1.1" 200 32 "-" "Dalvik/1.4.0 (Linux; U; Android 2.3.6; Nexus One Build/GRK39F)"
192.168.2.45 - - [Tue, 11 Oct 2011 00:38:43 GMT] "GET /main HTTP/1.1" 200 1178 "-" "Dalvik/1.4.0 (Linux; U; Android 2.3.6; Nexus One Build/GRK39F)"



so great, that looks like the code should be patched. the two files it read were:
   main.md5
then
   main

when i do NOT modify anything, it just checks the md5 hash and doesn't load main. all expected behavior so far.
BUT when i run the app, i see no changes.

so if the client is requesting the files, what is it doing with them?
or, are these partial updates to main just for graphics, and not for code?

----
related question: currently the papaya compile command also builds the apk
$ cat compile.sh

...
  data/exe.macosx-10.6-i386-2.5/r compile $1 $2 $3 $4 $5


is there a command to just do the compile stage?

thanks for help, getting this working would make a big difference!

/dc

Rank: 4

Post on 2011-10-14 16:34 |All posts
All our 3rd party games update scripts from their server. Please double check "Updating Game Scripts" section in manual.pdf.  See if something is omitted. For example, the game.config option "force_update" affects the updating behavior

Rank: 2

Post on 2011-10-15 16:18 |All posts
hi -

I have used force_update. and I can see in the server log, the files are being downloaded.
Also on screen i see for a moment the "updating" message.

I thought it maybe something to do with the webserver, so i switched to just using Apache. but still doesnt work.

192.168.2.45 - - [15/Oct/2011:00:57:41 -0700] "GET /~dc/trav-public/main.md5 HTTP/1.1" 200 32
192.168.2.45 - - [15/Oct/2011:00:57:41 -0700] "GET /~dc/trav-public/main HTTP/1.1" 200 1831

files downloaded, get ignored.

then i tried using your little python http script. one thing i noticed is the files are served as binary whereas apache (osx default config) was serving them as text/plain.
in any case, it doesnt work from your python server either.

so then i did a test and put junk into the main binary file, and hand edited the md5 to force udpate. main gets downloaded, and ignored. so doesnt seem to matter what is in that file.


btw, I noticed these two errors at startup. i am just using the config file from the demo apps, without registering and i guess the social SDK isnt a valid key or sth.

++ ./run.sh -log trav1
Running devices: ['HT018P807128']
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
E/PPYSocial: Offer key should not be null.
E/PPY Offers: Illegal arguments for initWithConfig: java.lang.IllegalArgumentException: ctx and config should NOT be null

there was one other question on my previous mail: is there a way to just compile without building the APK?

So any other ideas what else to check? obviously this works with your other apps, and your own servers, but i am still stuck with a one-minute development cycle (and painful debugging after that). I bet many others have the same problem.

thanks for your help!

/dc

Rank: 4

Post on 2011-10-17 14:41 |All posts
force_update=1,right?And I guess base_url is correct, since Apache log shows it is downloaded.

So you just didn't see it updated? What is your update? If you exit the game and enter again, is the update there?

Can you post your game.config and the part of codes you update?

Just compile, you may run compile.bat, when "Exporting APK" is shown, you can copy the script to your server. Don't need to wait "Exporting APK".

Rank: 2

Post on 2011-10-18 03:12 |All posts
hi -

force_update=1, yes.
my config is below (taken from tutorial app, maybe there is something missing?)
this is working as the updated files do get loaded every time.

btw:
package_name=com.pikkle.trav1
does anything in the actual code have to use this, or is this package only declared in the config.as ?

re changes: I just updated some code to print a different string to the screen.

I tried reloading a few times, no change or update. i understand why you asked this question, had similar issues once with html5 cache manifest...only invlaidates for the next visit. but papaya seems to request the .md5 and in the same session request also the binary file if the hash differs.
  1. script_name=main.as
  2. base_url=http://192.168.2.92
  3. social_key=54SO2c8ZwFLINBtn

  4. orientation=1
  5. package_name=com.pikkle.trav1
  6. app_name=Trav1
  7. tab_name=trav

  8. # download code everytime
  9. force_update=1
Copy
i guess the next thing to do is modify some of the same apps so i can see if the issue is my config/environment or if they don't update either.

Rank: 4

Post on 2011-10-18 15:43 |All posts
I guess you compile the APK by compile.bat trav

Then the problem can be located.  Try compile.bat trav release.
Input some info and build a release version.

All 3rd party games start using the updating when the games are published, so they didn't encounter this and we almost forget about the trick.

We will consider make this available for debug in next release

Rank: 4

Post on 2011-10-18 15:54 |All posts
You can add bundle_script=0 in game.config now. Then the update will work.

We will look for better solutions in future release.

Rank: 2

Post on 2011-10-21 04:48 |All posts
fantastic! that worked! so now the development loop can be very fast.

one thing - it is kind of a hack to have to interrupt the "building apk" stage every time, so some way to just compile without doing .apk would be great!
Security Q&A Change Security code Change

Archiver|Comsenz Inc.

All time is GMT+8, 2013-5-23 00:44 , Processed in 0.032012 second(s), 10 queries .

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.