With Phonegap apps, is the javascriptcode visible on Android and IOS? - javascript

I am creating an app and will use Phonegap to make it for both Android and iPhone.
Will the javascriptcode be unavailable since it is now installed as and app on those devices?
I have seen you may obscure it but that's just to make it harder to read, not unavailable.

Yes, the JavaScript is easily extractable. For example, in an iOS app, an .ipa package is just a zip file. If you unzip the IPA, then look in your app bundle, the www folder (for example) containing all of your HTML, JavaScript, etc. will be available.
You can do your best to obfuscate your JavaScript, but at the end of the day, it needs to be available for execution.

Related

Copy entire website to iPad

I've created a website for a client's salesforce to use in hospitals, where they can't use wifi to access the internet as it can interfere with sensitive medical equipment. The website uses HTML, CSS and Javascript and does not require any form of server to work, which is fine when run locally on a laptop. However, they now want to use iPads and I've been trawling the Net for a simple solution in which I could copy the entire site to an iPad, while maintaining the site's directory structure, and then launch it locally with the browser. Nothing that I've found seems to be able to do this, although it seems such a ridiculously straightforward thing.
The best I've been able to do is to email the zipped site to my iPod, and then use the FileManager app to unzip and run the site in its own browser. It's useable but not great (every time you tap something you get an overlay at the top of the page) and there's no way I can find of adding a shortcut to the desktop - is there a better way of doing this?
You can look into something like React Native which allows you to write javascript HTML applications and deploy them as native iOS and Android applications. It shouldn't require too much work to move it over enough to just compile it and run it as you do currently.
https://facebook.github.io/react-native/
Cordova to package it in to an app https://cordova.apache.org/

Distribute Single Page Application as native desktop software

Is it possible to pack s single page application (its JavaScript files and images and all the assets) so that it can be distributed as a native
desktop application? Like having an instance of Chrome without any button that just runs your application offline.
I've used software that seems to be crafted like that, for example TweetDeck by Twitter gives me the impression of being just the web-version of TweetDeck packed in some way to run in a context that is not your standard browser.
You can use NW.js (previously Node WebKit) or Electron to do just that.
There's NW.js.
To package nodejs / html apps on the desktop.
You can do it by implementing a headless browser application.
There is an open source web browser engine here https://www.webkit.org/.
You incorporate it in a native application and parse the source files.
The webkit documentation presumably contains the specifics, have fun :)
Very much possible and all HTML5 apps are doing that, all your need is this:
https://cordova.apache.org/

Can I / should I download html5 code within a cordova app?

Lets say I had a HTML5/JS based application that is wrapped in cordova phone gap. Can I have it startup and download additional html5/js files? Basically the app would work with the base files, but additional features or changes can be provided and downloaded instead of installing a new version of the application.
The use case for this would be an app for a business which may want to have their own extensions.
Is this a possibility? Would this cause the app to be denied in the apple app store? What are your thoughts?
Thanks!
Theoretically it is a violation of the rules of the Markets. But in practice, many loaded some modules through the frames.
Answer from comments:
"3.3.2 An Application may not download or install executable code. Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded. The only exception to the foregoing is scripts and code downloaded and run by Apple's builtin WebKit framework, provided that such scripts and code do not change the primary purpose of the Application by providing features or functionality that are inconsistent with the intended and advertised purpose of the Application as submitted to the App Store." – Potassium Permanganate Sep 18 '15 at 16:33

Can a web application be converted to a google chrome application?

We have a very simple digital signage application that loads six web pages and rotates through them in an iframe.
We thought we would like to take this application and run in kiosk mode as a chromium app. However, simply using the HTML in the page has thrown all kinds of errors for the app. The most consistent on is the illegal use of external images, css, and fonts as well as complaints about javascript libraries, etc.
It looks as though it will be extremely painful to try to make this into a kiosk app.
Is it possible to make this type of conversion?
Does anyone have advice as to how to proceed?
Can you pull in external pages into a Chromium app?
You cannot run Javascript on a browser via local filesystem for security reasons. But what you could do is package the web app as a local app.
One option is to use Windows HTML Application (HTA)
http://en.wikipedia.org/wiki/HTML_Application
But this requires Internet Explorer to run.
Another option that sounds great is using Node Webkit. I have never done it before, but seems very powerful.
https://www.npmjs.com/package/nodewebkit
You can write a powerful Javascript app and run it locally this way.
UPDATE
Official Node Webkit website:
http://nwjs.io/

PhoneGap Build Service "Build in HTML5, CSS, JavaScript" claim

The PhoneGap build service says you can build an app in HTML5, CSS, and JavaScript. However, The phonegap.js is not available for each device (latest download PhoneGap 1.8.1 does not have one for Bada or iOS). So I think the build service is meant to save us from creating the shells for each environment, but I fail to see how the PhoneGap API is supposed to work.
I thought the idea too was that you could build one code base for each environment. I know there are quirks, but why is there a separate phonegap.js file for Android, WebOS, etc.?
The lack of documentation has me confused.
In my experience, there are separate files for each but when using phonegap build if you want to include a universal file for the build there is a way, put <script src="phonegap.js"></script> in your index.html file and don't include any js files, you actually don't even need the phonegap.js file, when I did this and ran it through phonegap build it attached the appropriate .js file to the appropriate build and I suddenly could use the phonegap API's for all the builds I was testing
The phonegap framework is made for specific Mobile Operating Systems. The reason why there are so many is because each framework is for each type of operating system. Like for games, most only work for Windows and some for mac, but very little support for Linux based systems. Phonegap creates APIs for using the camera and other functionalities of the operating system.
Phonegap has their tutorials to show you how to install for iOS and Android. I have not developed for newer systems.
Many people use jQueryMobile to develop with PhoneGap to create a nice simple mobile application.
I hope this helps.
Whilst there are different phonegap.js files for each device, they are very similar (I found this out because I accidentally copied it from an iOS project to the Android one a few times). The differences are important but they do pretty-much work as-is.
The main reason they differ is that they just expose the underlying functionality provided by the Phonegap device-native code (Java, OC etc), which IS device-dependent. The Phonegap devs just take care of hiding that from you. All of the phonegap.js files expose the same functionality, they just connect sometimes to different places 'on the inside'. Hence the differences.
Most source 'you or I' would write for a Phonegap app is device-independent as a result of the above.

Categories

Resources