Converting responsive web app to Mobile app? - java

I have my responsive web application in place which works across all browsers. Now i am planning to work convert it into
mobile application. Did some googling and can think of below ways to come up with mobile app
Approach 1 :-
Can be done with the help of WebView (which actually will work as thin wrapper)
Approach 2 :-
Native App:- . Develop Native app. Now, If I need to develop the native , Can i use existing backend java code for Android/IOS/Windows platform or do i need to make modifications in that ?
If yes will these modification vary per platform i.e. Android/IOS?
For User interface, i believe i need to develop altogether separate views. Is that correct ? If yes will there be separate views for android and IOS ?

If your backend java code is sitting on a server behind some sort of API (REST etc.) then it can be used by both applications.
If you are developing natively for both platforms then you will need separate views. There are however solutions for developing for both platforms using a single codebase see: Xamarin Cordova

Related

How to make a mobile app using HTML CSS and JS?

I am planning to develop a mobile app using HTML CSS and javascript.i plan on storing data in a local file instead of a database.how can I develop this? any ideas? The app will run in the browser of the mobile device. (this eliminates login)
The concept of the project is good.ive also designed the UI.
I think you're talking about making a website with a javascript app in it. Mobile apps are made with swift for IOS and android apps are made in java or c++.
There are programs that will take your website and put it inside an application container (mostly for android) but these programs are not recommended.
I would recommend learning swift or Java or c++ and make an app or using your html/css/javascript knowledge to make a web application.

How to create a desktop app for the existing web application?

Well, I've tried to do some researches before creating a question but only a little has been found.
Basically, I have got a Spring-based web application. Apparently, you can navigate through web application using HTTP requests and URLs. If you want to edit a user you do a GET request /users/edit/{id} and a new page appears. Then you make some changes to the user and do a POST request /users/edit/{id} and let's say the main page appears.
So, now I need to create a desktop application which can do the same things.
Do I need to rewrite the whole app to port it on the desktop? Is it possible somehow to do sort of HTTP requests from the desktop app to the server, then get a response and process it? Or perhaps there is a proper way to do it?
I feel like it's a big topic but I only need you to point me in the right direction as I'm lacking experience in creating both desktop and web applications together (I'd say, I have never ported app from web to desktop and vice verse).
Earlier I created a few apps using JavaFX and I want to use it again as my GUI platform for the desktop app.
You can go for a solution like, Electron.
It's a framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It uses Chromium and Node.js. You can develop your desktop GUI applications using front and back end components originally developed for your web application.
I'm just pointing you a way. You can look in to this solution and it's also open-source.
If you were about to develop the frontend from scratch I'd recommend you to use something like Ionic Framework where in the latest beta 4 allows you to write once run everywhere (web, PWA, desktop with Electron, and build native build for iOS and Android).
Basically Ionic is an Angular 7 library/superset that allows you to create mobile apps based on a webview. This webview can be embedded and run on any device in a native way.
Even though the same codebase can be run on multiple devices you can customise the look and feel on each platform and access through Cordova, Electron or Capacitor the native device capabilities and hardware.
If you don't want to rewrite the web client, you can use any desktop framework with the preferred language you want. Any modern language/framework will allow you to make HTTP requests against your backend and get the data through your API.
Honestly, nowadays I'd day that JavaFX is not the best option out there and I'd recommend you to go through the web-based approach.
Good luck!

Same Sencha app for web and mobile

Query is : I have a current web application in place to provide me data in a list which is built using java and ui is built using jsp. I want to design a mobile app in Sencha to perform the same task and simultaneously want it in desktop using Sencha/ExtJs.
Now I am confused in following manner :
Do I need to create separate applications for web app and mobile app?
For the web app I need to load a separate set of files whereas for the mobile app it is different. If the application is one then can I do this?
Also, all the java files which I am using for the getting the list data, should be in same code base or separate?
Thanks in advance.
Sencha is a mobile app development framework based on HTML5 and query. So the controls and views are basically designed for mobile screens. But it does not stop you to display the same content on normal desktop browsers. Although what looks great on mobile may not look that good on a browser and vice versa.
Do I need to create separate applications for web app and mobile app?
Not really, everything can be same, views middleware and even backend. If you can design a UI that may look both on mobile and desktop then you are good.
For the web app I need to load a separate set of files whereas for the
mobile app it is different. If the application is one then can I do
this?
As I said above, except UI nothing should be a concern. If you want different look and feel for web and mobile then just create different HTML files for the said purposes. But you can use the same backend logic.
Also, all the java files which I am using for the getting the list
data, should be in same code base or separate?
Generally dynamic web applications fetches the data from backend servers using ajax/http service calls. You may manage the code in a single project or can divide it in logically smaller projects for better management. Maven should be a good choice to manage your projects.

Converting Android app to Java Desktop app

I developed an application in Android. Now i want develop same application for Desktop using Java. Is there any tools or procedure to convert existing Android app code to Java Desktop app.
Thanks in advance.
Android application will definitely not work on desktop computers out of the box, unless using an emulator. However, as specified by Android documentation:
Android platform using the Java programming language
Android uses Java. That means any java code that is well encapsulated in a domain layer independent from the android UI can be reused as part of a java desktop application.
If the application is well designed and GUI well separated from domain and other layers, this will boil down to only converting android UI elements (eventually along with a presentation layer) into java desktop components (SWING...)

Desktop & mobile web application with offline handling

I am evaluating different approaches to building a web based application which handles offline disconnection gracefully. The intention is to create a desktop/tablet UI and a separate mobile UI for the app, backend functionality would be implemented in Java. In principle, the components are mostly there; HTML5 offline seems to have wide support and works well while Web SQL has enough support (Chrome, Opera, iPhone & Android) that we could work with it for offline storage.
As regards creating the UI, it would be nice to use some of the nice JSF libraries out there (Primefaces looks quite nice for example although I've never used it in production). So far, I can't think of any way (and I can't see anything mentioned) of using either HTML5 offline or web SQL in a JSF app. Has this been tried? Is there any methodology/framework that might help here?
I'm also not averse to using client side frameworks. I was very impressed by Dojo for example but then found that it didn't render well on Android with webkit so that ruled it out of use for the tablet scenario. I can probably make jQuery work but I find it to be very fragmented (for example, getting an accordion to handle resizing inside a layout frame just put me off). Finally, I looked at GWT; I wasn't keen on the complexity of getting offline to work and the support for web sql seemed to be a work in progress (no slight intended to the developers, it just seemed to be at an early stage).
So, given the requirement for a web app that runs on desktop/tablet (android) and also on mobile (Android & iPhone) and which handles offline, how would you approach things?
Thanks,
Phil

Categories

Resources