marwan mostakim

unread,
Mar 18, 2014, 9:22:31 PM3/18/14
to mitappinv...@googlegroups.com
Hi, my app is 1.6 mega 13 small Sprite, but very slow and lagging,  not when i am building the app, but is lagging after i install the app on the phone.

I am trying to attach the Apk but I get " Invalid credentials (missing or invalid oAuth token) "

dose any one have that issue, my phone is a G2

Thank you.
Marwan

Enis

unread,
Mar 18, 2014, 9:52:33 PM3/18/14
to mitappinv...@googlegroups.com
This is just a shot in the dark, but how much memory is available on your G2?  It shouldn't run any slower on a device... if anything, much faster.

Check your memory stuff to be sure...

marwan mostakim

unread,
Mar 18, 2014, 10:09:04 PM3/18/14
to mitappinv...@googlegroups.com

Can you please check the file, i was able now to upload it.

I have 600 MB free memory.
bounce_copy (2).apk

Enis

unread,
Mar 18, 2014, 10:29:26 PM3/18/14
to mitappinv...@googlegroups.com
Usually, we don't try out apks unless they're asked for, but I tried yours and while it's a bit slow on my very cheap tablet, it works.  You probably have a problem in your code... maybe your timer interval is wrong.  There's no way to tell unless you post some screenshots of your blocks.  Please don't post the AIA file unless requested to do so.

Check your timer interval...  Did you follow the tutorial exactly?

marwan mostakim

unread,
Mar 18, 2014, 11:09:34 PM3/18/14
to mitappinv...@googlegroups.com
I figured it out, see attached, the change of images of the Sprite is the issue, how can this be improved.

Thank you
procedure.PNG

SteveJG

unread,
Mar 19, 2014, 8:51:16 AM3/19/14
to mitappinv...@googlegroups.com
Here is something to try.   I do not know if it will fix the issue or not.  Perhaps change the Clock setting.     TimerInterval is now probably 1000 ms (1 second).     Try changing it to higher or lower values     set Clock1.TimerInterval to     2000   or 50

Also, you might change the order of the blocks in the THEN part of the IF statement.

I notice you request a random integer from any number from screen width to imagesprite1.width.  That forces an update, redraw one pixel at a time.  Do you require such fine image control?

Another suggestion, unrelated  your slowness issue  you might call   random set seed to   random integer from 1 to 100  in your screen initialize block, if you want the game to start differently for each game.
 
Regards,
Steve

Taifun

unread,
Mar 19, 2014, 12:33:13 PM3/19/14
to mitappinv...@googlegroups.com
in App Inventor we do event driven programming instead of procedural programming
which means, instead of using a clock to check, if something happened, just use the events to trigger an action, in your case the ImageSprite.CollidedWith event

also take a look at the tutorials...

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.                

marwan mostakim

unread,
Mar 19, 2014, 4:32:45 PM3/19/14
to mitappinv...@googlegroups.com


On Wednesday, March 19, 2014 8:51:16 AM UTC-4, SteveJG wrote:
Here is something to try.   I do not know if it will fix the issue or not.  Perhaps change the Clock setting.     TimerInterval is now probably 1000 ms (1 second).     Try changing it to higher or lower values     set Clock1.TimerInterval to     2000   or 50

Also, you might change the order of the blocks in the THEN part of the IF statement. When i removed the image change and set it from Design, the  slowness vanished.

I notice you request a random integer from any number from screen width to imagesprite1.width.  That forces an update, redraw one pixel at a time.  Do you require such fine image control?  No, but i want the Sprite to drop from random X, this was in the Golf Tutorial.

Another suggestion, unrelated  your slowness issue  you might call   random set seed to   random integer from 1 to 100  in your screen initialize block, if you want the game to start differently for each game. Will check it out  
 
Regards,                  Thank You
Steve

marwan mostakim

unread,
Mar 19, 2014, 4:44:57 PM3/19/14
to mitappinv...@googlegroups.com
Thank you for the advise, and understand your suggestion, but in the image attached, if i have 12 Sprites, this will make me have 7x5 = 35 Events, i need a matrix, would appreciate the advise. and forgive me if i did not have this image from before. 

In my first post i wanted to change the image when collide, and this is what is causing the slowness, when i removed the image change, it worked fine. i have the app attached, you might like the idea.

Now i need to fix the shooting bullets to stagger with interval, i think i might need to add another clock.

Thank You
procedure1.PNG
bounce_copy (3).apk

Taifun

unread,
Mar 19, 2014, 6:12:56 PM3/19/14
to mitappinv...@googlegroups.com
if you have 12 image sprites, you have 12 collided with events
you can call a custom procedure in each event and put your logic there
Taifun

Enis

unread,
Mar 26, 2014, 12:21:40 AM3/26/14
to mitappinv...@googlegroups.com
No response... Issue closed...
Reply all
Reply to author
Forward
0 new messages