Dynamic Web App to Phonegap - html

I'm trying to turn a simple webapp into an Android app by using Phonegap Build. My webapp has some simple jQuery AJAX methods (GET/POST). I'm not sure how to go about this -- when I upload the zip to Phonegap Build, the zip includes the html file, the css file, and a js script which is basically the Node.js server.
My HTML file includes some javascript that relies on GET/POST from the server, but it never runs in the android app that is built. I have tried whitelisting the localhost in the config.xml file (10.0.2.2) but this is also not working. Anyone have an idea? Should I not be using Phonegap Build? Thanks.

PhoneGap will not allow you to run any node.js script. Node.js - is server side solution.
What you are looking for is to make front-end in html+css+js, that will speak to your node.js using AJAX. But node.js have to run on hosting that will be available online. So that way your application will speak to node.js process that will server all clients (PhoneGap applications) via HTTP (AJAX).
Please remember, that StackOverflow helps with specific code problem, not knowledge or generic questions.

Related

Deploy Angular Backend API on Azure

I have made a backend API that connects to the sql that is also hosted on my azure account, however im not sure how to deploy this api on azure and make it available on there so that i can deploy my angular app to connect to this url instead of localhost.
Do you guys know of any tutorials or advice on how to deploy a backend typescript based api on to azure
thanks
There's a new service in Azure that sounds like it fits your needs perfectly: Azure Static Web Apps.
You can find a tutorial in the documentation: Quickstart: Building your first static web app.
Azure Static Web Apps is a service that automatically builds and deploys full stack web apps to Azure from a GitHub repository.
and
What you can do with Static Web Apps
Build modern JavaScript applications with frameworks and libraries like Angular, React, Svelte, Vue with an Azure Functions back-end.
Publish static sites with frameworks like Gatsby, Hugo, VuePress.
Deploy web applications with frameworks like Next.js and Nuxt.js.
Source: What is Azure Static Web Apps Preview?
EDIT:
In short, this service enables you to build a frontend using libraries like Angular, Vue and React, and also provides a way to build and deploy an API using JavaScript or TypeScript Azure Functions. You could, of course, do this manually, but if there's an integrated service for it...
As posted in the comments: I do not mean Static website hosting in Azure Storage, although that could work perfectly fine although it doesn't provide a solution for the API.

How to deploy Java Web Start under Apache Karaf?

One of our enterprise application is running over Apache Karaf , this application is accessed through web client.
We have another standalone desktop Java Swing based application. We want to invoke this application from browser.
So , we decided to deploy this application as Java Web Start and allow clients to invoke this application.
We have lot of examples how to deploy Java Web Start with tomcat like web servers.
But we want to deploy this in Apache Karaf . Anyone is having tutorial or notes for this?
I would strongly advise against Java Web Start.
If you don't want to rewrite the app, have a look at webswing. I have never used it but they claim they can convert Swing Apps to Web Apps instantly. I also have no idea how that would work with OSGi. Depends on what they actually do it may be easy or impossible.
If you are OK with some changes you can try JavaFX or Vaadin. Both are quite similar to Swing in terms of development style so it should be relatively easy to convert your app. Both can run inside OSGi container with some minor limitations and after some adjustments.

Can I deploy an HTML5 application using the WebAppRT executable?

I see that the lastest versions of Firefox come with a webapprt.exe and webapprt-stub.exe executable. I think that they are for the Open Web Apps system but I would like to know if it's possible to use the WebAppRT container with external made applications. I mean that I could distribute the WebAppRT executable, the shared libs required and my HTML files and deploy it offline without having Firefox installed.
Why?
What do you mean by "external made applications"?
Why don't you just create a web app as explained in Building Web apps - App Center | MDN ?
It will take care of the details and allow your app to reach more platform than doing it manually. For a glance see Platform-specific details of app installation - App Center | MDN
You don't have to do anything special to install apps on different platforms. All the information you need to provide, such as the app name, is contained in the app manifest. Here are some platform-specific details about how apps are installed on each platform. These details assume that Firefox has been installed on the platform.
To make that path easier, you can follow tutorials or clone an existing open-source web app that has something in common to see how it's done.
What did you mean?
If you mean to just manually locally install a some app that you write, the simplest thing to do would be to install any app, look at what's been done and replicate the steps with your app. But what's the point?
My guess is: it will work only if the local OS has a platform to actually execute the app. Then that platform will also be able to install the app properly. So, it will be simpler to you to just make a regular web app and have it installed through standard means.
Or were you thinking of something else?

PhoneGap app to act as a server

I am trying to develop an HTML5 app to be ported to native via PhoneGap. Is it possible for the app to be able to act as a server on a mobile device, with the same app on another mobile device acting as a client and connecting to the former? This is all within a local network.
I am new to PhoneGap and I understand that most server implementations are on platforms such as node.js or PHP and that PhoneGap only supports HTML, CSS and JavaScript. I think I might be partially wrong here as there are various plugins that could help ease the abstraction between PhoneGap and the native developer.
Other alternative suggestions are very welcome :)
What exactly are you trying do by having a client/server app? I think your best bet would be to have one app that posts and gets info to your own webserver (not an app). Therefore, that one app can act as a server by "publishing" information to the server and the other can act as a client by only reading from the server.

Integrating a Swing App With Tomcat

I recently created a web application with GWT. Then re-used most of the code to create a Swing version of the application that accesses a local database in offline mode. I am now implementing the 'online' mode of the application and want to access the same data as my GWT application.
Any ideas? Considered connecting directly to the MySQL server via SSL, but that's not working and doesn't seem as scalable. Should I use REST?
Any suggestions would be helpful.
To solve this problem in the past, we've used Jersey to create REST Web services which returns protocol buffers. The Swing app would then interact with the protocol buffers. The GWT app would ask for content type 'json' and receive protostuff objects in return. It worked quite well. That way, both apps can communicate with the server in the exact way.
Edit:
To allow your swing app to communicate with GWT-RPC, look at this blog article.