Phonegap - HelloWorld app installed insted of "real" app - android

I run my phonegap app (phonegap run), but what I saw was a simple Hello World app.
In my project's directory I have files:
hooks/
platrofms/
plugins/
www/
config.xml
In www directory I have all files that are related to my app.
And when I phonegap serve I can see what I want under given address on a web browser.
I don't know wy on my smartphone I have only HelloWorld app with a blank screen, when launched. Could someone will be able to give me some tips, please?

Add platform Like this :
phonegap platform add android
in your project directory path using terminal.

Related

How to make Android App from existing Angular web app using Cordova?

I have an Angular project web app, which is running successfully in the Apache web server after I built it with "ng build ..." command. Now, I want to make it Android App, for that, I tried to use Cordova. First I create a Cordova project then under www directory, I placed dist files from NG. Yes, I also used the Cordova platform add android before that. But, when I install apk in an emulator or on a real device it is appearing blank.
I google and found many links but none of them worked for me. Maybe I am doing wrong. Please guide me.
You need to be change base url at your dist folder and i don't suggest cordova for angular. You can choose the Nativescript for mobile apps and it's native. Because Cordova plugins are not very compatible with Angular.

Build a phonegap app with phonegap build

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

How to merge Cross platform Phonegap app html files without affecting native code

I am working on a cros platform phonegap app. Basically it is working on Android,iOS, Windows phone. Usually i am doing edits on root WWW folder and run terminal command
phonegap run android
phonegap run iOS
It creates projects for each platform. But if i do a platform specific change in native code , "run" command will replace changes. Is there any standard way to sync changes.

How to build Existing Sencha touch application using Cordova / Phonegap?

i am new to sencha touch and cordova. So please help me to build a mobile app using Sencha touch 2 and Cordova.
My Problem : Sencha Touch Mobile application using multiple Sencha Application within workspace.Now i want to build Sencha app for Android using Cordova / Phonegap. Please help me to build single apk file for my entire project.
Folder Structure :
Project Folder/
workspace/
Sencha App1/
app/
app.js
app.json
...
Sencha App2/
app/
app.js
app.json
...
Sencha App3/
app/
app.js
app.json
...
Sencha App4/
....
like this.
i am maintaining 7 sencha application within sencha workspace.
My Questions :
1) Can i build single apk for my entire project?
2) If i build separate apk for each app then how can i integrate all?
3) any other option to build / package for single apk ?
i am still in confusing so please let me make clear and give any solutions. Dont mistake me if i miss any spelling. Thanks in advance.
firstly i would like to tell you can install/create number of application irrespective of apps Folders or workspace.
Below things you should have to create build.
To build an APK you need to have cordova install on your machine.
you can also create APK from "https://build.phonegap.com/people/sign_in",Just need to have demo account it will allow you to create android and others platform apps just for once. All you need to zip ur code and upload code to mention link after login with ur credential.
Eclispe is also other options
my Question to you
Are you using Sencha Architect or sencha CMD ?
Thanks
Sachin

Multiple Html files in PhoneGap Android project

I am developing a cross-platform app with Phone Gap, Jquery Mobile in Android using eclipse. I am not at all using any PhoneGap functions in my app. My purpose with PhoneGap is to build native apps for ios, Android, windows etc from Adobe PhoneGap build service. Under android assest/www/ folder I created multiple sub folders like css,js,html etc, where I put my jquery mobile html,css,js files and my custom js,html,css. Note under www directory I have cordova.js and index.html, cordova jar also included in build path. My app is working fine, when I run it in eclipse + Android emulator. It is generating valid apk and opening my app root page welcome.html, which is under www/html/welcome.html. The problem is when I generated android build by uploading my code to Adobe PhoneGap Build service, it is giving valid apk, which after installing opening index.html, which is under www/index.html. I my DroidGap actvity, i am loading welcome.html only.
super.loadUrl("file:///android_asset/www/html/welcome.html");
any suggestions plz. I need to have multiple html pages and folders under www directory because some design restrictions.
I am not sure if I uderstood what you mean.
Perhaps you could try:
$.mobile.changePage('./html/welcome.html');
Add this to your javascript event's listener, it should work.
For Phonegap Build to work, all your generic src files need to be in www of the base directory. Any Android specific files go in /www/res/android or /merge. See phonegap and/or codrova documentation.
One of the problems with using Eclipse and Phonegap together is that if you imported your project as an existing Android project, then all work you do is in the Android platform directories, not www.
Main reason why I now use Netbeans with Phonegap 3.0 CLI:
In terminal:
phonegap create [project dir name]
cd [project dir name]
phonegap local build android
add plugins
replace generic phonegap /www files with your project specific files & dirs
In netbeans IDE:
new project -> html5 -> use current src code
tweak /www/context.xml app name, ......
.......
In terminal:
adb connect 192.168.1.??? [Android-X86 in VB guest]
adb devices [are devices showing?]
phonegap local run android [build and installs to VB Android-X86 guest]
debug ....
phonegap remote build android [use Adobe Phonegap Build]
.......
Note: new Netbeans 7.4 RC2/Development includes Cordova development. Tried, but while has some interesting features, seemed to include the kitchen sink when doing initial build. Very slow to compile. Disabled feature. Also background scanning chokes. Turned off with plugin, but remember to manually rescan project files, especially if did work outside IDE. Couldn't set up Android-X86 in VB as my emulator. Why I use the above workflow.
Peter
By default the index.html, or in this case, welcome.html, should be located in the root of the www directory. Since it is not the case, you could try to add the following tag in your phonegap/cordova config.xml file
<content src="html/welcome.html" />
my suggestion is that you copy all the contents of welcome.html to www/index.html and let the default super.loadUrl("file:///android_asset/www/index.html"); as it is. you can later switch views using window.location.href='html/anypage.html';
i have the same kind of problem. i am converting my html website files in android studio. so, under the assets i paste my website folder.. how can i run all the html files i imported? i used the code webView.loadUrl("file:///android_asset/anamayyy/main.html");
and it only shows the main html. the links that i used as button doesnt work..
the links as buttn for next page doesnt show(webpage not available

Categories

Resources