Is it possible to create an Android app for an existing web application which doesn't provide any API?
Webview just provides a crude view of the same web app in Android, but interface with webview looks crappy.
What you're asking is very possible. Just load up your URL in the webview and then redirect all clicks to go back to the same view. There you have an embedded website into an application.
What do you mean by interface for WebView looks crappy? You can make it look like anything native on the phone.
If you want your web page to have the look and feel of a native android app without creating the native app, you'll need to do so using javascript on your served page. Take a look at http://jquerymobile.com/ which seems to do a lot of the leg work. You can use that javascript and a little elbow grease to accomplish what you describe.
Related
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!
I have a question bothering me for these few days, I want to implement browser-like WebView, which has add/close tab and open multiple websites. But after I searched through many forums and documentation still couldn't find any solution for this, wondering can WebView do exactly what phone browser can do?
This is answered by the documentation.
Building web apps in WebView
If you want to deliver a web application (or just a web page) as a part of a client application, you can do it using WebView. The WebView class is an extension of Android's View class that allows you to display web pages as a part of your activity layout. It does not include any features of a fully developed web browser, such as navigation controls or an address bar. All that WebView does, by default, is show a web page.
So the answer to your question is No. The WebView class cannot do exactly what a phone browser can do.
This does not stop you from implementing missing browser features for yourself ... starting with WebView. However, the javadoc for WebView states this:
In most cases, we recommend using a standard web browser, like Chrome, to deliver content to the user. To learn more about web browsers, read the guide on invoking a browser with an intent.
And more ...
for my GoogleMaps API to run, the user needs to install Google Services.
I don't want my user to feel obligated to do that. I wonder if it is possible for me to create a fragment or something like a WebView and access Google Maps through browser (frame in my app) and the user doesnt need to install google services.
Any advice, tutorial or example would be very appreciated. Thank you very much for your time!
You have to use WebView element and simply use this:
WebView browser = (WebView)findViewById(R.id.browser);
browser.loadUrl("maps.google.com");
Or use this
I am developing a web application using Java (Servlet, JSP). In a JSP page, I want to show the web camera window to the user. When client clicks a button "Capture", then I should be able to capture the image and store it in some place.
I have done a lot of research, but could not find a satisfactory solution.
That's where the beauty of Applet comes in. Facebook has an Applet that connects to the PC camera and does capturing.
This site provides a good example in JSP:
http://thenerdinme.com/do-it-yourself/how-to-take-screenshots-with-java/
Why do not use something like flex which provides better support for this?
Ok to be more specific... can I program an android app in Java that has something like a web view to which I can point to local files on the phone?
I'm thinking about making an android game and i'm wondering if it can be done with a little HTML5 and Javascript that is locally stored on the phone. I heard something about a web view in Java and that is why I am wondering if it could work.
Is this even possible?
As the other answers might be correct, there is a much simpler way:
If you know html5 programming, you can do a simple Android app that has one Activity containing one WebView. In that webview you load your index.html and there you go. You can basically do anything you would do on a normal web app.
PhoneGap and Appcelerator are for cross platform development and they provide access to the hardware (vibration, sensors etc) and they give you the possibility to build the native UI with html and javascript. For a pure WebApp they are not the correct frameworks/tools I think. I might be mistaken, but a WebGL Benchmark I wrote for PCs worked out of the box in the android browser and I justed used html5 and JavaScript.
Your answer is yes, your solution is phoneGap
http://phonegap.com/
yes definitely,
check out appcelerator.com, phonegap.com etc
u can probably go to google "cross platform mobile development"
there's a few neat html javascript frameworks