garmin-connect-seed icon indicating copy to clipboard operation
garmin-connect-seed copied to clipboard

Application is started multiple times

Open srwalter opened this issue 5 years ago • 12 comments

If I put a println in the application's initialize(), onStart(), and onStop() functions, when I run in the simulator I see:

app init app start app init app start

Is this intended behavior? It seems bizarre, and at the very least makes it difficult to follow the execution of the program. Actions like onSelect in the delegate also occur multiple times

srwalter avatar Jul 23 '19 13:07 srwalter

Thanks for submitting this issue. I will take a look at it

danielsiwiec avatar Aug 05 '19 18:08 danielsiwiec

@srwalter I have a difficulty confirming this issue. After running make run I get this output, without the duplication you see: image

danielsiwiec avatar Aug 05 '19 20:08 danielsiwiec

What is the command you run?

danielsiwiec avatar Aug 05 '19 20:08 danielsiwiec

I'm using connectiq-sdk-lin-3.0.12-2019-06-12-77ed6f47e.zip as my SDK on Linux. I'm also targeting the d2bravo for my device. I run:

$ ~/src/connectiq/bin/connectiq & # start simulator $ make # build $ ~/src/connectiq/bin/monkeydo bin/NumberPickerApp.prg d2bravo initialize start initialize start Complete

srwalter avatar Aug 05 '19 23:08 srwalter

I see the same behavior targeting the fenix5s

srwalter avatar Aug 05 '19 23:08 srwalter

You shouldn't need to start the simulator. Can you try again without the simulator being open?

If you do want to run your application in the simulator, do make run and this will start the simulator for you.

danielsiwiec avatar Aug 05 '19 23:08 danielsiwiec

For me that hangs indefinitely. It looks like bin/connectiq runs in the foreground and doesn't exit for me, therefore I never get to the next command (sleep 3) in "make run"

If I modify Makefile to run connectiq in the background, then "make run" works, and it behaves the same as I described above

srwalter avatar Aug 05 '19 23:08 srwalter

I just updated my version of the SDK to match yours, but still can't replicate the problem. What Java version are you using?

Also - can you verify that the hanging you described above is in fact not the application running in the simulator? When I do make run, the application starts in the simulator and the command does 'hang' in the terminal until the application is shut down.

danielsiwiec avatar Aug 07 '19 01:08 danielsiwiec

Java 1.8.0 here

Confirmed. If I run the simulator command from the Makefile, it does not return until I close the simulator window.

srwalter avatar Aug 09 '19 13:08 srwalter

@srwalter this is actually expected - the terminal process will block until you close the simulator. To recap - you don't need to start the simulator manually. When you run make run in the terminal, it will open the simulator with your application and will block the terminal until you close the simulator. Is this what you are seeing?

danielsiwiec avatar Aug 19 '19 16:08 danielsiwiec

Hi Daniel, for me it was working fine with minor adjustments until 3.2.x. It seems now things are a bit different. Can you perhaps have a look? I added additional sleep time, but somehow it still fails sometimes. Connect IQ CLI didn't seem to have changed, so I find this strange. They did add more debugging capability to the simulator so maybe that's related.

Ps: Are you still actively supporting the project? I find the Eclipse SDK very poor, and use this "make" commands together with VSCode for quality of life in ConnectIQ development.

andrezunido avatar Sep 18 '20 19:09 andrezunido

@andrezunido thanks for bringing this up. I'll take a look at this when I get a chance. I do my (poor) best to actively maintain this project and am always open to PRs!

danielsiwiec avatar Oct 08 '20 02:10 danielsiwiec