Android Svreenshot Utility - what's wrong with my code

Discuss any general programming issues here
Post Reply
p-OS
Posts: 167
Joined: Mon Nov 01, 2010 11:56 pm

Android Svreenshot Utility - what's wrong with my code

Post by p-OS »

I wrote a tiny screengrabber Utility for Android 8.1

When running I don't get any error Messages, but also no result: mydesktop.png is not created…
I wonder what might be wrong with my code ?

Code: Select all

@FILE 1,"dummy.jpg",{link=True}
@DISPLAY {hidden=True}
Wait(500)
mybrush=GrabDesktop(Nil)
SaveBrush(mybrush,"/storage/emulated/0/Download/mydesktop.png",#NOTRANSPARENCY,#IMGFMT_PNG)
Line 1: link some binary trash to my applet as the APK Compiler refuses to compile applets with small sizes.
LIne 2: don't open a Display (Hollywood SplashScreen appears however)
Line 3: Wait 10 seconds
Line 4: Grab the Screen to a Brush; GrabDesktop is not listet as non-supported command in mobile section of the Manual
Line 5: Write Brush to a PNG file; /storage/emulated/0/Download/ exists and has permissions drwxrwx--- and owner root.

I don't know however which is the Default os user for running non-root applications and if if this user is in the same group as root
I chose Dowload/ as it is used by serveral 3rd Party apps already which seem to be able to write to this dir.
zylesea
Posts: 227
Joined: Tue Feb 16, 2010 12:50 am
Location: Westfalen/Germany
Contact:

Re: Android Svreenshot Utility - what's wrong with my code

Post by zylesea »

IIRC Android above V6 does not easily allow to write to other directories than the progdir. Since a while I put all my data to progdir only (on Android). Try saving to progdir and look wheter the grab gets saved.

And for a screenshot utility I'd suggest using SaveSnapshot(f$[, mode, fmt, table]).
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Android Svreenshot Utility - what's wrong with my code

Post by airsoftsoftwair »

Nothing wrong with that code. Problem is that Hollywood doesn't support taking screenshots on Android. And it's also not possible to start Hollywood in "hidden" mode on Android...
Post Reply