Database in Blackberry - blackberry

i am developing application in blackberry which use database.
i want to make generalize class for that just like DBadepter class in android which have all operation to perform for database. if any one have solution for that then send to me.
thanx.

you can also used persistence store for database check this link
it is easy compare to sqlite

Related

Best Practice to store local data in ios framework project

I am working on a custom framework which will be used by developers. I am saving some data locally inside my framework for that I am thinking to use UserDefaults but I want to know:
Is it the best method to do so?
If the app UserDefaults are cleared then will it clear my frameworks data also?
I want to know how can I store local data in ios framework. What is the best solution for this?
I am confused about it can anyone help?
It depends on the data you want to store.
If your goal is to keep some settings for your framework (e.g. whether some features should be enabled or not) then UserDefaults will do.
If you want to store user's data (or anything you can get from the server) then you should probably consider using CoreData, which is a native iOS/macOS/tvOS persistent storage.
You can also use Realm database, but it's not a good idea to use it in frameworks, since it will be added to any application which will use your framework (and the developers probably won't be happy about this).
Regarding you questions:
It depends, see above
Yes
Userdefaults is great but at times it turns into a mess if you have alot of information that needs to be stored. Specially the fact that you would need to manage a key/value relationship throughout the app and usually the keys end up being more than 10 plus ..
Just a suggestion but why not use CoreData to manage models and store data in sqlite db on device. When the framework is loaded you can check if the data exists if not then fetch it.
I would suggest using the functionality provided by apple natively rather than going for 3rd party solutions like Realm, with 3rd party you would need to upgrade to their latest version in order to make things work fine.
Please read these to clear any confusion.
https://cocoacasts.com/what-is-the-difference-between-core-data-and-sqlite/
Tutorial on using Coredata:
https://www.raywenderlich.com/7569-getting-started-with-core-data-tutorial

Creating static database in Objective-C and make it searchable

I am creating my very first app in Objective-C, which needs to contain static database in app itself. Idea is that even without internet connection user can use the database and search for the required info.
As I understood from what I read using Core Data and SQLite will not be very good in my case or I need to create a database separately and use it with Core Data or something like this.
Data in database will be only strings.
Can You please advise what will be the best way in my case?
Thanks
There is no problem in using Core Data, or you can simply use a plist file to store your 700 e-additives.

Is there any way to access database of an application from another application in iOS, with objective c?

I separated some processes. I have two application and i want to access database of one of them from another. Is there any way to access?
Answer is NO.
Each and every application in iOS is sandboxed, hence one app cannot access data of another one.
(I think it can be done on jail broken device).
No you cannot access database in one app from another app.
However there are always workarounds, such as using UIPasteboard
The UIPasteboard class enables an application to share data within the
application or with another application using system-wide or
application-specific pasteboards.
First you will need to create an application-specific pasteboard by pasteboardWithName:create:
You can then save your database in one app, and convert it to NSData, then put it into your application-specific pasteboard with setData:forPasteboardType:
You can read the NSData with dataForPasteboardType: and convert it back to your database format
Hope this help.
No, you cannot directly access database from one application to another.
But, you can achieve sync process between two application, by sending data from first application to server and fetching same data from server in your second application through web services.
Hope this info helps you..
It cannot be done directly, but you can share files between applications.
You can register your application to handle particular file types (e.g. *.sqlite files).
For example you can open attachments from Mail.app in other application like GoodReader or something else.
Here is more info
No, you cannot access contents from one application to another, as they are limited to itself.

Phonegap iOS DB Query

I am using Phonegap 1.3.0, and want to develop an app which uses local storage. Some googling brought me to sqlite, but i have had no success in implementing it in my app.
https://github.com/davibe/Phonegap-SQLitePlugin
I tried this link but i am really not sure what this lawnchair.js is all about.
Sqlite is my priority but I can try other options too. I also tried window.opendatabase() but it doesnt work in my app.
Thanks in advance!
Lawnchair is a wrapper over many storage methods. There is localstorage, sqlite, blackberry specific, and others.
There are many adapters in lawnchair to store stuff. http://westcoastlogic.com/lawnchair/adapters/
The way lawnchair works is, if an adapter is specified, it will use that, or if no adapter is specified and if the code of all adapters is appended to lawnchair.js file, then lawnchair checks which one to use in the order of they are appended and picks the first one it finds suitable.
What makes lawnchair easy to use is that we don't have to deal with sql syntaxs (assuming u want to use sqlite adapter.) You just store and retrieve your data in JSON by
table.save(key:"obj", name:{a:"aaaa", b:"bbbb"})
table.get(key:"obj", function(ob){
//callback
})
and internally lawnchair will save data in sqlite. You can use any adapter, but all u have to use is the above syntax. easy. lawnchair is a powerful wrapper over many storage options. check it out

Which database can be used with Xcode and at the same time be populated through a website?

We are trying to create an iPhone application that will automatically receive data from a database. Which is a database that will work with Xcode. Our goal is that users can go to our website and input information. That data will be recorded to a database. Once the user downloads our app, the info should then be retrieved from the database and included in the app. We are wondering what database is suitable. It must be able to receive information from a website AND submit it to an application.
You're unlikely to find a iOS "aware" database that can automatically sync content over the internet.
However, you can of course obtain the data over the internet yourself and then insert it into the local database on the device, in which case the popular (and supported out of the box) SQLite would seem like an obvious choice.
As #Deepak also suggests, you could use Core Data which is a (sort-of, ish) ORM that can automatically use SQLite as it's underlying storage mechanism.
The solution that most people use in this case is to use an RDBMS like MySQL and build a web-service layer on top of the database for the entities that your iPhone app is interested in.
This way, when a user goes to the web-app, they can add the data that you allow them to add there, and later on they can access the same data from the iPhone app via the web-service layer also.
Couchbase's new iOS-Couchbase framework is in beta right now - all the functionality of Apache CouchDB on your favourite developer platform - at https://github.com/couchbaselabs/iOS-Couchbase. the iOS release is new but we're looking for it to go places!
Its awesome sync abilities would allow you to pull down any relevant content from your website via HTTP/JSON, or further formats using shows and lists if needed. Pushing data the other way is just as easy. Sync can be continuous, or on demand, bidirectional or one way.
Take a look at some of the Couch App frameworks (not for iOS but for your website)
http://techzone.couchbase.com/community/articles/couchdb/recipes
http://www.mail-archive.com/user#couchdb.apache.org/msg13928.html lots of comments on this thread
A+
Dave

Resources