I am looking for a utility that would quickly bundle up a phonegap app for android from an html directory. Perhaps something that would read some config.json file in that directory to automatically take care of all the configurations.
Basically I am looking to avoid doing all the setup of eclipse just to wrap my html5 app which already works fine on android through the browser.
Anyone have any good tricks or tools that can shortcut the whole process to something close to what I am dreaming about? I would love something where in 10 minutes I can have everything ready to deploy to the marketplace.
One option is AppLaud Cloud. Note, that it is still in alpha.
With AppLaud Cloud, you could create a Base App and then replace the contents of the assets/www directory with your html5 app.
You can emulate the app with the built-in Emulator, debug the app on device with Weinre, and build for deployment to the market.
Caveat: I'm the creator of AppLaudCloud.
Dreamweaver 5.5 has a function like the one you are looking for. I played with it briefly and is ok. More info here: http://blogs.nitobi.com/andre/index.php/2011/04/12/adobe-dreamweaver-5-5-supports-phonegap/
The plus: works with ios also(if you're on mac)
The minus: quite expensive stuff...
I would try using the new (undocumented) command line tools in the PhoneGap Android source. There is a command for creating a new app (https://github.com/callback/callback-android/tree/master/bin) and in the new app folder there is a command for debugging the app (on emulator or device).
You could also check out https://github.com/brianleroux/cordova which is a prototype for the command line tools that are now in the platform specific PhoneGap repos on github.
Going forward there will be more work done on Cordova but probably as an official PhoneGap repo / binary distribution.
Related
We're working in an app for Android/IOS and the team has at least 3 people working in the app code and who need to have the app running locally in their particular env, someone is developing over Mac OS to eventually build to iOS and the others are on Windows machines.
We've been experiencing problems with the Ionic project after installing ngCordova, some cordova plugins and the ionic-platform-web-client, the mac machine had the app running beautifully and the windows instances were broken complaining that: Module 'ionic.service.core' is not available!
We don't know which particular step caused the code inconsistency and after several hours of looking around to fix it we decided just to create a new Ionic project and copy our specific www code inside. Since we don't want that to happen again we need to figure a reliable method of keeping all platforms working right after we install a plugin or add an Ionic service.
Could this be accomplished only by gitignoring www/lib folder and platforms, and then running bower install in each dev machine after a new module have been added to the project? or is it more complex than that and we're omitting some important steps to allow the project collaboration without these kind of issues?
Yes, you can put platforms in your .gitignore. I personally wouldn't be putting www/lib folder there, though.
Also, I would strongly advise that on all the machines where you're building the apps locally you have the same version of Ionic and Node.
As I can see here you need OS X to build apps with React Native. That is probably because they used it at first to create only iOS apps. Now it's possible to create Android apps with React Native but they still require OS X as development platform which doesn't make sense to me. Is there any way to create Android apps using React Native on Ubuntu OS or any other Linux?
Update 2: I've been developing React native apps on Ubuntu for some time now, without any issues.
Update 1: It's almost possible on linux and windows now. Check this doc page: link
Old answer:
It's already almost working, from the issue shared in kzzzf's answer:
Everything works on Linux except:
react-native run-android can't open a new shell window, you need to
use react-native start. Will be fixed in next release. Debugging in
Chrome currently relies on an AppleScript to launch Chrome. There's a
PR to replace that.
Building on linux and windows is not officially supported although there are people in the community already sending pull requests that will allow to do so (main obstacle is the fact of using apple-script and calling to shell scripts from node - from react-packager and from react-cli).
Main task for tracking those efforts is here: https://github.com/facebook/react-native/issues/2693
While it's not officially supported on Linux yet, and there are certainly some hoops to jump through, I have created a docker container that allows me to build and run android apps from Ubuntu.
The dockerfile is still a work in progress but it's available on github: https://github.com/gilesp/docker/tree/master/react_native
There's a couple of shell scripts to make local development easier - I mainly use the react-bash script to give me a shell prompt in the container for running react-native run-android etc.
It works well enough that I can have a phone connected via USB on my host machine, the react native stuff running in the container and have my edits to the code (I mainly edit using emacs on the host) appear immediately on the device.
I'm currently working on CI builds for android as there are some more hoops to jump through to create the bundled version of the javascript for deployment.
It should be possible by now. For an up to date guide on "can i build for platform X on system Y", see:
https://facebook.github.io/react-native/docs/getting-started.html
I apolagize in advance for the extreme noobiness of my question...
I'm on mac os and using cordova to build an app. I know nothing of java or c, so the only thing I did was to put my index, js and css files in the www folder and test it with the CLI.
$ cordova emulate /* with android and ios */
$ cordova run /* with android and ios */
$ cordova build
I was able to make the app work on android and ios virtual and real devices, and got the BUILD SUCCEEDED message on my terminal.
But to be honest none of this is familiar and if it wasn't for a tutorial I read one line at a time I wouldn't have been able to do it.
The probleme is the tutorial stops at the build step, and I can't find any other tutorial that explains very plainly and simply(not to say idiotically) how to go from there.
I'm left with lots of folder and have no idea what exactly is the app amongst all those files.
How can I put it on my website for download? Do I need an executable?
For iOS and android you would typically have two different types of files.
iOS uses .ipa files and android uses .apk files.
I am not sure about Cordova, but generally the cross platform software would generate those two types of files, these can then be put onto the device and run.
I'm sure you've found out more since 2014 but for others (like me landing here from google), in Windows, at the CMD command line, use
WHERE CORDOVA
..to find where the cordova builder is actually located.
For Android, your output is an *.APK file which should be announced at the very end for the cordova console output, eg:
C:/MyApps/TrialApp/phonegap/platforms/android/build/outputs/apk/android-debug.apk
..where C:\MyApps\TrialApp\phonegap\ is your phonegap project folder assuming you are using phonegap.
If you do not want to submit it to Google Play, you can host the *.apk on various hosts including your own site, a freebee like http://androidhost.org/ (care, may download trash to phones), http://slideme.org/ or https://www.voltcloud.io/ etc.
Hopefully that will give other newbies a heads up.
I've been using eclipse to develop Android apps with phonegap until, a few weeks ago, I decided to try Sublime Text 2. I found it to be so much better than the eclipse editor so I would like to keep using it. Only thing I'm missing is a quick way to test the app on the device inside Sublime.
Luckily, someone else also had the same idea and developed a plugin for this:
https://github.com/Korcholis/Andrew
Sadly, I cannot get it to work, I installed ant and pointed the plugin to adb but then nothing happens when I try to create a new project (and there is no error message in the console).
I also found this other plugin:
https://bitbucket.org/ucomesdag/sublime-android
But I have no idea on how to install and run it.
Did someone else found a way to do this?
A quick update into 2014.
As of PhoneGap Cordova 3.0, it is no longer required to develop Android apps via eclipse. You are free to use any code editor or IDE you wish as app building is done independently from eclipse via a simple command line.
cordova run android to package the .apk and install on any active devices detected by adb or
cordova build android to package the .apk only.
In your case, you can keep using Sublime and pop in the cordova run android command whenever you ready to go on a test run.
While I agree with Insane Coder that you should stick with supported IDEs to develop for Android, according to this link and existing Sublime Text 2 Ant support, you could build and develop your android project with this IDE (It will just take some time to set it all up... as opposed to using a supported IDE like IntelliJ or Eclipse).
Using PackageControl, look for "Ant". That will install syntax highlighting for Ant. Another plugin that enables the build command (ctrl+b) to work for Ant files, "Super Ant". You should be able to code for android in sublime text 2 with those installed.
On another note... Do you use windows? The Andrew project you link to, seems to have Windows compatibility issues. Apparently related to locating the "SDK" (he says sdk in Andrew's github page but, probably he means JDK?) in your hard drive. Which is probably a hassle because Windows typically installs stuff to "Program Files" and in code, that turns into "Progra~1" because of the space. In the link I give you there is another approach to it, so when you install the JDK set a folder that has no spaces in its name, like c:\java\jdk1.6.0_02 or something else that strikes your fancy. The problem you could be having with Andrew is that it isn't finding the jdk in your hard disk.
I am starting with PhoneGap but I am totally lost : I followed the getting started tutorial, so I've got ADT bundle (android SDK + eclipse + ADT plugin), i used create.bat in cordova to create a default project and I can run it on my device from eclipse.
The point is that the tutorial stops there, and in the default project there isn't any HTML/JS file, everything is java/xml like a normal android project.
So i made a new project from existing sources and this time I used PhoneGap (still don't understand what the heck is the difference with Cordova and if I need both or not) so I selected the "example" folder in phonegap for my existing source.
Now I've got a project with some jar files, but also an assets/www folder with index.html and main.js so this seems fine to get started : the point is that I can't find any tutorial for android which explains how to build an app from that.
Also, Ecplise opens index.html in a kind of WYSIWYG view (without editing) and there isn't any switch to html code editor.
Do I need to install Eclipse Web Platform or anything ?
And please can someone here who understands all that more clearly help me out ?
Thanks
Firstly, on the Cordova / PhoneGap thing: originally, a company called Nitobi developed PhoneGap. They were then acquired by Adobe, who open sourced the framework under the Apache Foundation - this is what's known as Cordova. Adobe are continuing to develop the commercially-branded PhoneGap, providing services such as PhoneGapBuild around that, and are also continuing to contribute to the Cordova project which remains at the core of PhoneGap.
You're right that almost all your development once you've got going happens inside the assets/www folder - that's where all your HTML, JavaScript and images etc will live.
In Eclipse, you can install the web developer tools by going to Help -> Install New Software, and expanding the "Web, XML, and Java EE Development" group, then checking "Eclipse Web Developer Tools" and "Web Page Editor (Optional)". Much more detail in: https://stackoverflow.com/questions/54868/what-is-the-best-html-editor-for-eclipse
In terms of an ongoing tutorial, one of my colleagues is currently working his way through blogging an example of building a very simple CRM system using Cordova; you can find these posts at http://www.vsnomad.com/tag/dtw-crm-sample/. The blog assumes you're using Nomad, which lets you develop Cordova projects within Visual Studio, but if you ignore the VS bits, the HTML and JavaScript should still be applicable to you.
(Obvious disclosure: I work on the team building Nomad for Visual Studio. Hopefully the sample is of genuine use even if you're not using the product though!)