Realm.io database, Does it work on ChromeOS's app runtime? - android

So I am planning to use a database called realm for a new android app, but before I choose this as the data layer I need to know if it plays nice with the app runtime for chrome(ARC). Does anyone know if they are compatible?
Update:12/21/2015
I recently asked if there where plans to support realm on arc in the near future and the answer was no.
https://github.com/realm/realm-java/issues/1011

Realm is currently not compatible with ARC. There is a feature request here you can follow for updates: https://github.com/realm/realm-java/issues/1011

Related

Migrate sqlite database from android studio app to Xamarin.Forms app

I've been developing an android app for the last year or so in android studio. It has been in the play store since October and quite a few people are using it.
I have received many requests to create the same app for iOS and so after a lot of research I've settled on xamarin forms as it will be easier to code (as I'm familiar with c# and xaml) and less work to maintain the app for both platforms at the same time (even though it will take a while to port the code over).
The android app is using sqlite for data persistency and the xamarin version will do the same.
My question is, how could I port the sqlite databases of existing users to the new app once it is released? Is there a way to define the table/column names the same as I have set them in the android studio version?
Currently the app has a feature to export the database to the Downloads folder and the xamarin.forms app will import it from there.
I haven't seen anyone in any tutorial explicitly define the table and column names in their xamarin.forms sqlite implementation so I'm a bit worried to take the leap.
Is there a way to ensure that existing databases will work out of the box once imported in the xamarin.forms app? If not, could someone please point me towards a piece of code that will migrate data from one dB to another?
Thank you in advance for your time.
Regards
As I got a bit more familiar with the SQlite package in Xamarin.Forms, turns out that the answer is as simple as adding the [Column("my_column")] attribute above the property in the model. This way it will name the column to whatever is specified in the brackets and I can make sure it matches the database schema I have in my current project from Android Studio.
a bit of a "duh!?" moment here for me but thank you to all who have taken the time to answer!

Realm databases and compatibility between different schemas

I am creating Android app and need a way to store data and sync with server so i have posibility to have access to the same data from different devices and places. I am consider using Realm Database. I think that it will match all my requirements. But i have one question. Let assume that we released version 1.0 of our application, few users have access to one realm (lets name it REALM-ONE), they are making changes there(insert, update, delete). In meanwhile we developed a next version of our app with a little changed schema, i mean we add one property to the object and make a breaking changes in another(e.g. merge two properties into one and change data type). Part of the REALM-ONE users updated app to the newest version(other users cannot because of too old version of android), and i want everyone to have opportunity to still using the REALM-ONE as before without need to update app. Quick diagram:
According to docs i know what will happen with new property, it will update on server and be visible in v2.0 but surely should not be visible for previous version of the app. And what with breaking changes ? Can i support this change in v1.0 ? Can it still collaborate together ? Can I managed it with realm notifications or realm functions ?

cross platform syncing solution with offline and relationship support

I am relatively new to app development and core data, so take it easy on me. I have been working on an app (currently for iOS, android in the future too) which stores the user's data locally using core data.
The data has relationships across entities. User can create, update, delete data.
Now I need to integrate some kind of syncing solution. My requirements are:
Data should be accessible offline (right now I am testing queue operations for that)
Data should sync to cloud storage when network is available (on iOS I have tested out reachability for this)
Cloud storage needs to be integrateble to both my current iOS and future android version.
Relationships (or some other way of linking parent-child, i talk about it later) need to be maintained.
Core data on ios should be used, not third party replacement.
I have messed around with many solutions so far:
I setup my own rethinkdb database on a server and used PHP and REST to get things going. This was very messy.
I tested parse.com and afnetworking http requests (instead of parse's library) - this was better, but i couldn't seem to be able to manage the relationships from core data. And my syncing algorithm is complicated (it works but I am not sure if there are holes in it when it may fail)
I tested dropbox datastore api. I have only tested the iOS sample app they provide, seemed pretty good (still need to understand the workings).
My questions are:
If I were to use dropbox datastore api, how does it work with android? of course core data is not available there, so how does that work (sorry I don't have android dev experience yet)? ALso how does it handle relationships between entities?
If I go with Parse.com, do you think my this idea will work-
Instead of using relationships, I can use identifiers? my relationships are all 1-to-many, so on the parent (1) I can have an id A. On all the children I can point their parentid to A. Also since my children can have grandchildren too, on each of the children I can have another id which the grandchildren can point to. So on... does this make sense as a replacement of relationships? If yes, then what's the point of relationships in xcode?? other than having automatic cascade option maybe.
Are there any better solutions available for syncing cross platform?
I know my question may seem a bit asking for opinion, but I would like to see what everyone else has already tried. Past week of switching from one solution to another and designing the syncing algorithm has fried my brain.
(I work at Dropbox and will address just that part of the question.)
The Dropbox Datastore API doesn't use core data and thus works exactly the same way on Android. Why is core data a requirement?
As to relationships, what you describe for Parse is exactly what I would suggest for use with the Datastore API. I believe you're right that the reason for modeling relationships in databases and in code is to get automatic cascading operations and enforcement of relationship invariants.

Using an SQL query builder library/framework with Android

I am currently working on an Android project and will have to manage database connection and queries to store data. I will not be working with SQLite as provided by the Android device and using it is not an option.
As I need to build quite a lot of queries I wanted to use a library or framework to make the task easier. Looking at what was available, it seemed easiest to use a framework such as, for example, QueryDSL.
However, since I am working on Android, I am not sure if the framework is usable and what using it would entail. Does somebody have experience using an external database with Android and have any recommendations?
The recommended way to connect to an external database is to use a REST client.
See this post

how best to cope with different versions of Android?

I have an app that works fine in Android 1.x but not in Android 2.x
i need to do things different based on the version of Android the app is running on (querying contacts).
is it possible to have two separate methods within the one app that i can choose based on the version of Android the app is running on?
many thanks
Ed
Use reflection and class loaders. See this post on the Android developers blog: http://feedproxy.google.com/~r/blogspot/hsDu/~3/9WEwRp2NWlY/how-to-have-your-cupcake-and-eat-it-too.html
Edit:
Thanks to CommonsWare for pointing out a sample project which uses both the new and old contacts content providers and conditional class loading: http://github.com/commonsguy/cw-advandroid/tree/master/Contacts/Spinners/
you can get the sdk version with BUILD.VERSION, check
How to retrieve the android sdk version?
however, i am wondering what function is runnable on 1.x and not available on 2.x.
did you use any of the internal classes?
I really suggest that you fix the function issue, rather than doing different things with different versions, if it can be avoid.
You can read out the OS version of the device.You can have different methods in your app depending on the device OS version, but you can only compile against one SDK version. Therefore, you need to choose the minimum, which at the moment currently is 1.6 (I think 1.5 is rarely used anymore)
see:
http://developer.android.com/reference/android/os/Build.VERSION.html
developing for multiple screens / devices:
http://developer.android.com/guide/practices/screens_support.html
The Business Card example that comes with the latest Android SDK was a big, big help. I recommend it to those that like me might not be a professional full-time developer. Thanks everyone for your kind input.

Categories

Resources