SQLite support on Windows Phone - codenameone

I'm currently porting an Android app to codename one. For the new app it is a requirement to work on iOS, Android and Windows Phone. In the description of the default codename one Database class it says that Windows Phone is not supported and should only used for "very large data handling". Instead the more portable Storage class should be used for small storage.
The native App currently uses several SQLite tables with rather difficult queries. I wouldn't call the amount of data very large, but definitely more than "small".
In The Road Ahead post it said that you will work on better Windows Phone support and also that something better for database storage is needed. Is there anything new planned for this or do I have no other choice than porting it somehow to Storage?

As part of the Windows VM rewrite we will need some form of database whether it will be the builtin sqlite or some other solution for SQL. Unfortunately we are still not at that stage in terms of the implementation so its pretty hard to tell when this will launch.
So generally there should be an SQL solution for Windows coming at some point but it's really hard to tell when that point in time will be. Ideally we want it ASAP but there are physical time/resource constraints involved.

Related

OS X App. Which is the best way to store data?

In a os x app, which is the best way to store hundreds of user record with a lot of information for each record?
I know that i can use CoreData, SQLite, Realm, plist or other solution.
Which is the most compatible (i think for example for a web use) and clean/light/fast method/type of database to store data ?
thank
Core Data is written by Apple to be used in Cocoa based applications. It is already included on the operating system, has 10 years of development behind it and is used in hundreds of thousands of applications on the app store already.
Using a third party library has tremendous risks associated with it.
I always recommend using Core Data on iOS and OS X because it is written by Apple, has a fully supported team of developers behind it and is a mature code base.
Using raw SQLite is possible but you will not get the same performance benefits as you will with Core Data.
Realm is focusing on the wrong things. Their data migration system is scary, they focus on raw speed when they need to be focusing on the overall picture. They might be targeting mobile but I do not agree with their goals.
Hundreds of records is not hard for any database system. It is when you get to 10s of thousands of records on a device that many of them start to fall down due to memory pressure (even on OS X).
Core Data is designed to help with the memory pressure. I am not aware of any third part framework that will do so.
I think the most important thing is to compare Realm with the other database. Realm use its own core and the others are based on SQLite (CoreData use SQLite).
Realm is the first database designed for mobile use. So with your case (OSX) you must consider if your app have the same functionning as mobile App: device restrictions.
Realm:
Very fast methods: see example here
Rapid execution: see benchmark here, yes thousands of user records!
Light: the embeded database less than 1MB
But in beta state. This mean that they are constantlyy in development
SQLite:
the "lite" in the name mean it's a light database. You have many libraries available in github to help you, full documentation and full examples.
Personnaly, I use Realm for My OSX App and despite it being in a beta state, I have all the features I need. Realm is faster than CoreData and save me thousand of lines of code and months of work. :)
I hope that this will help you.

How to store/retrieve data in OS X applications?

I am starting to develop my first Mac OS X application using Xcode. My background is LAMP, so I typically store everything in a MySQL database. What's the correspondent in OS X?
My application will simply allow the user to enter new data, and then to retrieve it based on filters.
I am not looking for specific code, but for some pointers as to how storing data into databases work in OS X. I have found very little resource on this subject.
SQLite is used in many situations where a database server isn't required. Apple uses it for things like their Mail app. You can use some of the built-ins of Xcode (like sqlite.h) or a command-line shim of some kind. Other variants of SQL will require a separate download.
Core Data uses an object model which may be more convenient in a storage sense, though it has a moderate footprint and learning curve, and it's not cross-platform. Which may be important for the data migration that's common with database work.
If you're just starting with desktop programming from a LAMP background, you could look into "wrapper" apps that let you package LAMP software on the desktop with a native GUI. Might be easier than going Objective-C from scratch since it's one of the more obtuse languages out there. Xojo is also nice if you're used to VisualBasic and need to do cross-platform work.

Deployable DB Interface

I have a database that I need to distribute to users (it's a directory of contact details) probably on CDs.
Users have varying platforms (OS and device wise - I'm willing to target desktops hence CDs).
I was thinking of some kind of deployable webapp that would provide a nice interface and a sqlite database. Does some kind of db interface exist with a highly customisable ui? Or does someone have a better way of doing this?
How big is the database? One simplistic option would be to generate a "contacts" webpage and burn this to the CD. Users can then search this from their browser or perhaps you could do it for them using javascript.
If you really need a DB then you're looking at an embedded database of some sort, however, since you've suggested sqlite I suspect you know this already and are looking at user interface options.
You have not specified a technology, so I'll just list several frameworks designed to develop database backed webapps:
Grails (Groovy/Java)
Rails (Ruby)
Django (Python)
All the above operate in a development mode that uses an embedded database (H2 or Sqlite). Your only challenge will be to ensure their runtime environments are properly configured, or shipped on the CD as well.
In conclusion, I pretty certain this has been done before. Have you also considered just shipping an installer for your webapp, rather than worry about the complexities of getting something to run from CD? For example you might wish to support more than one platform: Linux, Windows, Mac, etc.
Update
Someone has thought of doing this:
http://www.benjysbrain.com/misc/cdsite/

Does anyone have database, programming language/framework suggestions for a GUI point of sale system?

Our company has a point of sale system with many extras, such as ordering and receiving functionality, sales and order history etc. Our main issue is that the system was not designed properly from the ground up, so it takes too long to make fixes and handle requests from our customers. Also, the current technology we are using (Progress database, Progress 4GL for the language) incurs quite a bit of licensing expenses on our customers due to mutli-user license fees for database connections etc.
After a lot of discussion it is looking like we will probably start over from scratch (while maintaining the current product at least for the time being). We are looking for a couple of things:
Create the system with a nice GUI front end (it is currently CHUI and the application was not built in a way that allows us to redesign the front end... no layering or separation of business logic and gui...shudder).
Create the system with the ability to modularize different functionality so the product doesn't have to include all features. This would keep the cost down for our current customers that want basic functionality and a lower price tag. The bells and whistles would be available for those that would want them.
Use proper design patterns to make the product easy to add or change any part at any time (i.e. change the database or change the front end without needing to rewrite the application or most of it). This is a problem today because the Progress 4GL code is directly compiled against the database. Small changes in the database requires lots of code recompiling.
Our new system will be Linux based, with a possibility of a client application providing functionality from one or more windows boxes.
So what I'm looking for is any suggestions on which database and/or framework or programming language(s) someone might recommend for this sort of product. Anyone that has experience in this field might be able to point us in the right direction or even have some ideas of what to avoid. We have considered .NET and SQL Express (we don't need an enterprise level DB), but that would limit us to windows (as far as I know anyway). I have heard of Mono for writing .NET code in a Linux environment, but I don't know much about it yet. We've also considered a Java and MySql based implementation.
To summarize we are looking to do the following:
Keep licensing costs down on the technology we will use to develop the product (Oracle, yikes! MySQL, nice.)
Deliver a solution that is easily maintainable and supportable.
A solution that has a component capable of running on "old" hardware through a CHUI front end. (some of our customers have 40+ terminals which would be a ton of cash in order to convert over to a PC).
Suggestions would be appreciated.
Thanks
[UPDATE]
I should note that we are currently performing a total cost analysis. This question is intended to give us a couple of "educated" options to look into to include in or analysis. Anyone who could share experiences/suggestions about client/server setups would be appreciated (not just those who have experience with point of sale systems... that would just be a bonus).
[UPDATE]
For anyone who is interested, we ended up going with Microsoft Dynamics NAV, LS Retail (a plugin for the point of sale and various other things) and then did some (and are currently working on) customization work on top of that. This setup gave us the added benefit of having a fully integrated g/l system, which our current system lacked.
Java for language (or Scala if you want to be "bleeding edge", depending on how you plan to support it and what your developers are like it might be better, but also worse)
H2 for database
Swing for GUI
Reason: Free, portable and pretty standard.
Update: Missed the part where the system should be a client-server setup. My assumption was that the database and client should run on the same machine.
I suggest you first research your constraints a bit more - you made a passing reference to a client using a particular type of terminal - this may limit your options, unless the client agrees to upgrade.
You need to do a lot more legwork on this. It's great to get opinions from web forums, but we can't possibly know your environment as well as you do.
My broad strokes advice would be to aim for technology that is widely used. This way, expertise on the platform is cheaper than "niche" technologies, and it will be easier to get help if you hit a brick wall. Of course, following this advice may not be possible if you have non-negotiable technology already in place at customers.
My second suggestion would be to complete a full project plan, with detailed specs and proper cost estimates, before going with the "rewrite from scratch" option. Right now, you're saying that it would be cheaper to rewrite the system than maintain it, and you don't really know how much it would cost to re-write.
I suggest you use browser for the UI.
Organize your application as a web application.
There are tons of options for the back-end. You can use Java + MySQL. Java backend will save you from windows/linux debate as it will run on both platforms. You won't have any licensing cost for both Java and MySQL. (Edit: Definitely there are a lot of others languages that have run-times for both linux & windows including PHP, Ruby, Python etc)
If you go this route, you may also want to consider Google Web Toolkit (GWT) for creating the browser based front-end in a modular fashion.
One word of caution though. Browsers can be pesky when it comes to memory management. In our experience, this was the most significant challenge in doing browser based POS You may want to checkout Adobe Flex that runs in browser but might be more civil in its memory management.
What is CHUI? Character-UI, as in VT terminals? Or even 3270 style?
It sounds like you need a 3-tier system - the database backend, a middle-layer that runs the bulk of the back-end business processes, and a front-end layer for the CHUI / GUI / data-gateway.
All three layers can reside on one machine; or you can distribute the tiers out to various servers. The front-end layer would control the actual terminals, whether they are VT-terminals, or a web-browser, or a custom-written 'client' application.
Make sure you have considered the hardware needs here -- are you going to have barcode scanners, cash drawers, POS debit/credit terminals, et cetra? If you are using a standard browser, it might be hard to reliably integrate those items. (At the very least, you're likely going to have to write special applets to handle them.)
Finally, consider the possibility of a thin-client technology on Windows. It greatly simplifies system management, since you only have to upgrade the software centrally. Thin-client PC's are cheap -- sub $200.
Golden Code Development (see www.goldencode.com) has a technology that does automated conversion of Progress 4GL (the schema and code... the entire application) to a Java application with a relational database backend (e.g. PostgreSQL). They currently support a very complete CHUI environment and they do refactor the code. For example, the conversion separates the UI, the data model and the business logic into separate Java classes. The entire result is a drop-in replacement that is compatible with the original (users don't need retraining, processes don't need to be modified, the data is migrated too). This is possible because they provide an application server and a set of runtime classes that provide that compatibility. The result of the automated conversion is not something that needs further editing before you can compile and run it. True terminal support is included so hardware terminals still work (it requires a small JNI library to access NCURSES from Java). All the rest of the code in the runtime is pure Java. No Progress Software Corp technology is used in the resulting system and it runs on Linux.
At least one converted system is already in production, running a 24 by 7 mission critical environment. It is a converted ERP system that their mid-sized pilot customer uses to run their entire business.

Shared File Database Suggestion

I would like to build and deploy a database application for Windows based systems, but need to live within the following constraints:
Cannot run as a server (i.e., have open ports);
Must be able to share database files with other instances of the program (running on other machines);
Must not require a DBA for maintenance;
No additional cost for run-time license.
In addition, the following are nice to have "features":
Zero-install (e.g., no registry entries, no need to put files in \Windows\..., etc.);
"Reasonable" performance (yes, that's vague);
"Reasonable" file size limitations (at least 1GB per table/file--just in case).
I've seen this question
Embedded Database for .net that can run off a network
but it doesn't quite answer it for me.
I have seen the VistaDB site, but while it looks promising, I have no personal experience with it.
I have also looked at SQLite, and while it seems good enough for Goggle, I (again) have no personal experience with it.
I would love to use a Java based solution because it's cross-platform (even though my main target is Windows, I'd like to be flexible) and WebStart is a really nice way to distribute software, but the most commonly used DBs (Derby and hsqldb) won't support shared access.
I know that I'm not the only one who's trying/tried to do this, so I'm hoping I could get some advice.
I'd go with SQLite. There are SQLite bindings for everything, and it's very widely used as a embedded database for a large number of applications.
I use SQLite at work and one thing that you should keep in mind is that its file based and uses a file lock for managing concurrent connections. It is not a great solution when you have multiple users trying to use the database at the same time. SQLite is however a great database for one user application, its fast, has a small foot print and has a thriving community built around it.
If you've got VStudio sitting around, how about SQL Server 3.5 Compact edition? MSSQL running in-proc.
http://www.microsoft.com/sql/editions/compact/downloads.mspx

Resources