- 329 Posts
- 12 Reply Likes
Posted 6 years ago
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
I understand and appreciate your suggestions, but...
Why would a developer install Phonegap and do "create project" if he has already decided to use Phonegap Build?
When using PGB, you don't need to install and maintain:
- java
- node
- phonegap/cordova
- eclipse, xCode
- platform SDK's
- plugins
PGB users won't have a /www directory, HelloWorld titles, default Phonegap icons and splashes, etcetera.
Surely, your arguments are valid for those who want to install all that stuff and build locally. But hey, you posted your idea on the PhonegapBuild board, the forum for those who don't (or shouldn't) see any of the perceived problems.
- 329 Posts
- 12 Reply Likes
Most points should have been directed elsewhere no doubt.
Yet, to provide a picture from the ugly reality out there...
My introduction to PhoneGap was phonegap.com that clearly states that "create" is the way to go to set up a project. Build came later.
I tend to build locally as well, so that...
- I can track down possible bugs in the created platform-specific code
- I get a quicker turn-around while iterating solution ideas
- I can make local builds for tracking down bugs and experimenting, without my co-developers and testers seeing them.
For instance, there is a bug in the InAppBrowser plugin that I and others have tried to track down for a long time. There's at least one of the official plugins that contains Apple ad IDs, which is not allowed by Apple unless ads are shown. Proximity Beacon lacks support for an important feature that the Radius library supports, but the plugin doesn't expose, which is currently discussed with one of the developers. For all that I need the plugin code and local builds.
So I guess "shouldn't" doesn't really apply to me at the moment, or I should just wait for bug fixes? I have deadlines you know.
Getting Started mentions "Other than that you can structure your application as dictated by your workflows." I kind of disagree that it's that much flexible (especially when it comes to config.xml), so some form of template tool would be useful also for Build, yet I fully agree that most of what "create" does is not needed for Build.
Maybe state "Never use create" and "Ignore everything that phonegap.com says"?
Regards,
Anders
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
let me first say, that I appreciate your comments and input. You made clear why you find a mix when both using Phonegap/Cordova and PGB.
You are, in fact, mentioning multiple topics:
1. Differences between Local build and PGB.
About 50% (my guess, after hanging around here for a while) of the issues mentioned here are caused by unawareness of the differences. Many developers read something about "Phonegap" online or in books, like what they read and hear, and less than 5 minutes later, they download and install Phonegap, because they think that's the proper way to go.
2. Documentation
I agree that the documentation of Phonegap and PGB are too similar. New users really can't tell what is what. Of course, things get worse when they start googling, ending up in PGB docs one time and in Cordova docs the next time. And often, they end up in previous, deprecated versions, too.
So, as a result, they create wrong configurations. A configuration tool as proposed by you might help a bit, but as long as legacy documentation is still online, massively presented by search engines, it won't drastically change anything.
3. Incomplete config UI
PGB offers a 'light' configuration UI, which should help new PGB users. But that UI is hardly advertised and not prominently present. Then there's "confiGAP", a separate tool created by Chris, which is also not too well-known.
This shows that yet another configuration UI might not be the key to improvement.
I don't expect PGB to improve (2) and (3) soon, since they appear quite understaffed. I don't expect better online support, either, since several team members left PGB recently and PGB also discontinued paid support early 2014.
However, they have at least recently mentioned plans to make PGB and Phonegap/Cordova more similar in terms of configuration. Also not something that will be achieved soo, I suppose, but "that is the direction we are moving" is at least a bit of a statement.
Note: I am not sure why you would need to build locally in order to get to the plugin sources. After all, these are mostly available from their source (github).
Other sources can be retrieved from the resulting .apk or .ipa, downloaded from PGB.
However, if you want to "quickly build locally to test something", then yes, you would install and use a local environment. I have, on the other hand, deliberately chosen not to install and use any local stuff (except my own code/text editor, graphics software, etc. - which are portable), in order to avoid the constant maintenance/upgrading effort. I use PGB to keep my hands free for development and stay away from environment management.
- 329 Posts
- 12 Reply Likes
It creates a structure very similar to "phonegap create". It even stores config.xml in the root so it's unreachable from the "Projects" tab. I can access it via the "Files" tab though. The infamous HelloWorld template is an option, but not mandatory.
It creates platforms and plugins folders that are redundant. They are also empty, so I guess no harm done.
config.xml is almost empty, and doesn't contain the information needed by Build (e.g. the list of plugins), so a rough start on that end.
I can add plugins via the projects settings, but that doesn't affect config.xml.
Builds can't be uploaded to PhoneGap Build from within NetBeans. It's only for local builds.
A completed build creates content under platforms and plugins, just like "phonegap build/run android" would (I'm on Windows, so no local iOS). config.xml still lacks a list of plugins.
I understand you are not involved in this, but the "workflows" statement in Getting Started remains confusing. What workflows? What am I missing? What IDE/editor do you recommend.
I have several apps hosted on PhoneGap Build, and it's saved me a lot of headache, so that's not the issue.
Regards,
Anders
- 329 Posts
- 12 Reply Likes
"2." I always check the version number at the top due to this.
"3." I was not aware of that. Will check it out. I've tried ConfigGap, but it actually made things worse: overwrote settings I had made and it sports a rather tedious way of adding all the different icons and splash screens, without helping with the actual assets. Instead I developed my own tool for creating the needed images with folder structure, that I can just dump under res. config.xml I've optimized manually for my overall needs, so I can copy it to new projects.
"Note:" For the sake of checking the source I don't, but if I want to make changes to the plugins for debugging purposes I need to build them (and the whole project) locally. Once I even needed to fundamentally rewrite a plugin, until I convinced the customer otherwise.
I also increasingly rely on Build to do everything beyond coding.
Anders
- 329 Posts
- 12 Reply Likes
Regarding the previously mentioned "workflows": Any advice on the recommended toolchain when using PGB?
Regards,
Anders
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
Recommended toolchain: sorry, but I can hardly recommend anything special. I have my favorite code/text editor, and that's it. Everything hand-coded. I test the html/css/script by uploading (FTP) the assets to a webserver and play around using browsers with developer tools. Then I zip up everything and test with 3 Android and 3 iOS devices. No hydration, no specific debug tools.
All apps are first built and delivered in a test environment (test database, test versions of server side scripts, test certificates) where a small team tests and approves each app (yes, they install each new update themselves). Then I rebuild with production certs for production DB/server and upload to platforms.
Such process will never work for larger development teams. In such environments, version control with team roles, and at least three DB/server platforms (devtest, user test, production) are required.
And even in smaller work groups, I can see that some might want to install and use all kinds of tools for development, version control, emulation, debug, test and documentation.
I don't, though.
- 329 Posts
- 12 Reply Likes
I develop most things on my own, with a few testers, but usually not more than me on coding, both client- and server-side. I don't use any version control, but I do prefer an IDE over a pure editor. I wouldn't be able to test the pure assets on a Web server, as I tend to use phone-specific plugins (Camera, Barcode, Beacon, NFC etc). If I'd made pure service frontends it would have been a different story, and that's likely to happen down the road.
Regards,
Anders
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
I wouldn't be able to test the pure assets on a Web server, as I tend to use phone-specific plugins (Camera, Barcode, Beacon, NFC etc).Well, I use several plugins, too. But....they need not to be tested, debugged and corrected. Plugins are, as far as I'm concerned, a black box.
I test the interfaces: what is going in, what is coming out. I can do that with just a couple of alert()s, so I don't require a debug environment for that (which needs to be installed and maintained).
What I really want to be testing is my own code, and by far the most of it can be done comfortably in a set of browsers. The big advantage: I can correct code, upload to the server and retest without a need of building through PGB. Only after everything works as intended in browsers, I run a couple of tests in a handful of devices, just to see the plugins work with the (now correctly formatted) input and to see the icons and splashes.
Of course, after having done over a dozen of apps, I have some ready-to-use configs, plugin functions and html code templates of my own which can largely be reused, so unless it is drastically different from other apps, I don't find heaps of bugs.
- 329 Posts
- 12 Reply Likes
- 329 Posts
- 12 Reply Likes
When I do Q&D demos I use this tool to create the icons and splash screens:
http://pgicons.abiro.com/
It's mindbogglingly slow if you use high-res images, but it still saves time. For Android the splash screens don't look right on all phones, but I tend to not use them there, so no harm done.
Regards,
Anders
- 329 Posts
- 12 Reply Likes
Well, that's not altogether clear:
If you go to http://phonegap.com/blog/phonegap-build/ and click on "Install", what's the first things you see?
npm install -g phonegap
$ phonegap create my-app
$ cd my-app
$ phonegap run android
Hence, even if I'm on the PGB site I get the advice to build locally.
No wonder people are confused.
Cheers,
Anders
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
And that's the whole problem....people are applying phonegap docs when using Build.
- 329 Posts
- 12 Reply Likes
- 13 Posts
- 1 Reply Like
Also, did you notice they even removed BlackBerry support recently? The fact that you and me are not using BlackBerry does not mean it doesn't exists. It is there and we are missing hundreds of thousands of potential users because of this step back from Phonegap.
Last, the platforms are and will change their system's appearance from time to time. Maybe in Windows Phone 10, tiles will be gone and all icons become rounded, not squared. Your CSS templates will be good as useless then.
- 329 Posts
- 12 Reply Likes
Compared to "phonegap create":
- A default www/config.xml that sets up things you need always. Maybe different files based on what phone platforms you plan to support, and what kind of app you want to build, but only a few options. Detailed editing is better done directly in an XML-aware editor.
- A www/index.html, with pretty much no content, rather than the utterly useless markup that's in the current template file.
- The same with www/js/index.js, that should contain an empty deviceready callback.
- An empty www/css/index.css
- default icon.png and splash.png, but nothing under www/res except for .pgbomit.
- Make use of pgicons or similar for creating the custom set of app icons.
- .cordova/config.json with a placeholder for the PhoneGap Build app ID.
- Possibly a few more or less required plugins, always loading the latest version. E.g. device, inappbrowser, statusbar.
Simple stuff really. I might even add this to pgicons. Hmmm...
My case might be a bit specific (but IMHO recommended): I normally use PhoneGap Build for the building process, but I always generate a build via "phonegap remote build" to speed up the process. I sometimes also build locally for debugging others' plugins etc.
Now I of course copy previous projects, never using phonegap create. I always edit config.xml directly.
The way phonegap create works is quite confusing to first-time users.
Anders
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
The way phonegap create works is quite confusing to first-time users.That's why I keep emphasizing that developers use PGB, so they are NOT required to install and manage:
- Node
- Java
- SDK's
- plugins, platforms
- Phonegap
...and they DON'T need to do "phonegap create".
Phonegap Build takes care of all the infrastructural stuff. PGB users just want to make sure that a few requirements are met (index, config and default icon/splash in the root of the zip; phonegap.js-reference in html without including a phonegap.js file)....and then are free to upload whatever directory structure they like.
- 329 Posts
- 12 Reply Likes
- 329 Posts
- 12 Reply Likes
It lacks images, but the text is there. If there's any aspect you think needs to be changed please let me know.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
But since it's going to be a public document anyway, and this is a 'community forum' here, I would rather see you put it on a server somewhere and post a link to that draft (clearly indicating it's a DRAFT version). That way, others could chime in as well (hopefully adding to the quality and perhaps writing additional ideas).
It would also allow PGB crew to react, which could be quite valuable.
You could put it up just temporarily, indicating a date/time/timezone when you will be deleting the draft again.
[I hope you understand that posting my mail address here would probably lead to me receiving all types of help requests privately, which I am trying to prevent]
- 329 Posts
- 12 Reply Likes
It's up at http://abiro.com/tutorials/phonegap/
I'll announce it in the forum.
Anders
- 329 Posts
- 12 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
That's quite impressive, already. Good job!
Here are the (dozen or so) things I spontaneously noticed and marked. Don't get upset...most of your text is spot-on! :-)
INTRODUCTION
Developing for Windows Phone and Bada should..."Bada"? I never realized Bada was supported. Is it?
Support for BlackBerry is sadly dropped,Since this is a tutorial about what is possible and how it's done, I think you should avoid mentioning what was dropped (new readers will not be too interested in a history of what has been supported long ago) and perhaps refrain from writing personal opinions. Those are excellent in blog articles, but shouldn't be too obvious in a tutorial.
DISCLAIMER
...yet PhoneGap does...I suggest you write "Phonegap Build" and add a link to the forum.
In addition, this would be a good place (or perhaps in INTRODUCTION) to emphasize the difference between Phonegap/Cordova and PGB. If it was me, I would stress that PGB is meant for those who don't want to install everything and manage updates!
USUAL COMMON SENSE
Mine is killed PhoneGapMay I be sarcastic? :-)
[EDIT: I saw you corrected this in your last second draft]
CONFIGURATION
nameJust in PGB. When publishing in the stores, developers can choose a different name/title. It is relevant for the text below the icon on the device start screen, though
(the app’s name that will show up on PGB and the stores)
Create a ZIP file of everything under wwwThis is a pet peeve of mine. I think you must VERY clearly state, that it is not the /www directory that needs to be zipped, but the CONTENTS of that directory. It should be zipped up in such a way, that you would see index, config and default icon/splash when opening the zip file, and the /www directory itself should not be present in the zip file.
For iOS you always need one. If you don’t know how that is created leave that for nowYou may consider supplying a link to Apple's documentation for certificates and mobileprovision
Read the displayed QR code from an applicable phone and run the appYes, that's one of the options. Other possibility is: download the .apk/.ipa/.xap from the blue buttons and install remotely, for instance by uploading them to a place online and downloading to a device, or for iOS by placing the .ipa in iTunes and installing from there.
phonegap.js
This might be the proper place to say something about phonegap.js, which is necessary for the use of plugins. Explain that the reference is necessary in the html code, but such file should not be included in the assets, since PGB will inject such file automatically.
CREATING AN APP
Install the PhoneGap plugins that you really need.Avoid calling it "Install", because that might be associated with what Phonegap/Cordova users do when they 'install plugin' in CLI. I would call it "define" or "list" or "include" plugins in the config.xml
There are tons of plugins available via build.phonegap.comYou may want to mention the link to https://build.phonegap.com/plugins and also mention the large registry at http://plugins.cordova.io/
HTML ETC SUPPORT...
After all,On the webview component. This is important, because developers will want to find tables that indicate which html/js/css is supported in which version. They should not go and look for Chrome or Dolphin or Safari, but rather for the webview component of that OS version
PhoneGap relies on the browser
OPTIONS
I then tend to use phonegap remote buildI am a bit on the fence, and thus uncertain whether or not you should mention Phonegap CLI at all. But if you do, yu might as well go into the option of building through the PGB API as well, so developers can automate the whole process.
Might go a bit too far for this beginners tutorial, though!
Create the folder .cordovaI have never included such directory and wouldn't know what I need it for. The tutorial doesn't explain this, either. Is this directory essential for remote build, only? If so, I believe you should emphasize that in order to prevent developers from thinking that this directory must always be included.
Ideas:
- would it be a good idea to mention the W3C XML validator? Beginners might make mistakes in their XML, and these can be found easily by validating the XML first
- would it be useful to write a pointer to the LOG button in PGB? Developers should look for error messages if a build fails.
- 329 Posts
- 12 Reply Likes
Thanks for great comments.
Bada: Supposedly yes (mentioned for icon and splash images), but for the sake of the tutorial I'll remove it.
BlackBerry: Fair enough.
yet PhoneGap does: Agreed.
"killed": I wonder where that came from. Freudian lapse or some form of Pythonesqe English? We'll never know.
name: You're right of course.
ZIP: It works if I compress www as well, so that's what I do. Easiest.
iOS: It's best put at the end. I'll add References.
Read the QR code: That's by far the quickest method. Downloading the files makes it way more complicated and time-consuming. No way I would do that during development.
phonegap.js: It's in the template index.html.
PhoneGap plugins: "reference" instead?
tons of plugins: Yup.
HTML: You're right. That's an issue in Android before 4.3 (I think): WebView uses the old browsers. Users always access Chrome. Hence confusing development as things working in Chrome (everything works in Chrome) might not work in WebView, or differently. Very hard to explain to a customer: "A browser is a browser, right? What's this HTML thingie?"
remote build: At least it's separate from the other text, but I always use this. The alternatives are way too slow.
.cordova: This is needed for remote build, so mentioned it there is correct. Otherwise it doesn't know what PGB project to address.
W3C XML Validator: How do you apply that to an app?
Log button: So far I've not used any debug tool. If something goes wrong I fix my code and try again. But yes, I'd prefer to be able to see markup and Javascript errors when they occur.
Cheers,
Anders
- 329 Posts
- 12 Reply Likes
I use NetBeans for PhoneGap projects. I'm not using the included Cordova template though, but I get syntax checking on CSS, Javascript, XML, HTML, which takes away the need for an external validator. It also understands the syntax enough for finding declarations and such. Very handy.
- 329 Posts
- 12 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
On the other hand: you're writing a PGB tutorial and PGB aims to offer a service that doesn't require installation of a full Phonegap environment - which must be managed/updated.
Just a question (I really don't know): would it be possible to remotely build for iOS using a Windows PC? Or is it just local build that requires the platform SDK on a Mac, (which I might assume)?
- 329 Posts
- 12 Reply Likes
I build for both iOS and Android from Windows using remote build. The command needs stated what platform to build for, but PGB builds for all that are mentioned in config.xml anyway, which is good.
The tutorial is updated with most of your points, yet not the log button, as I frankly don't know what that is :).
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
representing PGB on thisYou are aware that I am not working for nor associated with PGB, aren't you?
- 329 Posts
- 12 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
In my organization, I have a problem with that. I build separately for test- and live environments, and might be building other versions while the test team is testing. If they would use the QR code to fetch the test version, I might already be a step ahead and built the next version. That would cause them to test the wrong versions.
It's why I download the test apk/ipa and send those files to the test team. Yes, they will have to install that version "by hand" but at least I know that they will be testing the right version while I code and build along.
============
Log button: So far I've not used any debug tool.
The log button is not a debug tool but rather a way to see how the build job was doing. If the build fails, it's one of the first things to check in order to know what and where the problem could be.
=============
BTW: in the section where you mention this PGB forum, you might as well hint the reader to use the search function and find out if a similar problem or question has been posted recently.
Also, I wrote a little tutorial on how (not) to post issues:
http://community.phonegap.com/nitobi/...
You may consider including that link, too.
- 329 Posts
- 12 Reply Likes
- 329 Posts
- 12 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
- 329 Posts
- 12 Reply Likes
- 329 Posts
- 12 Reply Likes
Creating the p12 file. Well you can use openssl under Windows and spend a whole day, but as I have both systems I don't mind.
Publishing to iTunes. That's easily done via App Loader. XCode is not needed.
- 329 Posts
- 12 Reply Likes
Related Categories
-
Programming (Others)
- 1167 Conversations
- 23 Followers



