storing Encrypted objects in J2me database - java-me

i am developing an application which can store encrypted objects in rms & retrieve them is there any API for storing & retrieving the Encrypted objects please suggest me thanks in advance

You can see list of Database in J2ME in this thread at JavaRanch forum. Or you can use Perst Lite(a Java ME embedded database).
I found above links in these questions:
J2ME With Sqlite
Is there any option for local database like Sqlite for j2me - CLDC devices?
Others :
Apache Derby - an open source relational database / about 2 megabytes
Java DB - Sun's supported distribution of Apache Derby database / footprint of 2.5 MB
Floggy - free object persistence framework for J2ME/MIDP applications / 11k API
J2MEMicroDB - free object persistence framework for J2ME
mDrawer - J2ME generic database program with DES encryption
RMS DB Class - J2ME class to provide easy access to the RMS-Database system of mobile phones
Micro DB - implementation of relation database in J2ME plataform
For small amount of data you also may use kXML + miniXPath

Related

Electron Desktop Application communicating with remote NoSql server

I've begun to dive into developing a desktop application with electron. I have been interested in pairing this application with a NoSQL database to create users, display data, and do CRUD operations. I've considered databases such as MongoDB and CouchDB, and I'm curious if creating a desktop application that communicates with a database hosted elsewhere is a feasible goal.
I'm hoping that someone here can help direct me to great resources on creating a desktop application that works with a remote NoSQL database. Any advice here would be greatly appreciated!
I recommend the use of CouchDB, which uses a JSON based document format. CouchDB bundles the server and data storage functionality in a single product, providing a REST-like HTTP interface for document insertion, updates, retrieval and deletion.
Therefore, you'll be able to interact with CouchDB directly from within the Electron desktop application. Apache CouchDB Nano is the official Node.js library for accessing CouchDB.
The following additional factors speach for CouchDB:
It is open source.
It has comprehensive documentation.
It is available for Linux, macOS and Windows.
It's easily installed and quickly set up.
It can be installed on your local computer (for development), on your own servers, or in the cloud.
It supports Mango querying language (inspired from MongoDB).
It is highly scalable.
It is shipped with Fauxton web interface that lets you create, update, delete, view and query documents on the fly.
etc.

Can HTML5 localStorage in Cordova/Phonegap app be synced to iCloud?

I have a Phonegap/Cordova app that runs on iOS. It saves it's data into HTML5 localStorage.
I'm trying to work out if it's possible to sync the localStorage data (using iCloud) to other iOS devices, and even OS X.
From what I can see, in iOS localStorage is actually implemented as a SQLite database, which (when using Phonegap/Cordova) is written to the app's Documents directory:
Documents/Backups/localstorage.appdata.db
I also understand that there are three main ways of storing data in iCloud:
Key/Value storage
UIDocument / NSDocument
Core Data
I know I can't use the Key/Value iCloud storage method, because I have more than 1MB of data to store, and the limitation is 1MB per app with that method.
This question, I believe is talking about the UIDocument method, and asks if it is possible to store a SQLite db file in iCloud using that method. The answer is no because the database may become corrupted.
So that really leaves the Core Data method.
So my question is - would this work? Could I sync the localStorage.db file to iCloud using Core Data?
I've never used Core Data and don't know much about it. I'm just wondering if it would be possible, or if there is something else I don't understand.
Are there any other ways to sync localStorage data between iOS devices or OS X ?
The answer unfortunatly appears to be no, Core Data cannot be used with HTML5 localStorage
Core Data can not be used with SQLite databases other than ones created with Core Data. If you try to, you get this error in XCode:
SQLite error code:1, 'no such table: Z_METADATA'
This is explained the Core Data docs:
https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdFAQ.html#//apple_ref/doc/uid/TP40001802-SW2
Although Core Data supports SQLite as one of its persistent store
types, the database format is private. You cannot create a SQLite
database using native SQLite API and use it directly with Core Data
(nor should you manipulate an existing Core Data SQLite store using
native SQLite API)
I still want to solve this issue though. I'm thinking of creating a Javascript API that mirrors the localStorage API. This would be a phonegap plugin that can call objective-c code, and effectively write it's changes to a Core Data database. The Core Data database should then be able to be synced to iCloud.
If it works, I'll come back and update this answer.

Single Shared Database, Fluent NHibernate, Many clients

I am working on inventory application (C# .net 4.0) that will simultaneously inventory dozens of workstations and write the results to a central database. To save me having to write a DAL I am thinking of using Fluent NHibernate which I have never used before.
It is safe and good practice to allow the inventory application which runs as a standalone application to talk directly to the database using Nhibernate? Or should I be using a client server model where all access to the database is via a server which then reads/writes to database. In other words if 50 workstations when currently being inventoried there would be 50 active DB sessions. I am thinking of using GUID-Comb for the PK ID's.
Depending on the environment in which your application will be deployed, you should also consider that direct database connections to a central server might not always be allowed for security reasons.
Creating a simple REST Service with WCF (using WebServiceHost) and simply POST'ing or PUT'ing your inventory data (using HttpClient) might provide a good alternative.
As a result, clients can get very simple and can be written for other systems easily (linux? android?) and the server has full control over how and where data is stored.
it depends ;)
NHibernate has optimistic concurrency control ootb which is good enough for many situations. So if you just create data on 50 different stations there should be no problem. If creating data on one station depends on data from all stations it gets tricky and a central server would help.

Local database in j2me midp 1.0

I am developing one application in J2me MIDP 1.0
It requires local database management. I have heard about recordStore but can we use it for permanent storage?
Yes, your application can store data using a RecordStore, and you can get it back later even if the application or the phone has been shut down.
EDIT:
One example I found:
http://www.roseindia.net/j2me/read-write-midlet.shtml
RecordStore, or more generally, MIDP RMS API is intended just for use for permanent storage:
...The MIDP provides a mechanism for MIDlets to persistently store data and retrieve it later. This persistent storage mechanism, called the Record Management System (RMS), is modeled after a simple record-oriented database...
If you're interested in more details, refer to javax.microedition.rms package API documentation. Since you mention MIDP 1.0, make sure that you don't use API annotated as since: 2.0 in these javadocs.
Also, online tutorials are available to get you started, like:
MIDP Database Programming Using RMS: a Persistent Storage for MIDlets
Databases and MIDP, Part 1: Understanding the Record Management System

Core Data - Encryption / Decryption on iOS

I know that in iOS, if the .sqlite is updated / read by SQL statement, then SQLCipher can be used to do encryption and decryption.
Is there any suggestion if Core Data is used instead ? The requirements are:
Core Data is used instead
Backup via itune for the application data is still be encrypted
Thanks
If you want the SQLite to be encrypted when the device is locked only, then the on-disk encryption feature introduced in iOS 4 is your answer.
Otherwise, you may need to encrypt stuff programmatically. Cf. Core Data SQLite encryption?.
But AFAIK, there's no built-in support of any SQLite encryption feature in Core Data.

Resources