This week's book giveaways are in the Cloud and AI/ML forums. We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line! See this thread and this one for details.
Since this weeks hot topic is web apps for Android I would like to ask if there is a 'preferred' architectcure or approach to developing web apps and / or extending them with rich clients for offline use. I am curious how an expert might approach a scenario like this. Can a web app be made for offline use like with Gears? Do I even need to worry about a client app per se?
There is not really a preferred architecture, depends what are the needs, you could us a classic 3-tiers architecture or maybe a more "modern" cloud based architecture(google app engine, noSQL db etc..).
Regarding the offline aspect, well in chapter 6 there a whole section on how to leverage the power HTML5's offline caching feature which will make your web app also available when there is no connection.
Thankyou for getting back to me. You mention HTML5's offline caching feature. Just how complex and large a 'thing' can you keep as offline? The whole app itself like a java webstart? Some persistant files? Does this limit you ability to work with the existing Android infrastructure like SQLite or do you have access to the lot (sensors etc...)? It would be very cool if you could do everything a 'regular app' can do but with a web app designed for Android. It sounds (or at least my interpretation) too good to be true! Am I missing something?
posted 8 years ago
Sebastien, once again thankyou. It seems that you can do a lot with web apps but not everything. Is there some sort of official specification for what can and cannot be done? I have a specific application in mind (using tablet's for gathering data in the field in a structured way) and would like to dig around the topic some more? Do you know of such a specification with regards to Android?
posted 8 years ago
There is no official specs of what can/cannot be done compared to a the native SDK but you can have a pragmatic approach, for example if you are planning to build the next killer First Person Shooter for mobile you probably won't choose a Web Based App.
But if you tell me a bit more about your app, I will maybe be able to say if it's doable with a Web based approach.
Well, simply put the application in mind is a 'shelf scanning' application. The idea is that ssomeone can go into a retail store or supermarket, scan the barcodes on the products, have a few 'special' codes probably done at a touch of the screen for things like items stacked two high or other such scenarios (end of row on shelf), and enter the price of the article. This effectively captures a type of picture of the shelf itself. The data would then be sent bacck to a central database where the shelf design can be compared to the sales performance of the store and its articles. This would help retailers to identify both dead areas in their store as well as articles that take up too much space, or dont have enough, etc....
Most of the heavy processing would be done on some server arrangement, but the shelf capture is best done in the hand. If the retailer wanted to they could contribute the product data and pricing to a 'global' database and maybe gain a few sales from price competition or simply adjusting their own prices relative to others.
This is an area I have spent many years dealing with but never found what I believe to be a simple and reliable solution. You usually get one or the other but not both together. Existing software for this area is all windows based and extremely expensive, so it puts it completely out of reach of the little guy. The goal of the software would be to correct that and help make the little guy as capable as the big guy - or as close as you can get. I have the knowledge and experience to build such things, just not yet with Android. Android is still new to me from a programming point of view but I firmly believe that it is the best thing to happen to embedded hardware since electricity, and being able to combine that with a web interface to the parts that do the heavy lifting makes a lot of sense to me.
There you have it. Nothing super complex but it might just be pushing the limits a little from the sound of it. Still, I think the reward could be worth the risk :-)
Cheers and Thanks
posted 8 years ago
This is a great concept and I'm sure you will be able to make it a success !!
Well the good news is that it's doable with a Mobile Web App if you agreed to use a bridging framework like PhoneGap. Why ? Because you need the camera and that's all. And in the future is more than probable that the camera will be accessible directly from the browser.
You could also easily add some Geolocation support, so when the picture of the shelf is taken it also automatically retrieves the shop based on its location.
The benefit of building a web based app will also be the fact to it will be easy to deploy on the different mobile platforms and provides automatically updates of your software.
Thankyou Sebastien. I really appeciate your help and guidance. I am really looking forward to this and I appreciate the encouragement too :-) Thankyou for taking the time to answer an Android noobies questions and point him in the right direction. Congratulations on the book and all success to you.
While I haven't tried it myself, I expect it should be pretty simple to implement. We have a little coverage on using PhoneGap plugins in chapter 12 in the book if you are after some guidance on the topic.
The plugin would probably give you a bit of a leg up in terms of getting your application started, although it does seem to rely on another app.