I am developing a hybrid app for android using Angular JS and cordova.
For build deployment, our organization is using Jenkins.
Now my issue is that through jenkins, I am building only the Android project folder inside the cordova project to generate the APK file.
I want to generate APK for different environemnts like Stage,Dev and Production by just changing a single property file.
How could the cordova+Angular project read the environment specific informations from a common file in Jenkins,also how to switch between different
build enviromnments in Jenkins.
Could anyone suggest the thoughts .I am still confused in finding a solution for this.
Thanks in advance
Related
I'm currently working on a Hybrid Mobile App using Cordova Tools for Visual Studio to render a Azure published Web App inside a mobile container.
The Web App is developed using C# and ASP.Net Web Forms. It also uses Azure for the Database storage. Everything works fine when running the Cordova app in the browser.
The problem that I have is that when I try to build the app into an .apk file it throws this error:
"Module 'com.microsoft.azure:azure-mobile-android:3.3.0' depends on one or more Android Libraries but is a Jar".
The only solutions that I came across were involving a bower.gradle file, but in my case the bower file it's a .json file so I can't use the "compile com..." inside the dependencies tag.
Any help will be really appreciated,
Thanks in advance!
Razvan T.
The problem was solved. The file where the dependencies were supposed to be added was build.gradle.
The solution was to open the project in Android Studio, make the changes and build the .apk successfully.
I hope this will help anyone that encounters the issue.
Thanks!!
I'm looking for a way to build a cordova app completely automatically, based on a existing web project. All I have found so far is to create a new cordova project and drag and drop my existing application in the www folder. The thing is, I don't want to do this step.
Therefore, I'm looking for one of these two possible solutions.
1. Privately hosted phonegap build alternative
Is there an open source project similar to phonegap build? One that I can host on my private servers. All I have to do in this case is zipping my project, upload it to the server and get the built application back.
What I have found is cordova-build (https://www.npmjs.com/package/cordova-build), but it seams quite out-dated and not well maintained.
2. Create a local build process
For the building process I'm using webpack. So what I would like to do is setting up a build process where I can just say
npm mobileBuild -- --platform="ios"
and it builds a new cordova project with my web application included. Later I would just have to run the cordova cli commands to build the application.
Do you have any idea how to accomplish one of these two approaches?
Thanks!
The existing web project must consider cordova related HTML like
<script src="cordova.js"></script>
But it will be missing on the already developed project... even the HTML/CSS will have to be different for every case.
I don't really see this as a way to follow, not automatically.
I want to convert my app into a hybrid app using phonegap build.
How do I do that?
I see different setups in basically every tutorial.
In this one, there is not a single platform folder, just the usual img/css folders, plus the config.xml
In many other tutorials I see a folder structure like www, platforms, etc. with the andorid and ios platform code.
How do I setup my phonegap project??? Do I need the platform, do I not need the platform, do I need the cordova.js, do I not need it??
It seems information about this is somewhat contradictory and often outdated.
E. g. I created my app using these steps.
Which does create all those folders like www and platform, however, the app doesnt install correctly after I built it with phonegap build. So something must be configured wrongly... I mean, it's there OWN site and it fails!
What is the correct folder structure that I need to convert my app into a hybrid app that will run on iOS, android and windows phone, using phonegap build?
It depends on whether you plan to use PhoneGap to develop or only to compile (Phonegap Build).
I will show how I used until a little time ago.
I used to develop an Ionic project and made all the development with it. When I needed to test something on the phone, I was using the Phonegap Build.
Both projects have the folder "www". To use Phonegap Build site, I was replacing the folder "www" of Phonegap project with the "www" folder of Ionic project. Then just send the Phonegap project ZIP to Phonegap Build site. This always worked for me.
After creating the project (phonegap create my-app), basically you do the project at "www" folder and configures preferences in config.xml (fullscreen, plashScreen, android-minSdkVersion, etc).
If you use Phonegap Build site you donĀ“t need to add platforms (platform phonegap add) and not need to run "phonegap run android"
PhoneGap Build's only requirement for your application structure is that the config.xml and index.html is in the top level of your application.
Make test:
- phonegap create my-app
- configure config.xml (If necessary, not required)
- config.xml and index.html in the same folder (preferably in www)
- ZIP
- Upload ZIP on Phonegap Build
I want to build an apk with some large configuration from a xml file.I want to know if there is any method that can control the building process of apk or is there any way to create apk from our source with a little bit of modification on our source based on our config xml file.Or any other way to build apk file
I don't want to read my config file each and every time when the app run ,I want to include the change in application itself
All Suggestions,Comments,Answers,Ideas are Welcome
Thanks in advance.....
If you want to manually build your application :
First off, you should really understand the build process, if you don't.
If you are developing in Eclipse, the ADT plugin incrementally builds
your project as you make changes to the source code. Eclipse outputs
an .apk file automatically to the bin folder of the project, so you do
not have to do anything extra to generate the .apk.
If you are developing in a non-Eclipse environment, you can build your
project with the generated build.xml Ant file that is in the project
directory. The Ant file calls targets that automatically call the
build tools for you.
Once you understand the build process, you can start off by learning the commands to perform the various steps involved in building. The documentation talks about the various commands you can use.
This Tutorial on Ant takes you from start to finish on how to perform a custom build.
A few more tutorials:
Documentation
http://www.vogella.com/articles/AndroidBuildAnt/article.html
http://code.google.com/p/autoandroid/wiki/AndroidAnt
http://www.linux-mag.com/id/7667/
http://www.alittlemadness.com/2010/05/31/setting-up-an-android-project-build/
You can use the Apache Ant tool. It allows you to build your application through commands instead of with Eclipse.
You can look at the question asked and the answer given in this thread.
I use Maven. It's VERY hard to configure but is the best if you work in a team.
Please refer to the link below. This has step by step proceduce to automate Building of Android Applications
http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html
Today i wrote a simple PhoneGap app on Eclipse.And I became interested, is it posible to write one App on Java and all other platform versions to by generated automaticly,or for every platform I must create dev enviromnent and create a separate app .
Regards.
PhoneGap Build takes the files you include in the WWW folder in a PhoneGap project and then builds apps for multiple paltforms so you don't need to have a build environment for each platform you wish to target. iOS is a special case though.