Ok, I've been in planning for developing a PhoneGap app for a few months, and it's come time for me to start coding. There are a few things I am confused about that I need to clear up before I can get going, because things don't seem to be going well.
To begin, I am using PhoneGap to build this app because I plan to release it to multiple platforms (primarily iOS and Android) and based on the tutorials for Objective-C that I've read, I'd much rather use JavaScript/jQuery/jQueryMobile to develop the app. If anyone thinks that these are not appropriate reasons to be using PhoneGap and that I should be using something else, please let me know.
I seem to be misunderstanding some things that are apparently self-explanatory about PhoneGap, and after hours of scouring the internet looking for answers, I can't seem to find anyone else who has had the same problems as me. To clarify, I am quite comfortable with my HTML/CSS/JavaScript skills. I literally just need to GET STARTED.
I see the terms PhoneGap and Cordova used interchangeably. From the sources I've seen they are pretty much synonymous, but I'd like to know what the ACTUAL difference is.
I'm fairly certain I have PhoneGap installed. I can run PhoneGap commands and I was able to get the basic Hello World application and run it on an iPhone emulator. I then began to make changes to the files and rebuilt and reinstalled to test it and it replaced all my changes with the original application. I'm not sure what I did wrong, but I feel like I'm missing something.
Can I use other JavaScript libraries like jQuery or jQuery Mobile with PhoneGap? I'm not sure what I'm limited to, or if I can use them, what the best way is to do that.
I've seen example applications that were able to use PHP even though many sources say that you can't. How is this done?
Can multiple pages be used or is it better to modify one to make it seem like there are multiple pages?
Any other suggestions on exactly how to get started will help. Thanks!
Only edit the files in your www folder, because when you run
phonegap build ios
it copies files from the www folder into the various different platform folders (depending on which platforms you've added) and compiles an application out of them.
http://www.tricedesigns.com/ - lots of sample apps and tutorials
http://www.raymondcamden.com/ - ditto
http://coenraets.org/blog/ - ditto
http://devgirl.org/ - tutorials
https://groups.google.com/forum/#!forum/phonegap - official group
Cordova is the open source community driven version of the framework, Phonegap is a "snapshot" of cordova at a given point that Adobe specifically supports through it's build service, there are small differences but on the whole they're more or less identical in feature set and use.
You can use any JS libraries you want, and you'd use them exactly as you would normally on the web.
PHP code cannot be used inside a phonegap/cordova app but there's nothing to stop you loading data from external sources.
Regarding multiple pages, I'd generally stick with a single page and just show/hide parts of it as needed, just so you're not having to deal with re-loading libraries on each page load and adding overhead to the app itself.
As for where to start - there's a few good books out there but you could do worse than to give this tutorial a go..
http://coenraets.org/blog/phonegap-tutorial/
Related
I want a javascript framework which has features like below:
MV*
Well structured
Html file as template
Rendering fast(maybe virtual dom?)
Combine and compatible with other plugins or libraries
Edit on tablet IDE apps and view in browser immediately by refreshing page after I changed code
When I am at home, I use PC to develop my client-side(or front-end) applications.
When go out, I use my tablet(I have no note PC), so I want to develop my applications outside.
*There are some excellent IDE apps on the Android Market.
Before I know Ember, I have been using pure javascript(jquery) + css + html to develop client-side application for daily practices or work.
But recently, when I began to learn EmberJS, a Javascript MVC framwork, I am lost.
It seems that EmberJS have to get its own server up to compile something, which generate static contents for browser rendering.
I just want to get my client-side code(files) rendering in the browser, but why I have to 'run' it as if I get apache started to serve as a php back-end.
I have googled hundreds of pages to find a solution, nothing expected result discovered.
Including Angular, backbone or any other popular Javascript MV* frameworks, they all must compile there applications.
Is there anyone who has encountered this situation?
Then any advice, please?
Increasingly most Javascript frameworks are shifting to doing a "compile step" as part of using them. This allows you to do a variety of changes to your Javascript files, which in turn makes it easier for you as a developer. An example of this is that you can use ES2015 classes and then have your compile step "transpile" them to older Javascript that will work in all browsers.
The side effect of this though is that you need to have npm running on your computer to be able to do this well.
If you really don't want to have the compile step, then I would suggest looking at VueJS. It's the only recent Javascript framework that allows working with simple non-compiled JS files. But you'all be missing out on some of the best changes to Javascript as a result (ES2015 has made life much better)
Finally, I found a nice solution(framework) that is Durandal.
Really, pure HTML+Javascript without built and server up(anyhow, a web server needed if I wanted to publish it in my hosted web server).
.html extension and designer friendly.
I can upload its source files directly in to S3 and browse the html pages.
Just found some nice examples with well structured project on github is here.
And I can work smoothly with my dear designer friends.
Though its next generation Aurelia will also be built and serve it up like Ember or others, but the current generation is enough for me.
Hope those one got help from this;)
I'm interested in creating audio plugins and emulators, since it would tie in nicely with an app I'm currently developing, but c++ seems to be the only language i can find any documentation for creating them in.
Is there anything for Javascript that would allow me to create, say, a compressor or a limiter or an EQ plugin?
I know this might seem noobish but i searched for a while on google and wasn't able to find anything concrete.
Thanks!
I have not actually used it yet, but I've been meaning to check this out for a similar project. https://www.npmjs.com/package/node-core-audio
I'm creating an intranet application, the UI of which premoninently uses Ext JS 4.1.1
I have created several custom javascript classes extending Ext JS controls and other code for UI, validation, communication, etc.
Given that my code is not very huge and that my application will be deployed in a controlled & well known environment I'd ideally like to load all .js files upfront at the time of application invokation (boot). I'd like to know an approach to achieve this, mostly from within the relm of Ext JS.
What you want to do is something really usual. Take a look at the deployment section to know how to use the Sencha SDK to create one file containing all your custom javascript classes which extend extjs component here
I hope it is useful ;)
As of this month Sencha (beta) released a revamped build tool. Actually, it is a complete rewrite in Java (I believe). Sencha Cmd is the name, and it is all that the predecessor should have been!
Compile times have been crunched to maybe a 10th of its predecessor and packages/builds are now configured using a powerful command processor.
Integration into other build frameworks and CI servers is now a top priority and achieved by integrating the tool with ANT.
I just spent the past hours to migrate a project from the old Sencha SDK Tools to the new Sencha Cmd. I particularly love the new compiler.
Documentation is already pretty good.
Blog post that introduced Sencha Cmd
Official SDK documentation - there is a total of 10 articles on the subject, don't miss them, particularly the
Compiler documentation
For smaller projects that follow the standard (single-page) pattern suggested by Sencha, there is actually a range of higher-level commands that manage the entire application creation and build process.
Furthermore, Sencha has now a pattern in place for multi-page applications.
And you can always use the compiler directly and implement your own build process on top of it. That's what we did in our project.
There is one class called Ext.Loader
This is more of a server-side question than an Ext JS question. You want to include all your pages up-front? Get a JavaScript compressor to concatenate your files together, minify the whole pack, and add a <script> tag to every page in your web app.
I also work on an intranet web app that heavily uses Ext JS (both 3 and 4), but we have quite a large codebase. Since we use Tomcat, we have a Java class that includes standard files on each page, plus any file groups or individual files we need for that page. Something like that might work for you as well.
You can use Ext.Loader for dynamic loading when you need it, but that doesn't sounds like what you're looking for. Still an option though, should your codebase expand and you need a better solution.
EDIT: As mentioned in the comments, my original answer failed to address the Sencha SDK Tools. I felt it would be more beneficial to make my response part of my revised answer.
While this task may be exactly what the Sencha SDK was designed for, I feel that the product is not yet mature enough for production environments. At the time of writing, the current version is 2.0.0 Beta 3. Beta, meaning it's still under development, and it shows. Documentation is practically non-existent and the official forums are full of topics claiming the product simply does not work. At this point, it's nothing more than a toy to be played with. The most helpful document I've seen is Sencha SDK Tools 2.0 and ExtJS4: The Missing Docs, and the author even ends with "The SDK Tools need a lot of work."
When I'm choosing a product for a production environment, I want something stable, something reliable, something with good documentation, something with quality support. The Sencha SDK Tools are none of those things. Yet.
Do any of you know any reasonably good resources containing methods and tutorials to help build a Dojo driven entirely AJAX application. I have been searching Google and the Dojo Toolkit web page however not many resources seem to tie everything together..
Thanks in advance,
If you are familiar with Dojo principles the best way would be studying working source code. There is nicely commented github project dojo-boilerplate to start with. It provides, well, boilerplate code to start building a single page javascript application including preconfigured build system. Unfortunately - afaik - build scripts based on Java neither node.js does not work under Windows as of now (not even under MinGW or Cygwin due path resolving issues).
Aforementioned branch uses AMD modules new to Dojo 1.7+, for previous Dojo version employing synchronous loader use this branch.
Also have a look at build.dojotoolkit.org and check out its source code.
Last but not least, don't forget books. You can find those I prefer in my Career 2.0 Profile.
Background:
I've been building web apps and web sites for many years, but each time I tend to start from scratch as each project has different requirements. However, this has me building my workflow from scratch as well. At this point, I'm about ready to settle on something a little more standard.
But what exactly is that standard? Being a JAVA developer by nature, I'm drawn to tools like Maven. And I've seen some work in the community for better Javascript support in Maven (javascript-maven-tools, javascript-maven-plugin, and others). But is this the best way to do it? I tried for a while to find a good WEB2.0 client/ajax-app maven-archetype to no avail.
I'm going to want to use tools in my workflow including JSLint [[http://www.jslint.com]], JSUnit [[http://jsunit.net/]] for testing, Documentation with things such as JSDoc Toolkit [[http://code.google.com/p/jsdoc-toolkit/]]. Compression and Framework inclusion would be nice too.
So, at this point, I'm even stumped at the the basic ways to start my app. What should a directory structure look like? For a pure client/frontend app (so no controllers, etc), do i just have a single webapp directory?
I guess I'm at that point where I'm questioning "my religion" with webapps. And after talking to everyone I know, I figured it was time for me to open it up to a hive-mind far smarter than my own.
Note. This is a question I also wrote
about in general on my site at
[[http://blog.jbjonesjr.com/?p=283]]
, but no one every cares about it
there.
Thanks for the help, I look forward to your thoughts.
I've started a couple of plugins (this and this) on Codehaus that facilitate the use of Maven for building JavaScript applications following Maven's goal oriented approach. I want to do more of this including the provision of a Surefire-compatible unit testing plugin and a minification plugin that leverages assembles. Take a look at what I've done so far and feel free to help out!
I'm also considering providing a JavaScript DSL for Maven using Polyglot Maven. A colleague kindly pointed out that JavaScript programmers will probably want to express their poms using JavaScript, not XML. In addition they probably won't want the learning curve of Maven. A JavaScript DSL could facilitate that.