ANSWERED: mobilePickPhoto "camera" is a bit slow -15 seconds

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

ANSWERED: mobilePickPhoto "camera" is a bit slow -15 seconds

Post by BarrySumpter » Tue Apr 03, 2012 12:06 pm

It's taking about 15 to 20 seconds for the Android camera to return with a pic.

update:
So once the camera is up n running (almost immediately) and I take a pic and I click the OK button.
It takes 15 seconds with a black screen before returning to my app with the pic.

Is this happening to anyone else?

Is there a way to speed this up?
Last edited by BarrySumpter on Tue Apr 03, 2012 6:56 pm, edited 2 times in total.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: mobilePickPhoto "camera" - is a bit slow - 15 seconds

Post by Jellicle » Tue Apr 03, 2012 1:09 pm

Yup. Get an iPhone :)

g
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Gene
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 75
Joined: Wed Mar 09, 2011 6:48 pm
Location: Northern California

Re: mobilePickPhoto "camera" - is a bit slow - 15 seconds

Post by Gene » Tue Apr 03, 2012 6:08 pm

Jellicle wrote:Yup. Get an iPhone :)

g
Hi Barry,

Sure...get an iPhone, if you can get certified to buy it, a key from Apple make unlock the unit, and their written blessing to look at it. :shock:

To get get on to your question, my Motorola Electrify with 2.3.3 launches the camera in about two to three seconds.

As an aside, for what it's worth, I had a devil of a time trying to make it come up, even in a simple test using mobilePickPhoto( "camera"). I have brought up the camera before successfully, so this surprised me. After verifying the syntax (my first suspect), I fiddled with the Standalone settings, and then whether or not the phone was connected to USB. It appears you can't test the camera or album with the USB connected, since apparently that disables connectivity to the SD card.

Anyway, the phone worked for me with the USB disconnected, and camera ticked as "Required," "Write External Storage" and "Camera" ticked in Application Permissions. I don't know how much of this ways necessary, since I'm moving on now, but I thought I would include my experience with making the camera work on my phone.

Bottom line, again, is camera launch with a bare bones stack= 2 or 3 seconds.

Have a productive day - Gene
Last edited by Gene on Tue Apr 03, 2012 7:15 pm, edited 1 time in total.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: mobilePickPhoto "camera" - is a bit slow - 15 seconds

Post by BarrySumpter » Tue Apr 03, 2012 6:41 pm

update: So once the camera is up n running (almost immediately) and I take a pic and I click the OK button.
It takes 15 seconds with a black screen before returning to my app with the pic.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: mobilePickPhoto "camera" - is a bit slow - 15 seconds

Post by BarrySumpter » Tue Apr 03, 2012 6:52 pm

Thanks Gene,

The required tick is just for documenting the install requirements.

"It appears you can't test the camera or album with the USB connected, since apparently that disables connectivity to the SD card."

Yeah. good call.
Unplugging the USB reduces the time to 4 or 5 seconds.
Much better but still a little long for me.
But acceptable for now.

I wonder if there is a setting in Android to adjust this behaviour?

Is there a wireless bridge for testing physical devices with LC IDE?

Thanks again.

P.S. I have two iPhone users in the family.
Neither want to relinquish their phones to allow me to test.
I don't want to pay $100 just to test on the iPhone at this stage.
NS Basic uses HTML5 and doesn't require Apple approval.
I wonder if RR would consider a HTML5 bridge to test for unregistered Apple developers.
Last edited by BarrySumpter on Mon Apr 16, 2012 8:43 pm, edited 1 time in total.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Gene
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 75
Joined: Wed Mar 09, 2011 6:48 pm
Location: Northern California

Re: ANSWERED: mobilePickPhoto "camera" is a bit slow -15 sec

Post by Gene » Tue Apr 03, 2012 7:14 pm

Hi Barry,

I agree with you that 4-5 seconds is still a bit of a stretch, since I just read a tech journal article that claimed to have tested user responses for Internet/computer applications, and people get anxious if response times exeed a second or so.

Not to belittle your phone at all, but the Electrify really did "electrify" me when I first got it. My first Android was a Samsung Activivate, which made me fall in love with Android, but not the speed of the system. Afterwards, the Electrify was shockingly faster than my old phone, but I don't know how that comes into play with regard to the amout of time to access things like the camera through LC (or any other app, for that matter). I still have the Samsung, so I think I'll run the simple camera app I built on it and see if it is slower or not. Goodness knows, the Samsung ran everything else at a snail's pace. I still loved, though!

-Gene

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: ANSWERED: mobilePickPhoto "camera" is a bit slow -15 sec

Post by BarrySumpter » Tue Apr 03, 2012 7:32 pm

I'm using the HTC HD2.
Absolutely the best phone.
4.3" screen.
So many ROMs increase the phones logevity.
I think its my 3rd year and still one of the best phones out there.
I've been using Dorimanix roms.
(He's left a day to two ago to build ROMs for SGSIIs now.)
Tweeked to miliseconds of its life.
Everything runs super smooth, super fast, with super low battery drain.

I'd be interested to know if any other phone can beat the 4-5 second camera return time.
Except for the iPhone. :P Not really. Yes, I'd like to know if the iPhone is faster. LOL.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Gene
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 75
Joined: Wed Mar 09, 2011 6:48 pm
Location: Northern California

Re: ANSWERED: mobilePickPhoto "camera" is a bit slow -15 sec

Post by Gene » Tue Apr 03, 2012 7:35 pm

Sorry - I think I misread your original question somewhat. I thought were describing the amount of time it took for the camera to launch, when I guess you were talking about the interval (black screen) between taking the picture and having it reappear on the screen. For me, that is stil just a couple of seconds.

Gene

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: ANSWERED: mobilePickPhoto "camera" is a bit slow -15 sec

Post by BarrySumpter » Tue Apr 03, 2012 8:25 pm

Found ADBWireless on the market.

I can connect adb wirelessly super easy
and test my physical device
takes a few secs longer to install a simple app
but no help with the camera return
with a pic speed at 8 9 secs.
Bummer. :cry:
Last edited by BarrySumpter on Mon Apr 16, 2012 8:45 pm, edited 1 time in total.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: ANSWERED: mobilePickPhoto "camera" is a bit slow -15 sec

Post by BarrySumpter » Thu Apr 05, 2012 12:42 am

Gene wrote:Sorry - I think I misread your original question somewhat. I thought were describing the amount of time it took for the camera to launch, when I guess you were talking about the interval (black screen) between taking the picture and having it reappear on the screen. For me, that is stil just a couple of seconds.
Gene
Righto! No Prob.
Thanks for the support.
Much appreciated.

Spent some time sorting out return times based on scripting and found this while Testing with LC IDE.

Code: Select all

on mouseUp
   
   set the height of templateimage to the height of image The_Image
   set the width of templateimage to the width of image The_Image
   
   set the left of the templateimage to "0"
   set the top of the templateimage to "0"
   
   set the lockloc of the templateimage to true  
   set the visible of the templateimage to false   
   
    
   mobilePickPhoto "camera"     -- using min n max params or not doesn't affect return time
   
   -- Check THE RESULT for an error
   if THE RESULT is NOT EMPTY then  -- an Error has been Returned
      
      -- Not successful
      put "Error:" && THE RESULT into field "lblThe_Result"
      exit mouseup
      
   end if
   
   put "All OK" into field "lblThe_Result"   
   
   set the imagedata of image The_Image to the imagedata of image The_Image   -- using this adds about 2 seconds to return time
   -- put LAST IMAGE into image The_Image   -- distorted  ???
   export snapshot from LAST IMAGE to image The_Image as PNG    -- I feel this is faster
   
   -- delete LAST IMAGE   -- using this adds about 2 to 3 secs to return time
   
   
end mouseUp
All of these timing notes are rendered moot when I fire the app from a shortcut on the Android.
Where I'm getting consistant 4 secs return times no matter the script or whether usb is plugged in.

So it looks like if I'm concerned with timing issues to test from a shortcut and not directly from IDE test.

Your results may vary.

hth
Last edited by BarrySumpter on Thu Apr 05, 2012 2:22 am, edited 1 time in total.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Location: Thailand
Contact:

Re: ANSWERED: mobilePickPhoto "camera" is a bit slow -15 sec

Post by dave_probertGA6e24 » Thu Apr 05, 2012 1:34 am

Hi Barry,

Don't know anything about Android (yup - I'm an Apple person) - though I read most posts getting myself ready for Android development and seeing the possible problems (and your posts are pretty useful there!)

Just looking at your code snippet though...

Code: Select all

   set the imagedata of image The_Image to the imagedata of image The_Image   -- using this adds about 2 seconds to return time
   -- put LAST IMAGE into image The_Image   -- distorted  ???
   export snapshot from LAST IMAGE to image The_Image as PNG    -- I feel this is faster
Do you actually do the first line above? And if so - why? It seems that you are putting the data from the image back into itself for some reason. And therefore you are wasting those 2 seconds (or whatever)

On a test App I did (on an iPhone admittedly) I used this code - result is almost immediate:

Code: Select all

  iPhonePickPhoto "library" 
  if the result is empty then
    set the text of image "output_image" to the text of the last image  // copy the camera image to my safe image
    delete the last image
  end if
Note the line about setting the 'text' - that seems to work faster than dealing with the imageData.

Hope that helps a bit.

Cheers,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: ANSWERED: mobilePickPhoto "camera" is a bit slow -15 sec

Post by BarrySumpter » Thu Apr 05, 2012 2:15 am

Hi Dave,

Thanks fo replying.
LiveCode for iPhone and LiveCode for Android are cross platform compatible.
Lots of new things in LC4Android have been in LC4iOS for quite some time.
So if any Apple peeps have something positive and constructive to contribute,
then please do and your comments are most Welcome!

Bernd has been gracious enought to assist in creating transparent png images for use on maps.

One of Bernds post surprised me with something I hadn't seen before:
bn wrote: ...
Once you downsize an image and you then code:

Code: Select all

set the imageData of image "myDownSizedImage" to the imageData of image "myDownSizedImage"
you make the new size permanent and there is no need to lock size and position anymore. And you save a little space.
...
I see in the dictionary that imageData has been around since v1.1

And stumbled over the same script line here:

how-to-create-a-thumbnail-image
http://lessons.runrev.com/s/lessons/m/4 ... nail-image

While looking for ways to resize the image without becoming skewed or stretched or shrunk in one direction or another.


This is the first sample app in which I use this script line and my finding under the LC IDE Test button.
As I mentioned above the speed tests are rendered moot when executing my app from a shortcut instead of the IDE.

----

I'll test the 'text of image' script now and post back.
OK, tested on my phone I find no difference in speed.
But certainly appreciate the suggestion.

Thanks heaps!

I'm wondering if the improved graphics architecture for acceleratedRendering would help?

Code: Select all

on preOpenstack
   
   set the acceleratedRendering of this stack to true

end preOpenstack
Don't see any speed increase on my phone.

And found this:
The acceleratedRendering Property

The acceleratedRendering property is a shorthand way of setting several LiveCode graphics rendering properties to values that are optimal for the current platform your stack is running on. (See the LiveCode Dictionary entry for more details.

Using this property is straightforward. In a preOpenCard or preOpenStack handler simply include this statement:

set the acceleratedRendering of this stack to true

Note that in some cases the acceleratedRendering property is not appropriate; for instance on cards that have no changing or movable objects. Long-time LiveCode developer Jacqueline Landman Gay posted this to the Use-LiveCode mailing list:

"If you move to a card that has no dynamic objects anywhere, set the acceleratedRendering to false. Trying to dynamically render a non-dynamic card is very slow. When you go back to a card with draggable objects, set it back to true. My app only has one dynamic card, so I just turn off rendering on closecard and back on again in preOpenCard."
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Location: Thailand
Contact:

Re: ANSWERED: mobilePickPhoto "camera" is a bit slow -15 sec

Post by dave_probertGA6e24 » Thu Apr 05, 2012 2:48 am

Hi Barry,

I didn't know about the downsize image locking tip - nice :)

Sorry to hear that the text option didn't speed things up. I'm sure there must be some setting or whatever that will improve it. I really can't understand how the process could be so slow on the device - I would think the hardware and OS can handle things Ok. I assume that all other programs you use (with the camera) return images nice and quickly.

If I think of anything else that might help I will post it here. If you have any success too then I would also be interested, because my current App-in-Development (AiD !) uses the camera and it will be nice to also get it available on the Android market once it is finished.

Cheers,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

Post Reply

Return to “Android Deployment”