I have a website, a set of HTML, JS, and CSS files, all this successfully works under Apache Cordova via WebView on Android.
I want to run it on Delphi, via TWebBrowser, but if I open index.hml via file:// then JS scripts will not get access to local files. Actually, the same thing happens on a PC, too.
I see the solution as follows: raise your HTTP server and connect to it from TWebBrowser. If my idea is correct, the actual question is: What is the reason to raise the WebServer for Android?
I am using Delphi 10.3 CE.
Related
I have this angular 2+ application to be hosted in an IIS or some server. I will be using this application inside a WebView of my Android/Xamarin application. I know we can embed a static html files or serve static html files from Android's file system to Xamarin's webview without hosting it. As it has disadvantages like couldn't offer offline application, I was wondering, if we can server angular 2+ application similar to static html without hosting in a server ? (as in server, for SPA apps we can enable redirect rules to serve index.html in case of http request for routes).
Android emulator provides url to load content at 10.0.2.2:port
So you can run Angular cli server/iis and
Just load application in emulator with same port number of iis or your webpack
When you say android application I understand its a .apk executable. But When you say developing android application using html, does it mean we still get a .apk file or when we develop using html, is it then called as android web development, which means you won't get a .apk file. But you get a html file that runs on android browser. Is that a correct statement. Because apart from Java and C# Xamarin which will produce a .apk file, I dont think html--->.apk file never happens.
So .apk file means apps similar to windows applications, and using html means we
create a mobile web application?
does it mean we still get a .apk file or when we develop using html
It can, if you are using tools like PhoneGap.
or when we develop using html, is it then called as android web development, which means you won't get a .apk file
An HTML5 Web app, particularly with offline caching, can feel a bit like an app. However, it would be written as a Web site or Web app and distributed as such, not distributed in the form of an APK.
I have a web app, which contains a set of html, js and some static files like images,videos etc.
Specifically, I don't need a web server to run them. I can rum them in the desktop browser as a file protocol don't need the http protocol.
But when I take the same set of files in Android , it does not run and says Javascript is turned off (Android's stock browser, Firefox, Chrome or Opera). However, Javascript is turned on.
Do I need to serve the files from a web server or use http protocol if I am on android?
I have a simple web app built with Phonegap and Android that call external ressources (js, css, html) from server instead of storing it in Phonegap assets folder. I prefer using external ressources because my server can deliver html pages taking in charge internationalization.
This web app work fine on my android device when WIFI is on but it fail when stopping WIFI. My index.html file delivered by my server contain a valid manifest file with correct mimetype ('text/cache-manifest') that list every files the app need to work.
My Android Activity class is supposed to have caching enable:
this.appView.getSettings().setDomStorageEnabled(true);
this.appView.getSettings().setAppCacheMaxSize(1024 * 1024 * 15);
String appCachePath = getApplicationContext().getCacheDir().getAbsolutePath();
this.appView.getSettings().setAppCachePath(appCachePath);
this.appView.getSettings().setAllowFileAccess(true);
this.appView.getSettings().setAppCacheEnabled(true);
It may worth mentionning that my app use ajax call with urls like /aaa/bbb/ to call web pages from server and I don't know if that may be the problem (l'm not calling physical pages directly like index.html)... However, this web app work well in desktop browser (Google Chrome) when offline...
Any idea what more can I do to enable this HTML5 cache feature on my Phonegap app?
Thanks a lot
After playing around for a while I get it to work. Here is some points you should verify when stucked with this type of caching problem:
Take care about url parameters passed with GET method... I was passing parameters when navigating between pages of my app and those parameters was making my urls different from the ones in manifest file making cache to fail.
When testing offline mode on my phone, I was only shutting down the WIFI thinking this was enough to trigger cached version of my app but it was not... As I was testing my app published under a local network IP (like 192.168.2.11), it appear that my app was trying to reach that IP trough the 3G network that was still ON... So use airplane mode when testing offline.
Not sure if this one was necessary as I read it on some others threads but I renamed my manifest file to cache.manifest.
Regards
Apparently you need "to fix the Android Shell Native App to enable HTML5 caching".
If you haven't already, please check out: http://tmkmobile.wordpress.com/2012/03/04/html5-offline-solution/
I am developing a similar system. What I did was I created the Phonegap webpages and stored them in the www folder of my WAMP server. Then what I do is I basically super.LoadURL("insert_ip_address_here/insert_name_of_folder_where_webpage_is_located") in the onCreate method and this loads the phonegap application perfectly (yes all you need is just only line of code in the Android app itself). However you still have to make sure that the config.xml, manifest and all configurations needed for phonegap are properly done (for instructions on this see https://www.adobe.com/devnet/archive/html5/articles/getting-started-with-phonegap-in-eclipse-for-android.html).
Let me know if this the path you choose to pursue. I can provide extra support with things like making the ip-address (in the line super.loadurl(...)) dynamic for the local system using multi-casting, etc.
If I create a html 5 application for a phone (using phonegap or Icenium) that calls a webservice which needs a username/password, can a person look at the code somehow or is the JavaScript compiled away or obstructed in some manner?
Assume in this case that the url is in a javascript file with username and password.
Neither Phonegap nor Icenium (both based on Apache Cordova) obfuscate or compile the JavaScript code of your app.
You can take any Cordova app for iOS or Android and simply unzip the .ipa or .apk package to reveal the HTML, CSS and JavaScript code that powers the app.
If its a regular user, then most-likely not.
But if you are asking this question because you want to prevent someone that is skilled want needs to see your app for code. Then the answer is:
Nothing is safe in your clients device. Not sqlite database, not built-int storage , and not source code( weather its compiled or not);