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.
Related
I'm developing my first android app (a social media kind-of App) and after some research found that a graph database (specifically Neo4j) could be the adecuate solution for data storage. I've been also been in touch with graph theory and graph algorithms lately and decided to give it a shot.
I've grown an interest on GDB due to how intuitive and easy is to understand and represent relationships between entities this kind of DB. I've also liked Cypher Query Language (Neo4j Query Language) intuitiveness for retrieving information from graphs. Thats the reason I would like to connect my app with a Neo4j database.
What I want to do is remotely storing my users database and retrieve user information for login. After some research I've found that Neo4j has different language's drivers including one for Java. And since Java is Android official language I would like to know if Neo4j java API will work on my Android project. Reading through Neo4j API documentation though, there's a statement that says that it has been deprecated and that I should use cypher and procedures instead, but I've failed on finding documentation about this. What would be the way to connect my app with a neo4j GDB using Cypher and procedures?.Where can I find some tutorials, documentation, examples to achieve
Please keep in mind that I'm still a beginner in Android development and GDB. Any help will be appreciated.
Forget REST. Look for using graphql (pros: only data you need, less network calls). There must be a lib for Android to consume gql, certainly from FB.
Look for the graphql plugin at https://github.com/neo4j-graphql/neo4j-graphql
However, be aware of security if you put your gdb on the web directly.
Will Lyon (Neo4j)'s article : https://www.oreilly.com/learning/building-a-simple-graphql-server-with-neo4j
I'm currently developing an Android application and I'd like to have an scalable architecture with a clean separation of concerns. The requirements of this application are, mainly:
User autentication (I'm dealing now with Google Sign-In for Android after many unsuccessful fights agains Android Identity Toolkit)
Synchronization with REST services (this application should be collaborative, I've already done a proof of concept to consume a "heartbeat" service, using AsyncService, that was the only way I've found to clean activies code, I got to that library researching about Robust Android Architectures)
ORM at client side to store user generated data and retrieved data in the future (my choice has been ORMLite for Android)
Material Design (as the best approach to the UI I have in mind)
First of all I'd like advices on how to separate classes inside the project, I mean, should I use folders (activity, model, DAL, service, sync...) or should I create my own libraries? (in .Net I'd create libraries with parent namespace)
My second and biggest concern is about user identity: how should looks like my architecture to achieve my goals? (sign up / Sign in with multiple providers, authenticated rest client and synchronization using SyncAdapter)
I hope you don bane this quiestion because maybe is too generic but I ask about all this stuff because I couldn't find information or advices about this stuff.
Thank you in advance.
This is a generic question and every dev has his own way to achieve this, but I would recommend to follow one of the trending patterns right now.
There is a project call the clean architecture. It has pretty much everything from dB to Api. In my opinion is a over-engineered.
I prefer another pattern called Flux.
Together with retrofit, eventbus or Otto makes building apps easy and keep the structure
You can read more about it here:
http://lgvalle.xyz/2015/08/04/flux-architecture/
I am building a social media application which requires local storage of table data entities. This data must also be connected to a server to retrieve and update information to and from users. Our team has built an iOS client using core data, though we are looking for storage options in android. Is using SQLite the way to go? Any thoughts would be greatly appreciated.
You should take a look at Realm, it has clients for Objective-C, Swift and Android.
Description from their GitHub repository:
Features
Mobile-first: Realm is the first database built from the ground up to run directly inside phones, tablets and wearables.
Simple: Data is directly exposed as objects and queryable by code, removing the need for ORM's riddled with performance & maintenance issues. Plus, we've worked hard to keep our API down to very few classes: most of our users pick it up intuitively, getting simple apps up & running in minutes.
Modern: Realm supports easy thread-safety, relationships & encryption.
Fast: Realm is faster than even raw SQLite on common operations, while maintaining an extremely rich feature set.
If you're familiar with RxJava, you will probably want to check SQLBrite, wich is Square's solution for this.
Yes, Sqlite is a default storage solution for android. Howevere there is a wrap around it called ContentProvider. ContentProvider can be used with Loaders and provide async data loading. ContentProvider may be used to modify contats and merge accounts, see this guide. However ContentProvider may seem tricky and if you prefer ORMs you can use ORMLite or GreenDAO which are using sqlite as well.
I am new to mobile app development and thus have a few questions.
Currently I am in a team that is about to develop an android mobile application for the Ice Cream Sandwich (4.0) operating system. This application will enable the user to fill out profile information which gets stored in a database that is not on the phone. However, since the database stores private information from the user, it should be private.
The purpose of the app is to utilize the user's profile information in conjunction with information of a geographic area (terrain, climate, flora, fauna) in the United States from an online database in order to calculate how well they will be able to survive for a given amount of time.
I am planning on using the Android development tools plugin with the Eclipse IDE.
So I wanted to ask a couple of major questions:
What will I use from the Java development tools to add users and enter in their profile information to the database? In other words, what will I use in order to communicate with the database?
Since the application will be pulling information from an online database, it will need some way of transferring and using that information. What can I use to do this?
Thank you,
Read up on SQLite support for Android and how to make HTTP requests:
http://developer.android.com/guide/topics/data/data-storage.html#db
There are a few libraries you can look into.
For database interaction (locally), ORMLite is nice. This gets you one step away from writing raw SQL, handles escaping for you, etc. It maps your database rows onto POJOs for you (as the name implies).
For the remote data, you'll want a REST (or SOAP? or ??) client. It isn't clear whether the remote data store belongs to you, or if so, whether you've created it yet. If it is already in place, you have less flexibility here.
The Spring framework offers a couple Android libraries including one for consuming REST services and one for authentication. I have also seen mention of people having success with Jersey.
If you do go REST, then you will (probably) be dealing with JSON. Jackson and Gson are the two main contenders here. Both offer automatic (de)serialization between POJOs and JSON. I've used Jackson, and I will probably try Gson the next time around. While Jackson is nice, I found the documentation to be a bit fragmented and hard to follow. Ymmv.
My latest project uses a combination of ORMLite, Spring's REST library, and Jackson to pretty good effect.
The gist is this: define some model classes, annotate the classes and their fields with a few things from Jackson and a few others from ORMLite, point Spring at your endpoint. Spring will retrieve the JSON, Jackson will parse it into model objects, and you can then use ORMLite to persist it to your local database. In the other direction, pull something out of your database (ORMLite hands you model objects), hand the model off to Spring, which uses Jackson to serialize the data before sending it out.
For both 1 and 2, you can develop web service that will allow android application to communicate with Remote database to either insert or retrieve or even delete records from database.
and here is a good Tutorial to give you clue how can you start doing so.Click Here Please
We are starting from scratch to develop a couple sophisticated mobile apps. We anticipate supporting iPad, iPhone, Android tablet and Android phones. However, our initial focus will be Android only.
The applications will be used to collect data and send that data to the backend. The whole scope of this project is data collection, data analysis, and data presentation. It's all about data.
What is the right backend technology?
EDIT: Sorry for not providing this info initially. The attraction of Python is the SciPy / NumPy libraries for data presentation and data analysis. I don't think any other platform has libraries that can match these. So Python/Django would seem ideal if there is no problem interfacing with mobile apps...
It will also be nice to use the same technology for the general website and I guess Python/Django is good in that regard too.
I don't see any difference between PHP, Python and Ruby in this case. As I understand, backend is going to be used as a database access layer and for nothing more complex. Am I right? If yes, go with technology you know better.
Why do you want to use Drupal for this task? From my point of view, it is better to use something more oriented on high performance and database interaction. Try Yii, Codeigniter or Fat Free PHP frameworks for example.
Django is a good choise as well because it has wonderful administration interface which is being generated by framework automatically. The only thing you should do is to set up models in your app and enable admin module.
Unfortunatelly, I have no RoR experience so I can say nothing about it except that a lot of people say that it is great.
Python/Django plus SciPy/NumPy proved to be the best option for our project.
The attraction of Python is the SciPy / NumPy libraries for data
presentation and data analysis. I don't think any other platform has
libraries that can match these.
Seriously: Java. You've got ease of use, statefulness and many very very good frameworks. And performance for large datasets is still very very good.
I'd especially recommend the Spring framework and hibernate.