I thought PhoneGap was a simple wrapper for HTML5, but it looks like it does in fact compile into native in some way.
I have a Cloud based, HTML5 Single Page Web application that I just want to run full screen, and distribute via an app store.
Should I just create a PhoneGap App with an InAppBrowser?
If you intend to publish an HTML5-based app in a "native" app store sucha s Google Play or Apple Store, you have 2 options:
1- Implement your own native application using a webview to show your web-based app.
2- Use some existing framework like Phonegap/Cordova even you do not use the native API. The framework will already setup everything for you to just deploy your HTML5 code.
However, if your web app is meant to be hosted remotely (i.e. not run from local files), you may encounter problems when trying to publish in the Apple Store. They have some strict rules about remote content, and about publishing apps that may not provide much more value and/or functionality than a simple web-app can.
Best.
Related
Have you already developed a Xamarin app whose views are generated from a Json recovered when launching the application?
I met a client with this kind of need:
they are developing a web app to prototype the screens by adding and positioning some controls (TextBox, Label, ...)
this generates a Json that must be interpreted by the Xamarin app: this will build the different views dynamically
in a first version, the user's data would be stored locally (through a file or SQLite) and synchronized "manually" when the device is connected to a computer
the app will work on Android only in a first time, and then on WPF
The client has not yet decided between Xamarin.Forms or Xamarin native, but it's probably more interesting to do it through Xamarin.Forms, even if iOS is not required: this should make porting on WPF easier.
Have worked on similar cases? Have you some recommendations? Are there plugins or patterns that could be used to simplify this development?
I've found this one, but it doesn't seem to be the same use.
There is also this article on iOS, but there is not the same thing on Android.
This would in theory be possible using a massive code behind builder for a page but should NOT be done for a production app. Mobile apps have very specific requirements that need to be thought of before attempting.
Xamarin is great for simplifying code reuse, and if you use Xamarin Forms you can reuse the UI components for Enterprise apps.(the less fancy and pixel perfect the layouts need to be the better. )
Your client would be better served by making it a mobile compatible web page instead from the details you have shared.
When looking up Electron and Offline HTML5, I have found it difficult to make a decision between which one to use for a project.
Assuming that a user will have to go to a certain website to download the Electron application, and would have to go to the same website to get the Offline HTML5 loaded, what are the pros and cons between using one over the other?
Some that I could think of:
Offline HTML5 can be updated without the user consciously updating their application by just making the user go to the online page again.
Electron would eliminate the need to code around multiple browser/browser version dependencies and quirks
It really depends on your exact requirements. The following is a list of everything that I came up with:
electron supports module system (i.e. require) both in main and renderer processes.
electron provides you access to OS APIs (e.g. fs). Without such many node modules will not work in the JS runtime of the browser (e.g. ip).
updating your app with electron is as easy as sending an http request. (or even better as described here)
an HTML 5 offline app requires a browser and the user might just give it IE6.
electron integrates with native desktop environment (see dialog, power-save-blocker, shell or even app for some examples)
electron enhances some of HTML5 APIs such as file API
electron lets you modify the default behavior of underlying chromium. For example you could intercept all URLs with file scheme and modify them on the fly*.
In short if you want your app to have a good native integration and act deterministic (i.e. no browser quirks) I suggest choosing electron.
*electron-jade for example takes use of protocol API to compile all files ending with .jade on the fly without the need to prior compilation.
DISCLAIMER: I am the developer of electron-jade.
I have read a few forums and articles on this but can't get a clear answer.
I need to build a mobile app that can run on any platform/device. It looks like HTML5 + jquery is the best option but I need the application to do the following:
The app must run on any platform (Windows Phone, iOS, Android, etc).
It must work as a stand alone application. Meaning it must work without internet connection.
Because it is stand alone, I need a local database on the device. The database can be embedded in the app. I'm thinking SQL CE.
The local database on the device must be able to sync to a SQL Server database.
The app needs to interact with features of the device like the camera, or GPS device.
Is it possible to build such a mobile application?
I am using ASP.net MVC 4 to do the development.
If you want to use HTML5 and JQuery then the PhoneGap/Cordova framework would suit you best.
Phonegap is a cross platform framework that gives you access to the device features like GPS and Camera using a standard javascript API.
The app must run on any platform (Windows Phone, iOS, Android, etc).
Phonegap is compatible with all these and many more including blackberry. See here for full list: http://phonegap.com/about/feature/
It must work as a stand alone application. Meaning it must work without internet connection.
PhoneGap runs as a native application inside each devices webview. It does not need access to a data connection to run
Because it is stand alone, I need a local database on the device. The database can be embedded in the app. I'm thinking SQL CE.
PhoneGap cannot run its own SQL Database like a standard native application but it can use the web standards Web Storage and Web SQL. Though this approach does have limitations. Read more about this here: http://docs.phonegap.com/en/1.2.0/phonegap_storage_storage.md.html#Storage
The local database on the device must be able to sync to a SQL Server database.
This would be upto you to design and implement but can definitely be done
The app needs to interact with features of the device like the camera, or GPS device.
Most device features supported with PhoneGap. See above link for full support list.
If the lack of a full SQL Database support is a problem for you there are frameworks like Titanium Appcelerator that build a fully native cross platform app for you that may be more suited to your situation.
http://www.appcelerator.com/platform/titanium-platform/
But if you're using HTML and JQuery to go cross platform then PhoneGap is your best bet.
Edit: Also there are plugins for PhoneGap to run a standard SQLite DB but this requires extra work on each platform. Every platform you develop for would require a compatible plugin.
http://brodyspark.blogspot.com.au/2012/12/cordovaphonegap-sqlite-plugins-offer.html
Use PhoneGap: http://phonegap.com/
or Apache Cordova: http://cordova.apache.org/
or Intel XDK: http://xdk-software.intel.com/
I am contemplating buying an iPad and am wondering what options I will have for developing an app for personal use ... specifically whether I will be able to do it as an offline browser app. The app currently exists as an Android Java app; it interacts with a large local database (about 3MB) and displays images and text drawn from a very large pool of resources stored locally (about 2GB).
My immediate questions are:
How would I get the files (html/javascript, database, images and text) transferred into the iPad's storage from a Windows PC? With Android this is a simple matter of hooking up via USB and using Windows Explorer. Googling suggests that for an iPad I might have to use an app on Windows called DiskAid, but this costs $25 which seems a bit steep for my simple purpose. Are there free alternatives?
Once the files are installed on the iPad how would I run the html app? On Android this appears to be a matter of keying "file:///sdcard/MyBrowserAppFolder/mybrowserapp.htm" into the browser's address box. Does th iPad browser work in a similar way.
There are two basic kinds of applications that run on iOS.
Mobile designed web applications that are hosted on a server and accessed through Safari or another browser.
Native applications built using Xcode and usually objective-c.
For the latter, you could use the phonegap framework to build an app using existing html and javascript.
My personal advice is to invest the time to learning how to code this up using objective-c. Depending on what format your db is in, importing the structure and data might be trivial. It will take an investment of time, but doing things using the native tools is the best choice for iOS development in my opinion. I was in the same situation (PHP, VB.NET and Javascript developer) and just decided to take the time and learn to do it right. This was a great decision and the development time of a simple to moderate application takes very little time now.
Safari on iOS does not support the URL's of type file:// natively. So you either write your own app, purchase an app or use something like a local web server after jailbreaking.
Alternatively, and if you can verify that the app you have mentioned does what you want to do, then maybe $25 is not so much of a price. Depends on what your time is worth :)
However there are cheaper apps around that allow to transfer and read html via wifi and usb. (Not sure I can name them here)
The USB transfer aka iTunes Filesharing is a standard function that a developer can enable in the info.plist of their app. Many apps use this to transfer data between Computer and iDevice.
I would like to build an app that heavily relies on Google Maps. Is it possible to write a native iPhone application in HTML/Javascript ? If so, will it be accessible from the app store ? Otherwise, how could I include Google Maps in a native app ?
You will need to build a framework application in Objective-C that contains a UIWebView. You can populate the UIWebView with your HTML/Javascript.
In my opinion the better alternative is to use the MapKit framework from a native app. MapKit lets you do almost everything you can do using the full Google Maps API and I think a native app will always work better on the device than a UIWebView container app.
I have used MapKit in a few of my apps and found it easy to use with nice performance. In the linked example I embed a MkMapView in a UIScrollView in page mode. I doubt you would have an easy time implementing this with a UIWebView and I am sure it wouldn't perform as well.
Yes, it is possible to do this. There is a great opensource project called PhoneGap http://phonegap.com/ that allows you to do exactly that. Not only but alos deploy on other mobile OSs like Android, blackberry etc.
To get on the app store, you need to register as an apple developer which is about US$100. Development can only be done on a mac) Apple gives you lots of software tools including code editors and iphone simulator.
Addressing the two parts of your question:
Is it possible to write a native
iPhone application in HTML/Javascript
? If so, will it be accessible from
the app store ?
There's a framework called NimbleKit that allows you to write your app in HTML/JavaScript and then converts it to Objective-C/Cocoa for you. There are several problems with NimbleKit, though:
It costs $99.
It adds a level of indirection that increases the chance of errors.
Because you're not using the 'real thing', you're much more limited in what you can do (i.e. you can only use what they have made available to you).
Another solution is to embed a UIWebView in a native iPhone app (you'll have to use a bit of Objective-C/Cocoa to do this) and then write the rest of your app as an iPhone web app that is loaded into the UIWebView. However, I would strongly advise you not to write an iPhone web app, whether standalone or embedded in a native app. As of writing, iPhone web apps have many disadvantages, including:
They're very slow.
They have limited functionality (e.g. no device APIs).
They can't take advantage of the Cocoa-Touch framework (a serious downside).
iPhone web apps may become viable in the future, but at this point in time, I'd steer away from them and write a native iPhone app using native technologies (i.e. Objective-C/Cocoa).
Otherwise, how could I include Google
Maps in a native app ?
Use Apple's framework "MapKit". See Displaying Maps and Annotations in the iPhone Application Programming Guide, this tutorial, and this tutorial for information on how to use MapKit.
In iPhone OS 3.0 and greater apple has created a custom Cocoa Touch control that allows developers to embed Google Maps into a native app. The maps support multi-touch and you can annotate the maps with custom views, find the user's current location and do other cool stuff.
The way to do this is to build your app as a regular web app (javascript/css/html). The embed that in a native WebView. The WebView is a container for iphone apps that are meant to be web apps. These apps are sold the same way as other apps on the app store.
It's not possible to write a native iPhone app in HTML/JS, http://code.google.com/p/iphone-google-maps-component/ may be of some use, or you can use:
UIApplication *app = [UIApplication sharedApplication];
[app openURL:[[NSURL alloc] initWithString: #"http://maps.google.com/maps?g=London"]];
Please see How can I launch the Google Maps iPhone application from within my own native application? for more info.
There is also Appcelerator Titanium, which looks to be a good framework for developing iPhone and Android applications using web technologies. They gave an interesting presentation on this at C4.
However, trying to "write once, run everywhere" on mobile devices will cause you to create something that is inferior on all platforms to native applications, because you will need to design for the lowest common denominator between them.