Apache Cordova
  1. Apache Cordova
  2. CB-1156

Android app creation is broken in several ways!

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Not a Problem
    • Affects Version/s: 2.0.0
    • Fix Version/s: None
    • Component/s: Android
    • Labels:

      Description

      The experience of starting a new Android app is just really bad.

      When we use the bin/create script there is a lot of things missing :

      -> SplashScreen?!
      I just can't understand why this is lacking. It is an obvious need & everyone has to waste time figuring out how to make it work by themselves

      -> MacOSX is broken
      Either using latest Lion or any version with Macports + GNUTools (replacing deprecated versions bundled with OSX for licensing issues - common for most developers).

      -> The XML is missing required keys (targetSDKpath) & having invalid stuff inside it (xLargeScreen).

      -> Most files are badly indented. Does not respect the Google guidelines for JAVA.

      I've done most of the fixing myself:
      You can find this (work in progress) there :

      I'm quite disappointed on how you release a 2.0 without taking the hour needed to clean this mess. Instead a few hundred people will encounter the same issues & have a bad idea on Cordova/Phonegap.

        Activity

        Joe Bowser made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Not A Problem [ 8 ]
        Hide
        Joe Bowser added a comment -

        It seems that this bug reads more like personal preference than an actual issue given the discussion around this. There is a standard for indentation used in Cordova which is four spaces (tabs are bad, even in Java). As for the generated file, it is just that, generated.

        Also, in the future, saying what's wrong works better than just saying "It's broken"

        Show
        Joe Bowser added a comment - It seems that this bug reads more like personal preference than an actual issue given the discussion around this. There is a standard for indentation used in Cordova which is four spaces (tabs are bad, even in Java). As for the generated file, it is just that, generated. Also, in the future, saying what's wrong works better than just saying "It's broken"
        Hide
        Olivier Louvignes added a comment - - edited

        I was referring to the command script as it was a pain to execute (was broken on OSX) & import (does not have a correct name provided & use the package name instead that would require to refactor the name), it would not build at all (had some errors in the manifest), was missing (at the time) a proper fix for 4.0 rotation, did not provide any idea on how to setup a splashscreen. That was the kind of pain I was referring to, using the cli command (not from scrash from Eclipse). It just took me around 1H to make it work while it was instant on iOS. That was why I was a bit disappointed, anyway if a-hour search/work before starting to hack is easy enough to you. I won't fight it! I guess I might have special needs (splashScreen & readable code) that does not apply to anyone out there. I'll keep these changes in my fork.

        And one last point, I think the Facebook android app is using a splashScreen, and I guess it is more widely used than Wikipedia.

        Thank you for your time. You can close this.

        Show
        Olivier Louvignes added a comment - - edited I was referring to the command script as it was a pain to execute (was broken on OSX) & import (does not have a correct name provided & use the package name instead that would require to refactor the name), it would not build at all (had some errors in the manifest), was missing (at the time) a proper fix for 4.0 rotation, did not provide any idea on how to setup a splashscreen. That was the kind of pain I was referring to, using the cli command (not from scrash from Eclipse). It just took me around 1H to make it work while it was instant on iOS. That was why I was a bit disappointed, anyway if a-hour search/work before starting to hack is easy enough to you. I won't fight it! I guess I might have special needs (splashScreen & readable code) that does not apply to anyone out there. I'll keep these changes in my fork. And one last point, I think the Facebook android app is using a splashScreen, and I guess it is more widely used than Wikipedia. Thank you for your time. You can close this.
        Hide
        Kerri Shotts added a comment -

        > About the splashScreen, to me you should decide whether it should be bundled or not, but once the call has been made, just unify every platform as it is the core promise of Cordova. Also, it is way more easy to comment one-line out that to search the whole web on what&how to add to make it work.

        But here's the thing: not every platform should necessarily be the same in this respect. The idea is to make the app feel at home natively – if a platform doesn't always specify a splash screen, which Android doesn't, why should Cordova? On those platforms that always requires a platform, yes, it must be there, but if a platform doesn't need it, then you're affecting at least one side or the other – someone must either turn it on or off. Furthermore, since Android is such a diverse and fragmented platform, I would personally think that it would be more risky to load this by default as it might lead to more crashes and issues. Not supporting it by default is easier to maintain and ensure that it runs.

        > About the indenting, for instance the manifest, where it is not indented the same way through the file... Just like to keep things clean & readable, does not cost much.

        Indenting is a personal preference. I can make Eclipse indent any way I want. Therefore, the indentation on this file is a minor issue – you can re-indent it if you prefer another method of indentation. I have my way – you have yours. All that I might care about would be consistent indentation across the project, and honestly, I don't even care about that.

        > I don't really understand the point of "the team is not using Eclipse" as it is the default editor for Android, every example in the docs uses Eclipses screenshots, the getting started guide ask to install Eclipse... ! Today it is painful to add a project to Eclipse because of these missing files.

        Not everyone uses Eclipse. Just because that's the method the Getting Started guides use doesn't mean everyone uses it. There's DreamWeaver support too. Or you could do it entirely on the command line.

        > You should just understand that setting up an Eclipse project is really hard today for us foreigners (following the guides & installing Eclipse guys). Just thought it was important and a really easy fix that can save several hours of work for newcomers.

        The project created by Cordova is just enough to compile on the command line. Creating a project in Eclipse is /really/ easy once you have run the create command:

        • Create Android Project (using what the create script just created)
        • Configure the build path and add libs/cordova.jar as an external library.

        That's it – your project is ready to roll. To me, not that difficult, really. Now if you're referring to building the project entirely in Eclipse from scratch, I agree – /that/ is painful. But from the files the create script makes, very easy.

        > And for the echo stuff, what would be the benefit of not echo'ing stuff as it helps understanding the code (comments) & debug it...?

        My preference would be to have a --verbose option that would generate all the extra information. That way it can be enabled for those who like it, and disabled for those who don't.

        Show
        Kerri Shotts added a comment - > About the splashScreen, to me you should decide whether it should be bundled or not, but once the call has been made, just unify every platform as it is the core promise of Cordova. Also, it is way more easy to comment one-line out that to search the whole web on what&how to add to make it work. But here's the thing: not every platform should necessarily be the same in this respect. The idea is to make the app feel at home natively – if a platform doesn't always specify a splash screen, which Android doesn't, why should Cordova? On those platforms that always requires a platform, yes, it must be there, but if a platform doesn't need it, then you're affecting at least one side or the other – someone must either turn it on or off. Furthermore, since Android is such a diverse and fragmented platform, I would personally think that it would be more risky to load this by default as it might lead to more crashes and issues. Not supporting it by default is easier to maintain and ensure that it runs. > About the indenting, for instance the manifest, where it is not indented the same way through the file... Just like to keep things clean & readable, does not cost much. Indenting is a personal preference. I can make Eclipse indent any way I want. Therefore, the indentation on this file is a minor issue – you can re-indent it if you prefer another method of indentation. I have my way – you have yours. All that I might care about would be consistent indentation across the project, and honestly, I don't even care about that. > I don't really understand the point of "the team is not using Eclipse" as it is the default editor for Android, every example in the docs uses Eclipses screenshots, the getting started guide ask to install Eclipse... ! Today it is painful to add a project to Eclipse because of these missing files. Not everyone uses Eclipse. Just because that's the method the Getting Started guides use doesn't mean everyone uses it. There's DreamWeaver support too. Or you could do it entirely on the command line. > You should just understand that setting up an Eclipse project is really hard today for us foreigners (following the guides & installing Eclipse guys). Just thought it was important and a really easy fix that can save several hours of work for newcomers. The project created by Cordova is just enough to compile on the command line. Creating a project in Eclipse is /really/ easy once you have run the create command: Create Android Project (using what the create script just created) Configure the build path and add libs/cordova.jar as an external library. That's it – your project is ready to roll. To me, not that difficult, really. Now if you're referring to building the project entirely in Eclipse from scratch, I agree – /that/ is painful. But from the files the create script makes, very easy. > And for the echo stuff, what would be the benefit of not echo'ing stuff as it helps understanding the code (comments) & debug it...? My preference would be to have a --verbose option that would generate all the extra information. That way it can be enabled for those who like it, and disabled for those who don't.
        Hide
        Olivier Louvignes added a comment -

        About the splashScreen, to me you should decide whether it should be bundled or not, but once the call has been made, just unify every platform as it is the core promise of Cordova. Also, it is way more easy to comment one-line out that to search the whole web on what&how to add to make it work.

        I was referring to targetSdkVersion, since the cli auto-build against the best sdk available, I think it should be added.

        About the indenting, for instance the manifest, where it is not indented the same way through the file... Just like to keep things clean & readable, does not cost much.

        I don't really understand the point of "the team is not using Eclipse" as it is the default editor for Android, every example in the docs uses Eclipses screenshots, the getting started guide ask to install Eclipse... ! Today it is painful to add a project to Eclipse because of these missing files.

        You should just understand that setting up an Eclipse project is really hard today for us foreigners (following the guides & installing Eclipse guys). Just thought it was important and a really easy fix that can save several hours of work for newcomers.

        And for the echo stuff, what would be the benefit of not echo'ing stuff as it helps understanding the code (comments) & debug it...?

        Well noted Joe for the github state.

        Show
        Olivier Louvignes added a comment - About the splashScreen, to me you should decide whether it should be bundled or not, but once the call has been made, just unify every platform as it is the core promise of Cordova. Also, it is way more easy to comment one-line out that to search the whole web on what&how to add to make it work. I was referring to targetSdkVersion, since the cli auto-build against the best sdk available, I think it should be added. About the indenting, for instance the manifest, where it is not indented the same way through the file... Just like to keep things clean & readable, does not cost much. I don't really understand the point of "the team is not using Eclipse" as it is the default editor for Android, every example in the docs uses Eclipses screenshots, the getting started guide ask to install Eclipse... ! Today it is painful to add a project to Eclipse because of these missing files. You should just understand that setting up an Eclipse project is really hard today for us foreigners (following the guides & installing Eclipse guys). Just thought it was important and a really easy fix that can save several hours of work for newcomers. And for the echo stuff, what would be the benefit of not echo'ing stuff as it helps understanding the code (comments) & debug it...? Well noted Joe for the github state.
        Hide
        Joe Bowser added a comment -

        As far as comments on GitHub pull requests. Discussion of the pull request happens on JIRA, not on here. If a pull request has nothing to do with a JIRA ticket, we won't look at it. Also, we don't have the ability to login to the Apache account on GitHub and close pull requests. We do have an INFRA bug open to get this ability, but this is an issue related to the migration of the project to Apache. Apache's github account is a mirror of the actual repo located at https://git-wip-us.apache.org/repos/asf.

        Also, Lion != Mountain Lion. When writing issues, please try to be more specific in the future.

        Show
        Joe Bowser added a comment - As far as comments on GitHub pull requests. Discussion of the pull request happens on JIRA, not on here. If a pull request has nothing to do with a JIRA ticket, we won't look at it. Also, we don't have the ability to login to the Apache account on GitHub and close pull requests. We do have an INFRA bug open to get this ability, but this is an issue related to the migration of the project to Apache. Apache's github account is a mirror of the actual repo located at https://git-wip-us.apache.org/repos/asf . Also, Lion != Mountain Lion. When writing issues, please try to be more specific in the future.
        Hide
        Anis Kadri added a comment - - edited

        The experience of starting a new Android app is just really bad.

        We are truly deeply sorry about that.

        -> SplashScreen?!
        I just can't understand why this is lacking. It is an obvious need & everyone has to waste time figuring out how to make it work by themselves

        It might be an obvious need for you but it doesn't necessarily apply to everyone. Apps like Wikipedia don't have it. People who don't want it will have to figure out how to remove it as well. I am not totally against it though. We can always make it possible but optional? Maybe discuss this on the ML ?

        -> MacOSX is broken
        Either using latest Lion or any version with Macports + GNUTools (replacing deprecated versions bundled with OSX for licensing issues - common for most developers).

        Thanks for reporting this! OS X Lion was released two days ago. I just upgraded yesterday and did't get time to test. I fixed the replacement problem which uses absolute paths and should check the OSTYPE properly

        -> The XML is missing required keys (targetSDKpath) & having invalid stuff inside it (xLargeScreen).

        Do you mean `android:minSdkVersion` or `android:targetSdkVersion` ? We leave that up to the user. People who want to support higher versions of Android or don't want to support big screens can specify that themselves. By default we set `android:minSdkVersion` to API Level 8 (Android 2.2). Looks like this was recently modified from 5. We also build with the highest target.

        -> Most files are badly indented. Does not respect the Google guidelines for JAVA.

        Which files are we talking about exactly? Does it really matter if our files are not indented just as Eclipse would indent them ? None of us use eclipse…I see this as being really minor.

        Other notes on your pull request:

        • We won't be copying eclipse project files. People who want to use eclipse can still do so by creating android projects from source.
        • I initially echoed everything like you did but I got some complaints from people who don't like verbosity so I got rid of it.
        Show
        Anis Kadri added a comment - - edited The experience of starting a new Android app is just really bad. We are truly deeply sorry about that. -> SplashScreen?! I just can't understand why this is lacking. It is an obvious need & everyone has to waste time figuring out how to make it work by themselves It might be an obvious need for you but it doesn't necessarily apply to everyone. Apps like Wikipedia don't have it. People who don't want it will have to figure out how to remove it as well. I am not totally against it though. We can always make it possible but optional? Maybe discuss this on the ML ? -> MacOSX is broken Either using latest Lion or any version with Macports + GNUTools (replacing deprecated versions bundled with OSX for licensing issues - common for most developers). Thanks for reporting this! OS X Lion was released two days ago. I just upgraded yesterday and did't get time to test. I fixed the replacement problem which uses absolute paths and should check the OSTYPE properly -> The XML is missing required keys (targetSDKpath) & having invalid stuff inside it (xLargeScreen). Do you mean `android:minSdkVersion` or `android:targetSdkVersion` ? We leave that up to the user. People who want to support higher versions of Android or don't want to support big screens can specify that themselves. By default we set `android:minSdkVersion` to API Level 8 (Android 2.2). Looks like this was recently modified from 5. We also build with the highest target. -> Most files are badly indented. Does not respect the Google guidelines for JAVA. Which files are we talking about exactly? Does it really matter if our files are not indented just as Eclipse would indent them ? None of us use eclipse…I see this as being really minor. Other notes on your pull request: We won't be copying eclipse project files. People who want to use eclipse can still do so by creating android projects from source. I initially echoed everything like you did but I got some complaints from people who don't like verbosity so I got rid of it.
        Hide
        Olivier Louvignes added a comment -

        Yes, using "Mountain Lion" $OSTYPE = 'darwin11' does not match & no replace is ever made.
        The whole point of Cordova is to have a unified experienced for our smartphones. iOS has a splashScreen bundled in. So in my opinion, Android should too.
        Many devs will start building their app with iOS & then port them to Android. In that case, you have a 100% chance of looking for it - and thus wasting a lot of time.

        There is a pending pull request addressing most of theses issues :

        https://github.com/apache/incubator-cordova-android/pull/38

        But it looks like no one is ever reviewing theses pull requests (most of them have 0 comments...), that's sad as it discourages devs to contribute.

        Show
        Olivier Louvignes added a comment - Yes, using "Mountain Lion" $OSTYPE = 'darwin11' does not match & no replace is ever made. The whole point of Cordova is to have a unified experienced for our smartphones. iOS has a splashScreen bundled in. So in my opinion, Android should too. Many devs will start building their app with iOS & then port them to Android. In that case, you have a 100% chance of looking for it - and thus wasting a lot of time. There is a pending pull request addressing most of theses issues : https://github.com/apache/incubator-cordova-android/pull/38 But it looks like no one is ever reviewing theses pull requests (most of them have 0 comments...), that's sad as it discourages devs to contribute.
        Joe Bowser made changes -
        Priority Major [ 3 ] Minor [ 4 ]
        Joe Bowser made changes -
        Assignee Joe Bowser [ bowserj ] Anis Kadri [ anis ]
        Hide
        Joe Bowser added a comment -

        Can you reproduce this error? The scripts work for me on my box running Lion. I also don't think that adding a splashscreen is required.

        Show
        Joe Bowser added a comment - Can you reproduce this error? The scripts work for me on my box running Lion. I also don't think that adding a splashscreen is required.
        Olivier Louvignes made changes -
        Field Original Value New Value
        Summary Android app creation is lacking a few things Android app creation is broken in several ways!
        Affects Version/s 2.0.0 [ 12318875 ]
        Olivier Louvignes created issue -

          People

          • Assignee:
            Anis Kadri
            Reporter:
            Olivier Louvignes
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development