mobilepick photo android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
gnor
Posts: 53
Joined: Fri May 08, 2020 10:32 pm

mobilepick photo android

Post by gnor » Fri Mar 18, 2022 12:55 pm

Hi everyone!

Need some advice of my code. I have a stack with several cards, no substacks at all, so it is seems to be simple.?!
On card there are two buttons on card "base" : Camera and Save.

The code of the Camera Button:
on mouseUp pMouseButton

SET THE NAME OF THE TEMPLATEIMAGE TO "THE_IMAGE"
set the width of the templateImage to 640
set the height of the templateImage to 360
SET THE visible of the templateImage TO false

mobilePickPhoto "camera"

if the result is text then
put the result into field "Result"
else
set the text of image "pic" to the text of the image "THE_IMAGE" of this card
set the width of image "pic" of this card to 640
set the height of image "pic" of this card to 360
SET THE VISIBLE OF IMAGE "pic" TO TRUE
RESET THE TEMPLATEIMAGE OF THIS CARD
end if
end mouseUp

The code of the "save button:
on mouseUp pMouseButton

CALL CHECKDBCONN OF CARD "SPLASHCARD"
INSERTPIC
CALL CLOSEDBCONN OF CARD "SPLASHCARD"

PUT EMPTY INTO IMAGE "pic"
SET THE VISIBLE OF IMAGE "pic" TO FALSE

DELETE IMAGE "THE_IMAGE" OF CARD "CAMERA"
DELETE THE LAST IMAGE OF THIS CARD
end mouseUp

I did not copy the insertpic handler, because i'm able to take picture, then able to save it. But trying my second chance to hit Camera button, also able to take picture, but when hit the "ok" button on android camera, i never get back to the card base. Instead it takes me to the first card of the stack, the wery first one what the ide created when started the new project.
Is anybody has a clue what is happenning? Spend 3 days so far but no result...
Thanks

simon.schvartzman
Posts: 641
Joined: Tue Jul 29, 2014 12:52 am
Location: Brazil

Re: mobilepick photo android

Post by simon.schvartzman » Sat Mar 19, 2022 5:47 pm

Hi gnor, I don't know the answer to your issue but a workaround would be to add

Code: Select all

 go to card "the_name_of_the_card_you_wanto_to_go_to"
before

Code: Select all

end mouseUp
just an idea for you to move forward...

Best!
Simon
________________________________________
To ";" or not to ";" that is the question

gnor
Posts: 53
Joined: Fri May 08, 2020 10:32 pm

Re: mobilepick photo android

Post by gnor » Sat Mar 26, 2022 7:42 am

Thank you for your response, sorry for the delay of mine.

I have riched the same solution, on android 11 it is works for 5 case, on the sixth it drops you out for some reason.
For the time beeing, it will work for me.

Thanks again

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: mobilepick photo android

Post by Klaus » Sat Mar 26, 2022 9:02 am

Hi gnor,

some little hints:
1. No need to write "... of this cd".
LC always presumes that you are referring to objects on the currenct cards.

2. "the templateimage" (and all other templatexxx) is a global thing, so do not write "... the templateimage of this cd".


Best

Klaus

gnor
Posts: 53
Joined: Fri May 08, 2020 10:32 pm

Re: mobilepick photo android

Post by gnor » Mon Mar 28, 2022 4:25 pm

Thanks Klaus!

Good to know avout template thingies...
Thank you

Post Reply

Return to “Android Deployment”