[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2016-09-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15483517#comment-15483517
 ] 

ASF GitHub Bot commented on CB-8684:


Github user rejhgadellaa commented on the issue:

https://github.com/apache/cordova-android/pull/173
  
Hi, quick question: is this change just for plugins or can I hook into the 
onStart and onStop events in javascript as well? Because with Nougat apps need 
to be able to know if they stopped (not visible) or might be in split view but 
not focused (paused). In the latter case the app should probably still refresh 
its UI and such.


> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Android
>Reporter: Tony Homer
>Assignee: Andrew Grieve
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2016-08-31 Thread Roderick Gadellaa (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15452741#comment-15452741
 ] 

Roderick Gadellaa commented on CB-8684:
---

Hey it looks like this was fixed in 2015 but I can't find any documentation 
about this in cordova 6.3.1 (latest)?

> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Security Level: Public(Anyone can view this level - this is the 
> default.) 
>  Components: Android
>Reporter: Tony Homer
>Assignee: Andrew Grieve
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14491213#comment-14491213
 ] 

ASF GitHub Bot commented on CB-8684:


Github user svranch commented on the pull request:

https://github.com/apache/cordova-android/pull/173#issuecomment-91933619
  
unsubscribe

 

Sandi Laufenberg 

Cell  425.633.7888

sa...@ladysword.biz  

Portfolio:   www.LadySword.com  

 

 

From: tony-- [mailto:notificati...@github.com] 
Sent: Wednesday, April 8, 2015 5:18 PM
To: apache/cordova-android
Subject: Re: [cordova-android] fix CB-8684 - support onStart/onStop 
lifecycle events in plugins for Android (#173)

 

I think I made changes that address all of your comments. Thanks for the 
feedback.

—
Reply to this email directly or view it on GitHub 
 .  

 




> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Andrew Grieve
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-09 Thread Tony Homer (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14487536#comment-14487536
 ] 

Tony Homer commented on CB-8684:


In the original commit I pushed which used LifeCyclePluginTestActivity, I was 
loading a page and the booleans were behaving as expected, otherwise my tests 
would not have passed.  
Maybe my page loading was not really working - I was doing it directly in 
LifeCyclePluginTestActivity instead of in the Test (by dispatching an intent 
via setUpWithStartUrl)???
Either that or I must have broken something when I was cleaning up based on 
your code review input.
Anyway, sorry you had to spend more time tweaking and thanks for the assist.

CB-8827 makes sense!

> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Andrew Grieve
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-08 Thread Andrew Grieve (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14486511#comment-14486511
 ] 

Andrew Grieve commented on CB-8684:
---

Merged it in! Just made a couple of small changes:
- Tweaked the test code to load a test page (calling setUpWithStartUrl)
- Shortened it a bit by using strings
 - Root issue here is that once a page is loaded in setUp, all the booleans got 
set to true before the test even ran!

Also inspired me to do https://issues.apache.org/jira/browse/CB-8827

> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Andrew Grieve
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14486497#comment-14486497
 ] 

ASF GitHub Bot commented on CB-8684:


Github user tony-- commented on the pull request:

https://github.com/apache/cordova-android/pull/173#issuecomment-91084720
  
Whoops, forgot to remove LifeCyclePluginTestActivity from the manifest.  
Thanks for catching it!


> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Andrew Grieve
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14486422#comment-14486422
 ] 

ASF GitHub Bot commented on CB-8684:


Github user asfgit closed the pull request at:

https://github.com/apache/cordova-android/pull/173


> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14486420#comment-14486420
 ] 

ASF subversion and git services commented on CB-8684:
-

Commit a652d892ca93d077038310af50d2a40ab5fabfd6 in cordova-android's branch 
refs/heads/master from [~tony--]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;h=a652d89 ]

CB-8684 Add onStart/onStop hooks for plugins (close #173)


> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14486189#comment-14486189
 ] 

ASF GitHub Bot commented on CB-8684:


Github user tony-- commented on the pull request:

https://github.com/apache/cordova-android/pull/173#issuecomment-91052668
  
I think I made changes that address all of your comments.  Thanks for the 
feedback.


> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14486172#comment-14486172
 ] 

ASF GitHub Bot commented on CB-8684:


Github user tony-- commented on a diff in the pull request:

https://github.com/apache/cordova-android/pull/173#discussion_r28019036
  
--- Diff: framework/src/org/apache/cordova/CordovaActivity.java ---
@@ -95,6 +95,9 @@ Licensed to the Apache Software Foundation (ASF) under one
 protected ArrayList pluginEntries;
 protected CordovaInterfaceImpl cordovaInterface;
 
+//flag for case when appView is null during onStart
+private boolean shouldHandleStartOnAppViewInit = false;
--- End diff --

My tests pass without it.  I'll remove it.  I'll also remove the similar 
flag from CordovaWebViewImpl.


> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14486164#comment-14486164
 ] 

ASF GitHub Bot commented on CB-8684:


Github user tony-- commented on a diff in the pull request:

https://github.com/apache/cordova-android/pull/173#discussion_r28018642
  
--- Diff: 
test/androidTest/src/org/apache/cordova/test/CordovaPluginTest.java ---
@@ -0,0 +1,126 @@
+
+package org.apache.cordova.test;
+
+/*
--- End diff --

Whoops!  I used one of the other tests as a template - the package is above 
the copyright in all of them.  I'll move it regardless.


> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14485964#comment-14485964
 ] 

ASF GitHub Bot commented on CB-8684:


Github user tony-- commented on a diff in the pull request:

https://github.com/apache/cordova-android/pull/173#discussion_r28010484
  
--- Diff: 
test/androidTest/src/org/apache/cordova/test/CordovaPluginTest.java ---
@@ -0,0 +1,126 @@
+
+package org.apache.cordova.test;
+
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+import android.app.Activity;
+import android.test.ActivityInstrumentationTestCase2;
+
+import org.apache.cordova.CordovaWebView;
+
+import java.io.IOException;
+import java.lang.reflect.Method;
+
+public class CordovaPluginTest extends 
ActivityInstrumentationTestCase2 {
+
+public static String TAG = "CordovaPluginTest";
+protected LifeCyclePluginTestActivity testActivity;
+protected LifeCyclePlugin testPlugin;
+protected CordovaWebView cordovaWebView;
+
+@SuppressWarnings("deprecation")
+public CordovaPluginTest() {
+
+super("org.apache.cordova.test", 
LifeCyclePluginTestActivity.class);
+}
+
+protected void setUp() throws Exception {
+super.setUp();
+testActivity = getActivity();
+cordovaWebView = testActivity.getCordovaWebView();
+testPlugin = 
(LifeCyclePlugin)cordovaWebView.getPluginManager().getPlugin("LifeCycle");
+}
+
+private void invokeBlockingCallToLifeCycleEvent(final String 
lifeCycleEventName) {
+final CordovaPluginTest me = this;
+final Activity activity = this.testActivity;
+Runnable blockingRunnable = new Runnable() {
+public void run() {
+try {
+Method method = 
me.getInstrumentation().getClass().getMethod(lifeCycleEventName, 
Activity.class);
+method.invoke(me.getInstrumentation(), activity);
+} catch (Exception e) {
+fail("An Exception occurred in 
invokeBlockingCallToLifeCycleEvent while invoking " + lifeCycleEventName);
+}
+me.getInstrumentation().callActivityOnStart(testActivity);
+synchronized(this)
+{
+this.notify();
+}
+}
+};
+synchronized( blockingRunnable ) {
+testActivity.runOnUiThread(blockingRunnable);
+try {
+blockingRunnable.wait();
--- End diff --

I wasn't sure how to do it.  I looked over the docs and didn't see 
anything.  I'll read the doc for getInstrumentation().waitForIdleSync(); and 
switch.


> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk

[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14485942#comment-14485942
 ] 

ASF GitHub Bot commented on CB-8684:


Github user tony-- commented on a diff in the pull request:

https://github.com/apache/cordova-android/pull/173#discussion_r28009491
  
--- Diff: 
test/androidTest/src/org/apache/cordova/test/CordovaPluginTest.java ---
@@ -0,0 +1,126 @@
+
+package org.apache.cordova.test;
+
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+import android.app.Activity;
+import android.test.ActivityInstrumentationTestCase2;
+
+import org.apache.cordova.CordovaWebView;
+
+import java.io.IOException;
+import java.lang.reflect.Method;
+
+public class CordovaPluginTest extends 
ActivityInstrumentationTestCase2 {
+
+public static String TAG = "CordovaPluginTest";
+protected LifeCyclePluginTestActivity testActivity;
+protected LifeCyclePlugin testPlugin;
+protected CordovaWebView cordovaWebView;
+
+@SuppressWarnings("deprecation")
+public CordovaPluginTest() {
+
+super("org.apache.cordova.test", 
LifeCyclePluginTestActivity.class);
+}
+
+protected void setUp() throws Exception {
+super.setUp();
+testActivity = getActivity();
+cordovaWebView = testActivity.getCordovaWebView();
+testPlugin = 
(LifeCyclePlugin)cordovaWebView.getPluginManager().getPlugin("LifeCycle");
+}
+
+private void invokeBlockingCallToLifeCycleEvent(final String 
lifeCycleEventName) {
+final CordovaPluginTest me = this;
--- End diff --

Ok.


> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response wa

[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14485939#comment-14485939
 ] 

ASF GitHub Bot commented on CB-8684:


Github user agrieve commented on a diff in the pull request:

https://github.com/apache/cordova-android/pull/173#discussion_r28009343
  
--- Diff: framework/src/org/apache/cordova/CordovaActivity.java ---
@@ -95,6 +95,9 @@ Licensed to the Apache Software Foundation (ASF) under one
 protected ArrayList pluginEntries;
 protected CordovaInterfaceImpl cordovaInterface;
 
+//flag for case when appView is null during onStart
+private boolean shouldHandleStartOnAppViewInit = false;
--- End diff --

The webview (and thus plugins) are generally created from onCreate(), which 
means they will be initialized before the first call to onStart. If you're unit 
tests passes without this flag (and without the one in CordovaWebViewImpl), 
then I think you should remove them. It's not obvious (to me anyways) that this 
behaviour would even be the desired behaviour. If there's a reason it needs to 
be this way, then let me know! But if so, then we should upated onResume as 
well so that we're consistent.


> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14485940#comment-14485940
 ] 

ASF GitHub Bot commented on CB-8684:


Github user tony-- commented on a diff in the pull request:

https://github.com/apache/cordova-android/pull/173#discussion_r28009389
  
--- Diff: test/src/org/apache/cordova/test/LifeCyclePluginTestActivity.java 
---
@@ -0,0 +1,44 @@
+/*
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+*/
+package org.apache.cordova.test;
+
+import android.os.Bundle;
+
+import org.apache.cordova.ConfigXmlParser;
+import org.apache.cordova.CordovaWebView;
+
+public class LifeCyclePluginTestActivity extends BaseTestCordovaActivity {
--- End diff --

Originally was trying to isolate the plugin loading so I wouldn't have to 
modify config.xml.  But now that I modified config.xml... I'll switch to 
MainTestActivity.


> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/

[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14485816#comment-14485816
 ] 

ASF GitHub Bot commented on CB-8684:


GitHub user tony-- opened a pull request:

https://github.com/apache/cordova-android/pull/173

fix CB-8684 - support onStart/onStop lifecycle events in plugins for Android

A couple notes about this PR.
1. I feel pretty sure that CordovaActivity.shouldHandleStartOnAppViewInit 
is needed in order to reliably get an onStart event to interested plugins, but 
not sure about CordovaWebViewImpl.shouldCallOnStartDuringInit.  Don't want to 
add cruft, but would like these events to be reliable.
2. I tried to add a reasonable test for this new feature, but I feel like 
there might be a more elegant approach?  I'm open to feedback and willing to 
modify the approach.  Also (per @agrieve suggestion), I set onload=true, but it 
seemed to be working without it (which seems a little weird, but I didn't want 
to delay this PR any further - will step through it later).

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/tony--/cordova-android CB-8684-clean-for-PR

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-android/pull/173.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #173


commit 683965c6e7759030352e8e45252ca6aa8b13bf1a
Author: Tony Homer 
Date:   2015-04-08T19:00:38Z

CB-8684 support onStart/onStop lifecycle events in plugins for Android




> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issu

[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-07 Thread Tony Homer (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14483720#comment-14483720
 ] 

Tony Homer commented on CB-8684:


P.S. Also had to blow away my project files and start over again from Import to 
see the unit tests.  http://pasteboard.co/2orjtgeA.png

> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-07 Thread Tony Homer (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14483721#comment-14483721
 ] 

Tony Homer commented on CB-8684:


P.S. Also had to blow away my project files and start over again from Import to 
see the unit tests.  http://pasteboard.co/2orjtgeA.png

> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-07 Thread Tony Homer (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14483708#comment-14483708
 ] 

Tony Homer commented on CB-8684:


Ok, got your update for the manual tests - thanks!

Also, finally got unit tests to run.  I switched to beta channel Android Studio 
to get a newer Android Gradle plugin - it seems like this was required as I 
could not get unit tests to work with Stable channel Android Studio.

> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-07 Thread Andrew Grieve (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14483578#comment-14483578
 ] 

Andrew Grieve commented on CB-8684:
---

See what you mean about ActivityPlugin. Just pushed a fix for it.

As for running unit tests. The key is creating an "Android Tests" run 
configuration. Relevant UI spot: http://pasteboard.co/2onx7kEC.png

> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-07 Thread Tony Homer (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14483544#comment-14483544
 ] 

Tony Homer commented on CB-8684:


The updated Android Studio comments are definitely an improvement, but I still 
can't figure out how to run the unitTests (test/androidTest) in Android Studio??

Also, you mentioned that you had fixed the manual tests, but I cant get them to 
work because the ActivityPlugin is not loaded.  That is, they build and install 
on device, but clicking any of the buttons generates an error.  Is that 
expected?

I pushed a commit that removes the keepRunning param.  Once I get my unit test 
working (and do some more cleanup) I'll squash merge to master and submit a PR.


> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-07 Thread Tony Homer (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14483545#comment-14483545
 ] 

Tony Homer commented on CB-8684:


The updated Android Studio comments are definitely an improvement, but I still 
can't figure out how to run the unitTests (test/androidTest) in Android Studio??

Also, you mentioned that you had fixed the manual tests, but I cant get them to 
work because the ActivityPlugin is not loaded.  That is, they build and install 
on device, but clicking any of the buttons generates an error.  Is that 
expected?

I pushed a commit that removes the keepRunning param.  Once I get my unit test 
working (and do some more cleanup) I'll squash merge to master and submit a PR.


> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-07 Thread Andrew Grieve (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14483218#comment-14483218
 ] 

Andrew Grieve commented on CB-8684:
---

Updated android studio comments :)

Yes - remove comments I think.

> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-07 Thread Tony Homer (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14483208#comment-14483208
 ] 

Tony Homer commented on CB-8684:


Yep, as I'm sure you noticed in my comments, I wasn't sure about retaining for 
consistency or removing for brevity.  I was leaning towards removing since they 
seem useless for onStart/onStop - I'll go ahead based on your input.

> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-07 Thread Tony Homer (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14483205#comment-14483205
 ] 

Tony Homer commented on CB-8684:


Thanks for responding, thanks for fixing the README!  I figured out how to run 
the existing tests and added a new tests, but it isn't working, so I'm trying 
to debug in Android Studio.  Maybe you could also update the Android Studio 
instructions?  I just installed Android Studio for the first time - it looks 
like the UI no longer matches the README comment.  I am trying to get the unit 
tests to run in Android Studio so I can step through my tests, but so far I 
can't figure out how...

> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-07 Thread Andrew Grieve (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14483185#comment-14483185
 ] 

Andrew Grieve commented on CB-8684:
---

Also - code looks good to me so far. Probably don't need to add the 
"multitasking" boolean in the paramter since it's a super rarely used feature 
(to conditionally turn off things when backgrounded), and you can just check 
the setting in CordovaPreferences yourself rather than having it passed as a 
parameter. I'd remove it from onPause as well, but not worth a breaking change.

> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-07 Thread Andrew Grieve (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14483180#comment-14483180
 ] 

Andrew Grieve commented on CB-8684:
---

Glad you figured it out! Just updated the README to remove that line about them 
being in disrepair (I repaired them a while ago).

> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-8684) support onStart/onStop lifecycle events in plugins for Android

2015-04-06 Thread Tony Homer (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-8684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14482504#comment-14482504
 ] 

Tony Homer commented on CB-8684:


[~agrieve] - I made [a rough cut of these 
changes|https://github.com/tony--/cordova-android/commit/be04785f2ce8cbf3f2f96398641af270db12b76c].
  The next step I planned to do was to run the existing tests, then add some 
new tests to cover my handy dandy new onStart/onStop event dispatching.  
Unfortunately I can't figure out how to make the tests work.  I saw [the 
warning in the 
README.md|https://github.com/apache/cordova-android/blame/master/test/README.md#L24],
 but I thought maybe I could make them work in kitkat+ since it seemed like it 
might have to do with the thread rules for the webview in kitkat+. I followed 
the instructions for setting up gradle, ran the test app and got an error about 
the Activity plugin not being found.  This doesn't seem kitkat related - it 
just seems like the plugin is not present in cordova_plugins.js, so is not 
getting initialized.  Are there some missing instructions or am I completely 
missing something?  I'll keep looking on my own, but any pointers would be 
helpful!  I'll also send a message to the dev list if I don't hear back in the 
next day or so.  Thanks in advance!

> support onStart/onStop lifecycle events in plugins for Android
> --
>
> Key: CB-8684
> URL: https://issues.apache.org/jira/browse/CB-8684
> Project: Apache Cordova
>  Issue Type: Improvement
>  Components: Android
>Reporter: Tony Homer
>Assignee: Tony Homer
>
> Enable plugins to handle onStart/onStop lifecycle events in Android 
> implementation.  Currently plugin authors that need this feature instruct 
> their users to modify the CordovaActivity in their project in order to 
> support these lifecycle events.
> For example, the Flurry plugin instructions direct users to override
> onStart and onStop in their activity in order to handle onStop:
> https://github.com/Initsogar/cordova-flurry
> There are other analytics plugins that want to know about onStart/onStop
> instead of onPause/onResume.
> This change will enable native Android support only - there will be no 
> corresponding Cordova lifecycle events generated because these events are 
> platform specific.  
> In addition to the Android platform change, a "quirk"-type notation should be 
> added to the Android Plugin Development guide, along with possible update to 
> the example code provided there.
> For reference, here is the conversation from the dev mailing list between 
> [~agrieve] and [~tony--]:
> {quote}
> On 3/9/15, 12:05 PM, "Andrew Grieve"  wrote:
> >I see no reason we couldn't add onStart / onStop.
> >
> >As an aside, if you're okay with supporting only ICS+, you can use
> >Application.registerActivityLifecycleCallbacks() as a work-around.
> >
> >
> >On Mon, Mar 9, 2015 at 11:23 AM, Homer, Tony 
> wrote:
> >
> >> I assumed that this must have been discussed at some point, but I
> >>couldn¹t
> >> find anything in the list archives or JIRA.
> >> I¹m guessing that there might be some practical issues with
> >>onStart/onStop
> >> and plugin loading timing, but it seems like if there are issues like
> >>this
> >> they could be addressed somehow.
> >>
> >> I¹m asking about this because we have an internal request to enable apps
> >> to override onStart/onStop in the Intel XDK build system in order to
> >> support plugins that want to handle onStart/onStop.
> >> My initial response was ³why not use onResume/onPause², but some plugin
> >> authors apparently believe that onStart/onStop are the lifecycle events
> >> they need.
> >>
> >> For example, the Flurry plugin instructions direct users to override
> >> onStart and onStop in their activity in order to handle onStop:
> >> https://github.com/Initsogar/cordova-flurry
> >> There are other analytics plugins that want to know about onStart/onStop
> >> instead of onPause/onResume.
> >> Obviously it is possible to modify your activity in order to do this in
> >> your project, but if this capability is important, it should be possible
> >> without abandoning the Cordova Way.
> >>
> >> So I was wondering what you guys think?
> >> onPause/onResume should be good enough for anyone?
> >> onStart/onStop are edge cases that users need to handle by modifying
> >>their
> >> activity?
> >> onStart/onStop cannot be handled by plugins due to timing issues?
> >>
> >> Thanks!
> >> Tony
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org