I'm coming behind another developer who built a PhoneGap/Cordova HTML 5 application, currently only targeting IOS. Admittedly, I have zero experience with Cordova and hybrid mobile apps.
I can open up the XCode IDE and run the application and I can see the web page (application) load up in the iPad emulator, so long as I have his Node.js application running.
I guess I'm confused about the context in which the actual index.html that makes up the HTML 5 application runs. Does it run on the iPad under a mini web server (http://local or http://localhost) or does the index.html run on a file system path (something like file://path-to-file/index.html)?
I've used Icenium (Telerik AppBuilder) and created an empty project for which I copied all the HTML 5 code into and ran it. Upon inspecting/debugging the page in the emulator, I see that the page is being served up with a base URL of http://local.
Lastly, I simply tried opening the index.html by double-clicking it and running it in the browser (file:///...builds/ios/www/index.html), and the application didn't work
In summary, as long as I run the website in an emulator, the application loads and runs file, but it won't run loading it from the file system.
My assumption is the scripts are expecting an http base URL and the file:/// url is throwing it off. Does this sounds like a reasonable explanation?
Do Cordova apps run the HTML 5 apps under HTTP?
Thank you.
they run on a file system path (something like file://path-to-file/index.html)
if you are using something from the phonegap API it won't work on a desktop browser
Related
I'm using xcode with an angular/ionic framework hybrid app for cordova. On my windows machine, I've been able to build and run for blackberry and android with this code successfully so I'm not sure what's not right. The back end is a Microsoft Web API restful service with basic windows authentication from active directory sending back JSON serialized data.
The main data call boils down to:
$http.get('http://192.168.0.12/api/values/1').
success(onSuccuess).
error(onFailure);
I'm sure I have the usual in the config and NSAllowsArbitraryLoads on the info.plist. I also have the most permissible "Content-Security_policy" meta tag on the main index.html file.
I'm fairly sure none of these are the issue because the loads will immediately fail in the safari development simulator dialog. My issue is that the load simply never finishes. If I double click the resource name in the "Network" tab, safari will open and load the data appropriately.
Again, this fails in the osx simulator and on a device hooked to the network. But works fine on my physical blackberry (Z10 lol) and android simulator on my windows machine.
I have a Qlikview dashboard that I need to present and I've created a site that loads the Qlikview server onto the browser and runs it from there.
I now need to create an iOS app that does this. But the requirement is that the dashboard shouldn't open on the browser. The server should be loaded and run from the app itself. Is there any way to do this?
PS, I'm completely new to iOS App development and any help will be appreciated.
Yes. While saving it as a shortcut and opening it in the browser would be simple, using Apache Cordova is the best way to develop a smartphone app with HTML5/CSS/JavaScript. From the website:
When using the Cordova APIs, an app can be built without any native
code (Java, Objective-C, etc) from the app developer. Instead, web
technologies are used, and they are hosted in the app itself locally
(generally not on a remote http server).
And to make things better, it's open source.
I want to be able to access folders and files via my app, the problem is, when i want to access files on the desktop, i have to run it from a server or at least to emulate one using a program like xampp.
I know PhoneGap has it's own API to access files, but i need to make the app work on desktop too, and i don't mind it to be as normal offline website ( via index.html, not an exe ), but i still need to solve the security issues, i can't tell clients to run it from a server...
The big idea after it, is that i need the app to check for new files in the server, if there are any, to download them.
Also, i want the app to be able to access those downloaded files when it is offline as well.
I guess using only phonegap in ios will solve this, but i still need it to work on windows desktop as well.
PhoneGap released PhoneGap Desktop
http://phonegap.com/blog/2014/12/11/phonegap-desktop-app-beta/
I think this is what you are looking for!
How do you check what is the default browser to open a html file, and open it with another browser? I'm having security issues on Chrome locally, but luckily the application I'm creating allowed me to run an air application 1st. So I am wondering could there be any work around for me to open the file in other browser other than Chrome?
I have an entire day of searching and testing behind me and I officialy think it's impossible. Yet there is left to share what I've accomplished and ask for any sugestions.
So I'm working on Flash Builder 4.7, AIR SDK 3.5 and iPad 3 iOS 6.0.1.
What I want is to have an ad-hoc application to load a swf file containing actionscript and add it to stage. I started by testing the application in debug mode on device connected by usb. Everything works well. Then I compiled an ad-hoc release build, which did not work that well. Graphics was added to stage but actionscript didn't run. I've started to search the web and found out that it was possible to load swf's packed in ipa that could run actionscript, but it is no more, though there was a link to the download page of that SDK version under "Where can I get the build?"
It didn't work. I included the second swf in export package contents. Did I do it wrong?
Anyway even if it worked what I actually need is to be able to download a swf from a server, save it in storage directory and then load it to the main application.
Is there maybe a way to tell iOS that the application it's running is a debug version (that's actually working), but it shouldn't display the popup with information about connecting to a debugger and it actually should run fast like a legit release build?
Unfortunately you can not load any code from any server to execute it. Apple forbids it. The only code that can be loaded from outside and executed on iOS is JavaScript within the built in WebKit browser (using UIWebView or in case of Air - StageWebView).
As of air 3.6 (which is still in beta) you can package additional swfs with your application for later loading with Loader class, but this feature is still severely limited compared to normal web swf loading - you are only allowed to load code to the same ApplicationDomain your application uses and you can not unload anything so it is just easier to link all the code to one swf statically using swc libraries for example and not bother with loading anything.
We've found that loading SWFs with ABC code in iOS can be done without any problem with Flash Builder 4.7 and AIR 3.6 SDK. At this time Adobe Flash Builder 4.7 comes with AIR 3.5 SDK, so you can download the last SDK version from here and install it into your Adobe Flash Builder sdks folder.