[aerogear-dev] Improving Android HelloPush demo experience in Eclipse - PR

Karel Piwko kpiwko at redhat.com
Mon Jun 9 10:41:13 EDT 2014


On Fri, 6 Jun 2014 12:22:43 -0300
Daniel Passos <daniel at passos.me> wrote:

> Answer inline
> 
> On Fri, Jun 6, 2014 at 7:05 AM, Karel Piwko <kpiwko at redhat.com> wrote:
> 
> > Hi All,
> >
> > I went through Android demo (and JBDS) and created following PR:
> >
> > https://github.com/aerogear/aerogear-push-helloworld/pull/18
> >
> > Let me know if you want to have separate PRs per commit. Goal was to have
> > example working in Eclipse/JBDS + ADT. There is still manual steps to do
> > and
> > an error I was not able to fix it completely, investigating.
> >
> > As per commit:
> >
> > 1/ Fixes Eclipse error marker for maven-android-plugin. AAR is not used,
> > so it
> > is fine.
> >
> > 2/ Quickstart/demos should not have any parent, Maven best practice. Check
> > JDF
> > quickstarts. Quickstart is an example and it is used to by user to scaffold
> > their own apps. We don't want them to use ag-parent but just ag-bom.
> >
> 
> Not sure why it's so bad. parent-pom is releases in maven central so, the
> community can use it. I think a notice in the README explaining why we are
> using it is good.

Well, official documentation I was able to find is here:

https://github.com/jboss-developer/jboss-eap-quickstarts/blob/6.3.x-develop/CONTRIBUTING.md

Reasons would be:
* Example/Quickstart should be standalone
** Any change in parent might break a quickstart 
** If user does not add parent his app might get broken without obvious reason
* Single inheritance issue
** Users might have they own parents
* Aligning with JDF experience

> 
> parent-pom has some nice plugins like formatter, license header, etc...
> Should we do it manually or put this plugins in the project pom?

That's the downside. I believe that only plugins that are relevant for users
should be there. JDF has tooling to check QS stuff -
http://www.jboss.org/jdf/quickstarts/qstools/. CC'ed Rafael, I can help
with creating a CI job to validate quickstarts. Hopefully we'll be able to run
QS tooling in Travis.

> 
> 
> > 3/ If project.properties is missing, Eclipse is not able to add Android
> > SDK to
> > build path. I've set it to API 19. This means that user has to point ADT to
> > Android SDK with API 19 installed. This is also version Eclipse will use
> > for
> > code suggestion/autocompletion/build in IDE. Should have been API 10, I'm
> > not
> > sure here.
> >
> 
> Always use the same of targetSdkVersion. So, it's correctly ;)

I was just lucky then, odds were 1:2 ;-)

> 
> 
> > 4/ Dependencies in <dependencyManagement> should not define any scope with
> > exception of *import*. Maven best practice.
> >
> 
> +1 Good catch.
> 
> 
> > 5/ If user don't provide UNIFIED_PUSH_URL, application fails due to
> > RuntimeException. I've added catch for IAE and Toast, however I believe
> > there
> > should be a better way how to indicate that to user. IAE is quite generic
> > and
> > fired from URLUtils in GCM registar. I'll file an issue to improve that.
> >
> 
> +1
> 
> 
> > 6/ /bin directory is used by default by Eclipse to host temporary build
> >
> 
> +1 Maybe is a good ideia copy the cookbook .gitignore
> https://github.com/aerogear/aerogear-android-cookbook/blob/master/.gitignore
> 
+1

> After these steps, I needed to follow these manual steps:
> >
> > a/ Import android-support-v7-appcompat from Android SDK into workspace as
> > Android project
> > b/ Import hellopush/android as Maven project
> > c/ Add android-support-v7-appcompat as library in Android tab of project
> > properties
> >
> > Now, I can edit the code. However, I can't use Run As/Android
> > Application still, likely due to http://tinypic.com/r/260ejpl/8
> 
> 
> Not sure what is going on, but I'll take a look at it next week. Could you
> fire a jira for me?

Here you are: https://issues.jboss.org/browse/AGPUSH-708

> 
> 
> > I'd appreciate if somebody could verify it is still working with
> > AndroidStudio.
> >
> 
> I just run it in Android Studio and IntelliJ. I don't know how, but all
> still working :P

Great. This explains why IntelliJ is so popular, at least to me ;-)

> 
> Thanks,
> >
> > Karel



More information about the aerogear-dev mailing list