We are developing a web platform for data management in an industrial context with Xojo Web. Besides some limitations we’ve been facing, we are satisfied with the result.
It might not be the best place to discuss the problem I’m about to share here but, since I’ve always received constructive comments and inputs from the Xojo community, I thought I’d give it a try.
We needed a mobile app to go along with our web platform. We made a first prototype with Xojo. It could have been sufficient for the purpose of the application we wanted but the impossibility to make its Android counterpart out of the same code brought us in another direction.
For economical reasons, we considered hybrid application to be the best approach. It would make possible to use the “same code” for both mobile platforms we needed to develop for. Now, after a year and a half of development, we think we are in a dead end. We need our app to operate both online and offline. One of the main functionality is to use pictures taken by the user. When offline, the pictures have to be stored on the device until the user syncs the app with the database.
The Ionic framework we are using allows some workarounds (Cordova plugins) but we are facing serious issues related to the limited amount of data that can be stored on the device.
1- Are we right to think that in our context, hybrid apps will not fulfill our need? Is there any way around we don’t see?
2- If we are right, is the only solution developing native application for both platform?
3- If so, is there anything from what we developed can be of any use?
1… Hybrid apps always require compromise between the platforms (just ask Xojo). The question is, are those compromises something that the app can deal with today, and more importantly in the future? The positive is usually a single source library
2… Native apps usually result in a better user experience as they can be adapted to conform to the platform and to the expectations of the users of that platform. The downside is you must maintain a source library for each supported platform
3… The “concept” behind any GUI elements can be applied to most any platform, and of course all the business logic, especially if it were designed as GUI agnostic to begin with
ContextThe Ionic framework we are using allows some workarounds (Cordova plugins) but we are facing serious issues related to the limited amount of data that can be stored on the device.[/quote]
How much data are you trying to store?
We have been facing lots of crashes when “too many” pictures were saved on the device. As far as I know, the picture gallery can’t be used, neither the available dick space on the device.
I might be wrong but to be able to use disk space, all data has to be stored into the database file that is within the app folder. This involves converting pictures into base64, store then in the SQLite Database and retrieve it to send it after. We put put data into a JSON string and send it to the API where the data is synced and the pictures converted back into pictures.
We actually face a limit of around 30 pictures (1024x768). We had to reduce the picture resolution because the app was crashing after adding only a couple of pictures.
I’ve only briefly played with the Ionic framework so I can’t comment on that but there’s nothing stopping you, in Xojo or Swift, from saving as many pictures as you like, up to the capacity of the device, either stored in a database or simply saved as Image files, within the application’s own container.
Of course, this doesn’t yet give you an Android app, but Xojo does build native iOS apps.
70 pictures? that is nothing for starters…
2nd … you should not be “required” to store them as Base64. you could store them as Blobs, or (my opinion) store them as actual pictures, and let the database store a simple link instead. you should be able to store 1000’s of pictures
To start, I’ve only ever developed native on mobile for work I’ve done. (ObjC and Java and now Swift is in progress on another project for iOS/tvOS requirement. )
While I’ve played with cross platform on mobile, at the time when I had projects, the native approach seemed to always be the right one given the speed of change on the platform or specific use cases I had. (Most of my use cases were emergency communications centric) Something seems wrong with the limit you’re hitting, I would suggest a separate pair of eyes on that for a quick consult. It may be cheaper to just resolve this one issue if the rest of the application is solid. Preferably someone who’s spent time in the Hybrid space. It’s probably something silly and easily fixed with the right developer engaged.
With respect to online/offline, I’m actually just getting ready to dig into this and looking at using AWS AppSync (hosted GraphQL) which does apparently also support working with Ionic, though, as I’ve said, I’ve not touched that with any paid gigs. I do plan to look at it again when/if my crazy schedule settles down.