Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Image file compatibility checker - if your BMP PNG or JPG won't load (and Pause code too)

Author
Message
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 10th Jan 2013 09:06
Hi folks!

In response to a few little bumps I've run into whilst familiarizing myself with AppGameKit I've created a simple utility that helps you test your image files on whatever platforms you have available.

The program works like this: simply put your images in the media directory or a subdirectory of the media directory and broadcast the app to your device(s). Then sit back and watch the images be displayed. You can tap/click the screen to pause on any image so you have a chance to write down the file name.

This program also includes a nice Pause() function that I had to work out. Apparently the Sleep() function really interferes with user input (obvious once you know it...) so I had to write my own little delay routine in this too. It simply measures the time differential in a loop while checking for the Pause() input. It might be helpful to some. If someone has a more elegant solution, I'd love to see it as I'm not necessarily a sophisticated coder

I have plans to either expand this to test audio files as well or write out a separate utility for it. Though I probably won't unless motivated by issues like this.

At any rate I hope this is helpful to others in the community.

Cheers!




Nexus 7 (Jelly Bean 4.1.2) -- HTC Droid Incredible 2 (Gingerbread 2.3.?) -- Motorola Droid X (Gingerbread 2.3.4)
Willing to test for you!

Attachments

Login to view attachments
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 10th Jan 2013 09:56
Nice!

file_extension$ = lower(GetStringToken(file$,".",2))

will fail if the file name has more than one point character, which is legal. The fastest way is to scan the string backwards until you reach a dot.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 10th Jan 2013 19:48 Edited at: 10th Jan 2013 19:48
Quote: "The fastest way is to scan the string backwards until you reach a dot."

Or..

Use CountStringTokens() and pull that token in as the extension.

file_extension$ = lower(GetStringToken(file$,".",CountStringTokens(file$,".")))
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 10th Jan 2013 22:55
Or, in Delphi or FPC:

ext := ExtractFileExt(filename);

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 10th Jan 2013 23:49
Thanks for the suggestions, guys.
I'll include that enhancement in the next version. I'd likely use Marl's method.

Nexus 7 (Jelly Bean 4.1.2) -- HTC Droid Incredible 2 (Gingerbread 2.3.?) -- Motorola Droid X (Gingerbread 2.3.4)
Willing to test for you!

Login to post a reply

Server time is: 2024-05-03 18:58:46
Your offset time is: 2024-05-03 18:58:46