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
Related
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 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.
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
I'm getting started on a contracting project bid, and I was hoping for some advice on the best way to go about it.
I am being asked to develop an Android application for inventory management for a small company (no more than a few thousand SKUs at most) for Android tablets and I'm trying to come up with the architecture for the system.
I was thinking of using MS Server 2008 hosting a MSSQL database. This database would be exposed via REST services, as the DB would need to be accessible remotely (through Android tablets by salespeople).
I haven't used SQL much in the past, but I am thinking this is likely the best solution, along with REST for performing remote DB transactions.
Basically the functionality would be to view stock, order items, check prices, etc.
I would appreciate any advice anyone has on this topic.
Thanks!
I recommend you go over this article: Creating an OData API for StackOverflow including XML and JSON in 30 minutes. Then, consider the odata4j project.
Also, here is an interesting lecture about clienting REST for android:
http://developer.android.com/videos/index.html#v=xHXn3Kg2IQE
I would go for Oracle Application Express. They have build in Jquery Mobile and easy to expose a report list as Rest web service. Then use Phinegap and Jquery for Android apps.
Take look my quick sample: http://m.youtube.com/index?desktop_uri=%2F&gl=US#/watch?v=5rfuq-e-_Ws
You are not building an enterprise system....give a try Oracle Apex...you will be addicted to it.
Phonegap, Jquery Mobile and SQLite as local database on Android tablet .... Only if you need offline capability. Otherwise just use Oracle Apex with build in Jquery Mobile will be super solution!
I recommend you take a look at restSQL, an ultra-lightweight persistence framework. It currently supports MySQL and PostgreSQL. See http://restsql.org. It runs in a standard Java EE container, e.g. Apache Tomcat.
restSQL is not a conventional ORM. It does not present an object-oriented view of the database. It presents flat or hierarchical "views" of relational database tables. These views are query-able and updatable through a simple REST-based HTTP or Java API. The HTTP interface is based on REST principles, which use HTTP’s built-in features, rather than abstracting away from them.
I have used http://www.remobjects.com/ for this. Create the server in .net, delphi and clients in anything.
Also, is possible to use just http://www.remobjects.com/da/relativity.aspx if not have heavy logic in the middle-tier.
I am currently developing an Android application. I want to be able to access MySQL from my website directory without needing to use JSON, SOAP or PHP in order to access MySQL. Is it possible to to import a MySQL connector into an android app.
Thanks for the help
You can use protoBufs instead by Google or use mySQL's connector example here but using the connector wouldn't be safe as #Shaun said in his answer. So it is possible.
Wow, I like how someone actually said its not possible. This is java we are working with isnt it? Its not easy is the answer. You can always take a java library already written for this in full out java, and rewrite it to work with android. The problem? Its not easy, thats why there is not a very well known library for it yet. Theres alot of connection issues, and security issues to think about when doing this from a phone. One, you dont have a dedicated stream of connection (meaning, your connectivity could drop at any moment) and your data could be corrupt, or, you query coudl have left out the LIMIT at the end you could whipe your database. Secondly, you have to worry about the security of your database. Phones are in no way the most secure devices out there, let alone android.
No this isn't possible. You'll require a web service front end.